Non-mutually exclusive race categories into mutually exclusive categories in R using Dplyr
I was interested in recoding non-mutually exclusive race categories into mutually exclusive race categories.
Non-mutually exclusive race categories into mutually exclusive categories in R using Dplyr
I was interested in recoding non-mutually exclusive race categories into mutually exclusive race categories.
pmax (pmin) na.rm not working – Problem with NA/NaN Argument
I am dealing with a problem related to the pmax
(and the pmin
) function. I know it is used to get rowwise max (min) values. And what I wanted to get are the max and min values so to set some columns to a new range that is balanced for my analysis. The a:g is the old range and e:g is the new range that I want to use and balance out. My dataframe is not exactly the same (quite big actually), but for the sake of getting to the point, lets say the df is like this:
How can I use the across() function in dplyr to apply custom functions that return multiple columns?
I’m exploring the across() function introduced in recent versions of dplyr, and I’m trying to understand how to use it to apply a custom function that returns multiple columns. Specifically, I want to apply a function that calculates both the mean and standard deviation for selected numeric columns in my data frame and returns these as separate columns.
How to split one row of dataframe into two rows based on several conditions (R)
I have a source dataset that looks like the following:
Is there a multiple-columns-as-input version of dplyr’s “across” function?
I had to write a function today like this
Pull() function: why these outputs are different?
I am trying to understand a problem regarding the pull()
function using these two examples:
Assigning value from previous row works only once. Don’t fill whole column [duplicate]
This question already has answers here: R: fill down multiple columns (3 answers) Closed last month. I have data wchich have value only in the first row of series. Like this: data <- data_frame(no = c(1:10), day = c(“day 1”, NA, NA, NA, “day2”, NA, NA, “day3”, NA, NA)) no day <int> <chr> 1 1 […]
Select non-syntactic names of a data frame when name is a variable
I have a data frame where some of the column names are non-syntactic. I want to select a range of these columns, but I am trying to do so inside a function. That is, the non-syntactic names which I want to select on are provided as variables to the function.
How to get t.test and dplyr group_by/summarise to be recognized within a function in R?
I created a function so I can perform multiple statistical procedures for several values in a dataset: 1) paired t-test, 2) create a simple boxplot, 3) get summary statistics of patient measures before and after intervention.