Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library
Handy tip for anyone following: If you want to rename AFTER you have already renamed, you need to put the changed variable name into the select() field so it retrieves the new variable that can then be renamed for a second time. starwars_mod % #storing the starwars dataframe into new dataframe called starwars_mod select(sex, mass, height, species, everything()) %>% #orders specified columns and puts all everything else after. rename(gender_true = sex) #changing variable name from "sex" to "gender_true" Second renaming code starwars_mod % #storing the starwars dataframe into new dataframe called starwars_mod select(sex, mass, height, species, everything()) %>% #NOTE that variable sex must be renamed to the new variable name gender_true rename(gender_2ndRename = gender_true) #changing the renamed variable again but to "gender_2ndRename"
I get an error "object not found" eventhough the variable appears in the header., so i´ve been unable to rename it. Any help? I already checked for misspelling
Quick question: When I renamed the mass column weight, the console showed a change in the name but the actual graph still remains as mass. How do I fix that? ]
I think you should check which variable you are using for making the plot. In the above example, the variable mass is renamed to weight and is stored in sw, not in starwars. So while making your graph you should use sw.
Same. Tidyverse must have been updated from when this video was produced, but you have to do rename(weight=mass): sw=starwars %>% select(name,mass,height) %>% rename(weight=mass)
Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library
I love this guy. Short, no BS, well-presented and approachable tips for programming dunces like me. Subscribed.
Wow, thanks!
SO HAPPY you have a new video. I have learned so much with you, thank you for doing this!
You just have the best R tutorial so far that I have seen. Love it soooooo much. And thank you.
Yeah, he is BACK !!!
Looking forward to see more video on R
Thanks - will be creating more for sure :)
@@gregmartin I love your videos please teach us more.
You have the best videos ! You make it fun and super duper easy 😂
Glad you like them!
Real smooth, thanks for keeping it simple and straight forward :)
So happy to hear that! You are most welcome!
The best!!!
Thanks
THE BEST!!!
Thanks!!
Short and to the point. :)
Thanks - 🙂
Nice one!
Excellent .. thanks a lot
Is there an easy way to rename 150 variables without writing in each variables old and new name?
Handy tip for anyone following: If you want to rename AFTER you have already renamed, you need to put the changed variable name into the select() field so it retrieves the new variable that can then be renamed for a second time.
starwars_mod % #storing the starwars dataframe into new dataframe called starwars_mod
select(sex, mass, height, species, everything()) %>% #orders specified columns and puts all everything else after.
rename(gender_true = sex) #changing variable name from "sex" to "gender_true"
Second renaming code
starwars_mod % #storing the starwars dataframe into new dataframe called starwars_mod
select(sex, mass, height, species, everything()) %>% #NOTE that variable sex must be renamed to the new variable name gender_true
rename(gender_2ndRename = gender_true) #changing the renamed variable again but to "gender_2ndRename"
I'm really enjoying your videos. are you able to make a video on data merging?
Thanks! Great suggestion! 👍
so clear, thank you
Nice tutorial. Any chance to see tutorials on how to use R with spark?
I get an error "object not found" eventhough the variable appears in the header., so i´ve been unable to rename it. Any help? I already checked for misspelling
check if you are capitalizing a letter of the header or vice versa.... R is case sensitive
You could miss the %>% at select( ) statement
Quick question: When I renamed the mass column weight, the console showed a change in the name but the actual graph still remains as mass. How do I fix that?
]
I think you should check which variable you are using for making the plot. In the above example, the variable mass is renamed to weight and is stored in sw, not in starwars. So while making your graph you should use sw.
Long time no see!
Glad to be back !! :)
@@gregmartin Am happy you're back
How do I save that rename? When I bring the data set back up it reverts back to its original names
Error in rename(., weight = mass) : unused argument (weight = mass)
Hello i imported an excel sheet and the name of the column is an entire question. How can i rename it?
Do you have data sets available for us to download for practice?
2:51 booya shaka😂😂
haha -
Hi is the pipe operator can be used only with tidy verse package? Or we can use it in any other data?
Only with tidyverse package, as per my understanding
I am a PHP MySQL developer ... so can i implement R with PHP-MySQL ?
Error in `rename()`:
! Can't rename columns that don't exist.
✖ Column `mm` doesn't exist.
Backtrace:
1. gbdata2 %>% select(compliance_to_tt_in_mon) %>% ...
3. dplyr:::rename.data.frame(., compliance_to_tt_in_mo = mm)
sw = starwars %>%
select(name,mass, height) %>%
rename( mass = weight) code did not change the starwars dataset mass to weight
Same. Tidyverse must have been updated from when this video was produced, but you have to do rename(weight=mass):
sw=starwars %>%
select(name,mass,height) %>%
rename(weight=mass)
man i just wanted to see how you put categories on first row in respective columns and adjacent data🤕
I heard the creator of this video passed away . Is that true