Relative Content

Tag Archive for rdplyr

Pooling time series data in R

I think this might be a common problem but I could not find an answer for this.
I have yearly data and I would like to create a pooled group (i.e., a new year that combines the data from the previous year). For the combined years, I would like to pick the non-missing value from year 3. If year 3 is missing I would like to pick the maximum of the values in prior years.

Pooling time series data in R

I think this might be a common problem but I could not find an answer for this.
I have yearly data and I would like to create a pooled group (i.e., a new year that combines the data from the previous year). For the combined years, I would like to pick the non-missing value from year 3. If year 3 is missing I would like to pick the maximum of the values in prior years.

Count the number of replacements done by str_replace_all in a dplyr workflow

I have to clean a messy data frame, mostly using str_replace_all in a dplyr workflow. I would like to summarize my corrections in a table including counts of each replacement made. Ideally, str_replace_all would do this in one go, because finding these typos (doing the replacements with str_replace_all) in a huge data frame takes quite a while.