# 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 value`y`

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