Manipulating Data
General
- Sorting
- Randomizing order
- Converting between vector types - Numeric vectors, Character vectors, and Factors
- Finding and removing duplicate records
- Comparing vectors or factors with NA
- Recoding data
- Mapping vector values - Change all instances of value
x
to valuey
in a vector
Factors
- Renaming levels of a factor
- Re-computing the levels of factor
- Changing the order of levels of a factor
Data Frames
- Renaming columns in a data frame
- Adding and removing columns from a data frame
- Reordering the columns in a data frame
- Merging data frames
- Comparing data frames - Search for duplicate or unique rows across multiple data frames.
- Re-computing the levels of all factor columns in a data frame
Restructuring data
- Converting data between wide and long format
- Summarizing data - Collapse a data frame on one or more variables to find mean, count, standard deviation, standard error of the mean, and confidence intervals
- Converting between data frames and contingency tables - Data frames with individual cases, data frames with counts, and contingency tables
Sequential data
- Calculating a moving average
- Averaging a sequence in blocks - Convert a sequence into blocks of a given length and average within each block.
- Finding sequences of identical values
- Filling in NAs with last non-NA value
当前内容版权归 cookbook-r.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 cookbook-r.com .