dplyr: transforming and manipulating the palmerpenguins dataset
The dplyr package makes working with data easier when ideating and provides a replete grammar in the form of a computer program to perform actions. These actions can be expressed as verbs or grammatical tools when confronting your data manipulation challenges. Being able to create some new variables or summaries helps provide deep insights beyond the purely naked eyeballing of rows and columns. Sometime you may just simply want to rename() a variables or reorder the observations so your environment becomes that bit more manageable. Fortunately, dplyr furnishes a simplified set of functions/verbs that correspond to the most typical data manipulation tasks. dplyr provides a pathway to help you translate your thoughts into working practicable code.
dplyr is a grammar of data manipulation, providing a consistent set of verbs that help you solve the most common data manipulation challenges:
mutate() adds new variables that are functions of existing variables
transmute() adds new variables and drops existing ones. New variables overwrite existing variables of the same name.
select() picks variables (coulumns) based on their names.
filter() picks cases (rows) based on their values.
summarise() reduces multiple values down to a single aggregate summary.
arrange() changes the ordering of the rows.
These all combine naturally with group_by() which allows you to perform any operation “by group”.
best starting point for newbies
https://r4ds.had.co.nz/transform.
video explanation