1

I am attempting to rename values within my data frame "meansleep"

I have columns "Id" within the Id columns I have 22 values and I am attempting to rename these values to "sleepy1", "sleepy2", "sleepy3", ...

I am using function meansleep$Id\[c(1:22)\] \<- c('sleepy1', 'sleepy2', ...)

Is there a way to run this function without retyping all the sleepyvalues.. for instance to correlate c(1:22) to c('sleepy1':'sleepy22')

Thank you

1
  • Those backslashes shouldn't be there. Commented Apr 2, 2022 at 1:53

1 Answer 1

1
meansleep$Id <- paste0('sleepy', 1:21) 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.