Often I want to get the mean value for a case across a number of columns, usually years. This however gets repetitive because the base mean() function cannot handle data like that. Other times, one wants to standardize the data first, e.g. when the scales are not the same across variables. Lastly, often one wants to use just a few columns, usually marked by a special name. Before, these tasks were time-consuming. Now they are easy. Consider the iris dataset:
kirkegaard: df_func()
kirkegaard: df_func()
kirkegaard: df_func()
Often I want to get the mean value for a case across a number of columns, usually years. This however gets repetitive because the base mean() function cannot handle data like that. Other times, one wants to standardize the data first, e.g. when the scales are not the same across variables. Lastly, often one wants to use just a few columns, usually marked by a special name. Before, these tasks were time-consuming. Now they are easy. Consider the iris dataset: