Suppose you have Sales data like this. Now you want to calculate the skewness of all the numeric columns such as “Sales”, “Quantity” etc. Here is how.
Install “moments” package (You need this only for the 1st time.)
- Open the “Manage R Package” dialog from the project menu.
- Choose “Install New Packages”, type in “moments” and click “Install”.
Calculate skewness for all the numeric columns.
- Select “Custom R Command” from the + button.
- Type in the command following to calculate skewness for each numeric column by “moments::skewness” function.
summarize(across( is.numeric, list(skewness = ~ moments::skewness(.x, na.rm = TRUE)) ))
Now you get the skewness for all the numeric columns in the data frame.