avidaR is an R package for working with data sets generated by the Avida digital evolution platform.
The latest and greatest version of avidaR (as well as older versions) can be installed using devtools:
install.packages("devtools")
library(devtools)
install_github("briandconnelly/avidaR")
You'll also need the stringr package:
install.packages("stringr")
You'll first need to load avidaR:
library(avidaR)
read.avida
allows you to import Avida data files directly into R. The result
is a data frame. Column names for the data frame are extracted from the data
file.
mydata <- read.avida("time.dat")
head(mydata)
## update avida.time average.generation num_executed.
## 1 0 0.000 0.000 30
## 2 100 1.061 7.069 840
## 3 200 2.170 15.583 4140
## 4 300 3.274 23.414 9030
## 5 400 4.362 31.595 17040
## 6 500 5.430 39.635 27390
Invalid column names are cleaned up. In the previous example, the column names were update, avida time, average generation, and num_executed?.
Files compressed with bzip2 or gzip are automatically decompressed when loaded:
mydata <- read.avida("resource.dat.gz")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.