Hello Community!
I have a problem with the analysis of multiple data frames. First of all, I have to say that I am quite new in the data analysis so my questions might be naiv or sometimes I do not know the right terms (sorry for that in advance).
So, I have a set of data frames. I want to analyse them and first made a script to transform one of them:
diffDataA <- read.delim("/da/dmp/cb/..._diff.txt")
diff1 <- diffDataA %>%
dplyr::filter( included == "yes" ) %>%
dplyr::mutate( compound = "145" )
I am able to perform my analysis with this data set (diff1) but now I want to compare it to other data sets. However, I have almost 100 data sets and now started using the script above for each of them:
diffDataB <- read.delim("/da/dmp/cb/..._diff.txt")
diff2 <- diffDataB %>%
dplyr::filter( included == "yes" ) %>%
dplyr::mutate( compound = "195" )
diffDataC <- read.delim("/da/dmp/cb/..._diff.txt")
diff3 <- diffDataC%>%
dplyr::filter( included == "yes" ) %>%
dplyr::mutate( compound = "76" )
diffDataD <- read.delim("/da/dmp/cb/..._diff.txt")
diff4 <- diffDataD %>%
dplyr::filter( included == "yes" ) %>%
dplyr::mutate( compound = "89" )
diffDataE <- read.delim("/da/dmp/cb/..._diff.txt")
diff5<- diffDataE %>%
dplyr::filter( included == "yes" ) %>%
dplyr::mutate( compound = "121" )
analysis <- rbind(diff1, diff2, diff3, diff4, diff5, ...)
But its a lot of typing and in future there will be even more data sets. I know that it somehow must be possible to loop around this data sets but I have no idea how to start. Can someone maybe give me a hind? I would be absolutely happy to learn.
Thanks for any help