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

AndrewGB
  • 16,126
  • 5
  • 18
  • 49
Stackstudent_09
  • 131
  • 1
  • 9

1 Answers1

1
meansleep$Id <- paste0('sleepy', 1:21)
Sweepy Dodo
  • 1,761
  • 9
  • 15