Data Preparation and Management with R
October 4, 2024
tidyverse
DATA.FRAME |> filter(LOGICAL_CONDITIONS)
DATA.FRAME |> arrange(VARIABLES)
DATA.FRAME |> distinct(VARIABLES)
DATA.FRAME |> select(VARIABLES)
DATA.FRAME |> rename(NEW_VARIABLE = EXISTING_VARIABLE)
The subsequent arguments describe what to do with the data.frame, mostly using the variable names.
The result is a data.frame.
filter()
filter()
NA
)filter()
NA
)x
be Mary’s age. We don’t know how old she is.y
be John’s age. We don’t know how old he is.filter()
is.na()
is.na()
.filter()
for them explicitly.