tidyverse tag

12 questions


1 answers
314 views
0
I want to exclude condition C based on the number of condition A and condition B.

I'm a beginner.In the analysis of R, I would like to write a program that excludes condition C based on the numbers of condition A and condition B, but it does not work.(Example) Sample=c(A, A, A, B, ...

1 years ago

1 answers
409 views
0
To calculate the total value of columns using R and extract only columns with a total value of 100 or more for each column

Could you tell me how to use R to calculate the total value of the column and extract only columns with a total value of 100 or more into a data frame?df<-data.frame(id=1:3, score1=c(200,30,100), s...

1 years ago

1 answers
266 views
0
Average by Group of Two Conditions

I would like to output the summary statistics (average, maximum, minimum, etc.) for group1 and group2 for the following data frames:I would appreciate it if you could let me know.Example)Average value...

1 years ago

1 answers
381 views
0
To Create a New Column from Multiple Column Conditions

I would like to create a new variable, category = 1, and others (sex=0, group=1,2) as 0 if Sex is 1 and group is 3.Please let me know.df<-data.frame( ID=1:4, age=c(43,62,54,55), sex=c(0,1,1,0), gro...

1 years ago

1 answers
355 views
0
You want to use R to replace column values with NAs in other columns

Cleaning data using R.Below are three columns (ID, s1, s2) with two missing s1.If there is a missing s1, I would like to create a column that replaces the same row of s2 with NA. Could someone tell me...

1 years ago

1 answers
347 views
0
Please tell me the glm of each group on Rstudio.

in the data frame (df) belowglm(BP to age+sex+BMI, data=df).Is there a way to analyze data frames by group (sex)?Data frames interested:IDage Sex BP BMI1  43  0 120 212  62  1 130 263  54  1 132 234  ...

1 years ago

1 answers
438 views
0
The ggplot2 may or may not display a diagram.

I am trying to draw using tidyverse and qiime2R in R.If you enter data and run the script, The first time it was drawn, but after saving the diagram, closing the diagram window (Quartz), and entering ...

2 years ago

1 answers
68 views
0
File not present error when path of read_xlsx is created with str_c

Create the beginning of the file save path with stringr::str_c.DirectoryName<- D1SavePath<-str_c(data/directory/, DirectoryName, sep=, collapse=NULL)When I try to open an Excel file with readxl:...

2 years ago

3 answers
98 views
0
I want to max the data frame horizontally with R.

There are columns from x_1 to x_17 in the R data frame. For each row, I would like to extract a column with the largest and largest values (extract 6 if x6 is the largest), dplyr::mutate, and add it t...

2 years ago

1 answers
110 views
0
mutate from rowwise

I'm trying to mutate from rawwise with dplyr, but it doesn't work.·Executing the code below will result in an error.df%>%rowwise()%>%mute(row_max=max(starts_with(X))))Error: Notidyselect variabl...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.