You can add index using seq(1:nrow(data frame)).
mtcars %>% mutate(Id = seq(1:nrow(mtcars)))
matcars_new = mtcars %>% mutate(Id = seq(1:nrow(mtcars)))
It is as easy, as you think:
Use nrow() to find number of rows ...READ MORE
How to fit different elements in a ...READ MORE
With the help of Dplyr: rename function ...READ MORE
Basically here we are making an equation ...READ MORE
By assuming that all the values are ...READ MORE
For avoiding rowwise(), I prefer to use ...READ MORE
Basically all we have to do is ...READ MORE
colSums(is.na(data_frame_name)) will return you number of nulls ...READ MORE
You can also try this.
which(iris$Sepal.Length == ...READ MORE
Already have an account? Sign in.