```{R, eval = FALSE} library(lme4)
d <- read.csv("my.file.csv")
o1 <- lmer(d$d1 ~ d$d2 + (1|d$d3))
plot(d$d2, d$d1)
## Named { .smaller } ```{R, eval = FALSE} library(lme4) flu.data <- read.csv("my.file.csv") #... #... res <- lmer(antigenic.distance ~ num.mutation + (1 | date), data = flu.data) #... #... plot(antigenic.distance ~ num.mutation, data = flu.data)
```{R, eval = FALSE} library(lme4)
flu.data <- read.csv("my.file.csv")
res <- lmer(antigenic.distance ~ num.mutation + (1 | date), data = flu.data)
plot(antigenic.distance ~ num.mutation, data = flu.data)
## Structured { .smaller } ```{R, eval = FALSE} library(lme4) ### <b> # Function to load in data from file and process read_flu_data <- function(filename) { #' Load in data from file and process data <- read.csv(filename) # Some light processing to get into correct format #... data } ### </b> flu.data <- read_flu_data("my.file.csv") # Now the analyses – a linear mixed effect model res <- lmer(antigenic.distance ~ num.mutation + (1 | date), data = flu.data) # Checking the model is a good one #... #... # Phew, it is, so plot the best explanatory and response variables! plot(antigenic.distance ~ num.mutation, data = flu.data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.