Categories
data science

Ordering Rows in a Data Frame – R

How to re-arrange the rows in a Data Frame using the values in a column. First we must build the data frame. Build Data Frame This data frame will have two columns, one for names and one for ages. We shall call it `df’ Now we can put both vectors into the data frame. Ascending […]

Categories
data science

Reordering Columns and Rows – R

How to reorder columns and rows in a dataframe. We start with three vectors which we will put into a data frame called tDF Renaming Columns There is away of entering the names when building the data frame, like this… But let’s just prentend we forgot to do that, and instead we’ve ended up with […]