I want to paste together results within the same case_when statement (i.e., if multiple statements are true for a given row). I know that I could do something l
I'm wondering if there is a better way is to get linear regression coefficients as columns in dplyr. Here is some sample data. mydata <- data.frame( S
I'm trying to count the number of NA values in each of 2 columns. The code below works. temp2 %>% select(c18basic, c18ipug) %>% summarise_all(funs(sum
I have several data frames that have the same columns names, and ID , the following to are the start from and end to of a range and group label from each of the
I want to rename multiple columns that starts with the same string. However, all the codes I tried did not change the columns. For example this: df %>% renam
I have a dataframe looks like below: Place Time1 Time2 Time3 Time4 Time5 Time6 Time7 Time8 Time9 ... CA 0.2 0.3 0.1 0.
How can I extract all text after first space in a column where data is something like this structure(list(value = c("1.1.a Blue sea", "1.2.a Red ball")), row.na
I have a dataframe of family relationships (parent, child, spouse, etc.) which is partially filled as per example below. I am trying to use R to fill in the mis
I am using R to work with some dataframes. My issue is related on how to check if values in a variable in a first dataframe match with values in another datafra
I have two simulated data frames: d, created below, which has all the rows of longitudinal data for two different people. Each row has a start and end date. Som
I am trying to adapt this solution, by onyambu: New data dat_in_new <- structure(list(rn = c("Type_A", "Type_B" ), `[0,25) east` = c(1269L, 85L), `[0,25)
I have this dataset about vessels locations, where the same "id" can correspond to two levels. Corresponds to a defined category, such as "fishing" and may also
How to add new column with variable? I have a problem must use variable to add column. library(dplyr) data(iris) x<-"newcol" iris %>% mutate(x="only te
I'm attempting to figure out the amount of days in between games and if that has an impact on wins/losses, this is the information I'm starting with: schedule:
I have the following decision rules: RELIABILITY LEVEL DESCRIPTION LEVEL I Multiple regression LEVEL II Multiple regression + mec
I've looked quite a few different questions on here around Pivot Longer but I can't seem to figure out how to get my scenario to work. For example R Pivot multi
I'm running a study in which each participant will be presented with stimuli that have been randomized at two different levels: blocks (3 unique blocks) and tri
I have a simulated data set with 5 rows, each representing a block of person-time, each with its own start and end date ('start' and 'end'). Each row has a visi
I have a data frame that has this structure: dat <- data.frame(col1 = sample(0:3, 10, replace = TRUE), col2 = sample(0:3, 10, replace = TRU
I am trying to expand on this answer, by creating a solution that works both on the new_dat and the old_dat. New Data new_dat <- structure(list(`[0,25) east`