plotting only selected class from multiple CSV files in R (ggplot) -
let's have imported 2(or more) csv files having similar columns. let's have "a", "b" , "class" columns in each of csv files values different. let's suppose dataset in 1 csv file is:
a b class 1 2 2 3 b 4 1 3 7 c 4 5 .....
let's 2nd csvs dataset be:
a b class 10 20 20 10 c 40 10 b 30 17 14 15 .....
and on other csvs..
initially have made ggplots individual csv files using "a" , "b". want plot csv files in single plot using 1 class @ time i.e., let's want plot class csvs in single plot.
i did plot files in single plot want plot class wise..
can 1 tell how can thing?
just join csvs 1 dataframe , subset
, plot?
e.g.
csv1 <- read.csv(...) csv2 <- read.csv(...) bigcsv <- rbind(csv1, csv2) library(ggplot2) ggplot(subset(bigscv, class == 'a'), aes(...)) + ...
the key subset(bigcsv, class=='a')
.
you can use rbind.fill
rbind
big list of dataframes.
Comments
Post a Comment