I have a string column with commas. I want to convert this single column into multiple labeled columns, with values filled in appropriately. The output data frame would have 3 columns (A, B, and C). Row 1 would have columns A and B filled in with "Yes", and C with...

## Count data divided by year and by region in R

I have a very large (too big to open in Excel) biological dataset that looks something like this What I am looking to do is figure out how many of each species (A, B, or C) exist in each region (1, 2, or 3) in each of the three years...

## Find variable combinations that makes Primary Key in R

Here is my toy dataframe.How can I get the combination of a minimum number of variables that uniquely identify the observations in the dataframe i.e which variables together can make the primary key?

## Split string every n characters new column

Suppose I have a data frame like this with a string vector, var2What is the most efficient way to split var2 every n characters into new columns until the end of each string,

## Use broom and tidyverse to run regressions on different dependent variables

I'm looking for a Tidyverse / broom solution that can solve this puzzle: Let's say I have different DVs and a specific set of IVS and I want to perform a regression that considers every DV and this specific set of IVs. I know I can use something like for...

## Fill numeric variable while preserving group

[EDITED to reflect a better example]Say I have a dataframe like this:How can I increment year by 1 while preserving x? I would like to fill in year so that the sequence is this: