Skip to content

Instantly share code, notes, and snippets.

@pintowar
Created January 5, 2017 14:28
Show Gist options
  • Select an option

  • Save pintowar/31a1b59855bc4e2e81dcc34a624911a2 to your computer and use it in GitHub Desktop.

Select an option

Save pintowar/31a1b59855bc4e2e81dcc34a624911a2 to your computer and use it in GitHub Desktop.
Series of line plots in R
data <- read.csv('data.csv', sep=',')
subplot <- function(data, set) {
subdata <- subset(data, column == set)
xrange <- strptime(subdata$period, format='%H:%M:%S')
yrange <- subdata$fitness
plot(xrange, yrange, type="l", col="blue", xlab="Period", ylab="Fitness", main="Evolution")
}
setplot <- function(data, range) {
par(mfrow=c(2,5))
for(i in 1:10) {
subplot(data, i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment