Skip to content

Commit a932695

Browse files
authored
define column types in read_csv for treatment and genotype
1 parent 63c45b6 commit a932695

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

reports/postprocessingQC.Rmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ dir.create(figdir, rec=T, showWarnings = F)
3939

4040
```{r readdata, include=T}
4141
data = read_csv(file.path(datadir,'output_psII_level0.csv'), #reading the data from the image processing where we explicitly define what NA values look like
42-
na=c('nan','--') )
42+
na=c('nan','--'),
43+
col_types = cols(treatment = col_character(),genotype = col_character()))
4344
44-
if(!(any(grepl('control',tolower(unique(data$treatment)))) & any(grepl('WT',toupper(unique(data$gtype)))))){
45-
stop('You do not have a "control" treatment and/or a "WT" genotype.\nPlease rename one genotype to "WT" and one treatment to "control".')
45+
if(!(grepl('control',tolower(unique(data$treatment))) & grepl('WT',toupper(unique(data$gtype))))){
46+
stop('Something is wrong. Either your file was not correctly imported or you do not have a "control" treatment and/or a "WT" genotype.')
4647
}
4748
4849
# data$treatment[sample(nrow(data),floor(nrow(data)/3))] = '250'

0 commit comments

Comments
 (0)