Re: [R] conditional filling of data.frame - improve code

2022-03-11 Thread Rui Barradas
eference/mutate-joins.html https://statisticsglobe.com/r-dplyr-join-inner-left-right-full-semi-anti Regards, Tim -Original Message- From: R-help On Behalf Of Jeff Newmiller Sent: Thursday, March 10, 2022 11:25 AM To: r-help@r-project.org; Ivan Calandra ; R-help Subject: Re: [R] condition

Re: [R] conditional filling of data.frame - improve code

2022-03-11 Thread Ivan Calandra
AM To: r-help@r-project.org; Ivan Calandra ; R-help Subject: Re: [R] conditional filling of data.frame - improve code [External Email] Use merge. expts <- read.csv( text = "expt,sample ex1,sample1-1 ex1,sample1-2 ex2,sample2-1 ex2,sample2-2 ex2,sample2-3 ", header=TRUE, as.is=TRUE )

Re: [R] conditional filling of data.frame - improve code

2022-03-10 Thread Ebert,Timothy Aaron
h 10, 2022 11:25 AM To: r-help@r-project.org; Ivan Calandra ; R-help Subject: Re: [R] conditional filling of data.frame - improve code [External Email] Use merge. expts <- read.csv( text = "expt,sample ex1,sample1-1 ex1,sample1-2 ex2,sample2-1 ex2,sample2-2 ex2,sample2-3 ",

Re: [R] conditional filling of data.frame - improve code

2022-03-10 Thread Jeff Newmiller
Use merge. expts <- read.csv( text = "expt,sample ex1,sample1-1 ex1,sample1-2 ex2,sample2-1 ex2,sample2-2 ex2,sample2-3 ", header=TRUE, as.is=TRUE ) mydata <- data.frame(sample = c("sample2-2", "sample2-3", "sample1-1", "sample1-1", "sample1-1", "sample2-1")) merge( mydata, expts, by="sample",