How to create new variables in R - How to dplyr mutate function (verb)

preview_player
Показать описание
This is a quick tutorial on how to use the mutate function in dplyr. The mutate function lets you create a new variable for your dataframe.
Рекомендации по теме
Комментарии
Автор

Only mutate video I could find showing us how to add a bucket column (size). TY!!!

thesoaringdividend
Автор

Your videos are great and help me a lot!! I hope you can help me out: I want to create 3 factors in a new variable . E.g < 3 --> small, between 3 and 5 --> medium and >5 --> large - how can I use the mutate function in this situation?

malterosagerhansen
Автор

Hi there, can you help me out ? I have a graph with 3 categorial values out of 8 marked as "Less than $50, 000", "Less than $75, 000" and "More than $75, 000". I want to make those marked as "High Income" and the other 5 ones as "Low income". How would I do that ?

charlotte
Автор

Hi I used mutate, However it substitutes the values of the variable with large/small. It does not create a NEW variable

nicolavarrone
Автор

Hi!


Was hoping to get some help here, have a dataframe I want to add a new column to, video is doing great showing that so far, but I want the new column to be a random categorical variable. Example with your dataset, I need to create a new column called "type" and I want to randomly assign values either "red" or "green" I was thinking something like mutate(iris, type = ....) I"m not sure what "rand" function could do this. Any help would be appreciated.

Love the videos.


Cheers

davidlopez-felb
Автор

Hi there, I hope you could help me out :)
I have a data set and my task is to add 2 dummy variables. They both should indicate 1 if one of the variables, both are strings, contain a certain letter or word.
How would I do that? I read something about the "substring" function but I just can´t figure it out...

TheCooPeer
Автор

How to use OR command with "text" variables

pallavidubey
welcome to shbcf.ru