On the iris database I have to create a vector that acts as the Identity of it. (which contains the # numbers from 1 to the number of rows of iris).
On the iris database I have to create a vector that acts as the Identity of it. (which contains the # numbers from 1 to the number of rows of iris).
With base R you can create a vector that goes from 1 to the number of total rows
The function
dim
returns the dimensions of a df, which can be used like this:Using
tidyverse
you can use the functionrow_number()