0
$\begingroup$

I am new to R and would like to insert a new column that numbers the row to a large dataset.

I have no idea how to use 'mutate()' to insert this. Would appreciate any help.

Thanks.

$\endgroup$
1
$\begingroup$

Use mutate in combination with row_number as follows:

df %>% mutate(row = row_number())
$\endgroup$
1
  • $\begingroup$ Thanks, it worked $\endgroup$ – BioIsaac Jan 11 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.