Skip to content

Instantly share code, notes, and snippets.

@dragstar328
Last active April 7, 2016 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragstar328/98f2326dbdbc2237d9bbb1acaa5accdd to your computer and use it in GitHub Desktop.
Save dragstar328/98f2326dbdbc2237d9bbb1acaa5accdd to your computer and use it in GitHub Desktop.
折れ線グラフを複数描く。airqualityパターン
library(ggplot2)
library(reshape2)
airq.df = data.frame(airquality)
airq.df = cbind(1:nrow(airq.df), airq.df)
colnames(airq.df)[1] = "id"
airq.melt = melt(airq.df, id = "id", measure = c("Ozone", "Solar.R", "Wind", "Temp"))
airq_g = ggplot(airq.melt, aes(x=id, y=value, group=variable, colour=variable))
airq_g + geom_line()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment