knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(Rplanktonanalytic) require(lubridate) require(ggplot2) listspp<-4:ncol(phytopknar) listyear<-unique(substr(phytopknar$date,1,4)) rez<-data.frame() for(spp in listspp){ for(year in listyear){ tmp<-data.frame(phytopknar[substr(phytopknar$date,1,4)==year,c(3,spp)]) reztmp<-data.frame(spp=names(phytopknar)[spp],year=year,T=edwards(tmp[,2],lubridate::week(as.Date(tmp[,1])))) rez<-rbind(rez,reztmp) } } ggplot(rez,aes(x=year,y=T,color=spp,group=spp))+geom_point()+geom_line()+geom_smooth()+theme(legend.position="none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.