Data frames in R - Transforming data PART I

Опубликовано: 01 Октябрь 2024
на канале: 365 Data Science
2,639
28

👉🏻 Download Our Free Data Science Career Guide: https://bit.ly/2DZt6hc
👉🏻 Sign up for Our Complete Data Science Training with 57% OFF: https://bit.ly/2QctScR

How to filter, mutate, and summarize a data frame in R using the dplyr package.

The filter() function does what we think it does: subsets a data frame according to a set of criteria. It works like this: we pass the data, and then the expression according to which we want or data filtered. There can be more than 1 criteria, of course. Filter() also works with logical operators.

The select() function narrows down the data frame to the information you specifically want and need to see. Select() works nicely with a couple of nifty functions like starts_with(), or ends_with(), which let us subset data in a super intuitive way.

Mutate() is dplyr’s easy way of creating new variables from variables that already exist in the data frame. For example, if you have height and mass information, you can create a BMI variable.

If mutate() is the function to use when you want to add a column to your data frame while also retaining all the other columns in your data frame, then transmute() is what you will opt for if you only want to keep the new variable you create.

► Consider hitting the SUBSCRIBE button if you LIKE the content: https://www.youtube.com/c/365DataScie...

► VISIT our website: https://bit.ly/365ds

🤝 Connect with us LinkedIn:   / 365datascience  

365 Data Science is an online educational career website that offers the incredible opportunity to find your way into the data science world no matter your previous knowledge and experience. We have prepared numerous courses that suit the needs of aspiring BI analysts, Data analysts and Data scientists.

We at 365 Data Science are committed educators who believe that curiosity should not be hindered by inability to access good learning resources. This is why we focus all our efforts on creating high-quality educational content which anyone can access online.

Check out our Data Science Career guides:    • How to Become a... (Data and AI Caree...  

#dataframes #statistics #datascience