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 Answer 1

1
$\begingroup$

Use mutate in combination with row_number as follows:

df %>% mutate(row = row_number())
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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