Hi,
I want to summarize data and calculate the mean of each data.
$DF
gene1 gene2 gene3
A 100.5 200.3 300
B 120.5 230 330.4
C 99.3 180.5 270
D 20.5 300.5 150.3
$inf
tissue stage
A leaf cotyledon
B leaf cotyledon
C leaf true
D stem true
DF2 <- cbind(DF, inf)
$DF2
tissue stage gene1 gene2 gene3
A leaf cotyledon 100.5 200.3 300
B leaf cotyledon 120.5 230 330.4
C leaf true 99.3 180.5 270
D stem true 20.5 300.5 150.3
genes <- colnames(DF2[,-c(1,2))
$is.numeric(DF2[1,3])
TRUE
$data <- DF2 %>% dplyr::group_by(stage, tissue) %>%
dplyr::summarise_each(funs(mean),all_of(genes)) %>%
as.data.frame() %>%
mutate(sample_name = paste(!!!rlang::syms(c("stage", "tissue")), sep="-"))
警告メッセージ:
1: In mean.default(gene1) : argument is not numeric or logical: returning NA
Although I modified the numbers and factors here because the row data is confidential, the form of the data frame is the same and I confirmed that is.numeric(DF)=TRUE with my data.
I also confirmed that this data contained no NA with
How can I solve this problem?
Thank you!