Clean column names in R with clean_names()

preview_player
Показать описание

Have you ever loaded data into R only to find that the column names contain spaces, parentheses, camelCase, or are otherwise difficult to work with? In this video, I'll show you the clean_names() function from the janitor package, which I run whenever I load data from a file into R. It cleans the column names of the file.

Here's a link to the example dataset (SpaceX launches in 2020) used in this video:

Note -- you'll need to use read_tsv() rather than read_csv() to load this data into R because the data is "tab-delimited."
Рекомендации по теме
Комментарии
Автор

Thank you so much for showing the important step of saving the dataframe anew. I have been cleaning names but then would click on the dataframe in the Environment and couldn't figure out why the changes weren't showing up.

jenniferahakes
Автор

thank you so so much i've been stuck on this for a while now

nerdygirl
Автор

Simple and effective. It definitively saves me a lot of time when cleaning data. Thank you for sharing.

sloperspinches
Автор

Great Tip, saves lot of time in cleaning column names. Thank you so much.

jitendarreddy
Автор

Hi, I just want to clean "CQ22." from following data. Is it possible?
CQ22.Allergy
CQ22._Chest_Pain
CQ22._Cough
CQ22._Hair_Loss
CQ22._Irritable_Mood

mohammadsaifuddin
Автор

What's **your** favorite function in R that's underrated?

tomhenry-datasciencewithr
join shbcf.ru