knitr::opts_chunk$set(echo = TRUE)
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(tb346a2) library(dplyr) library(tidyr) library(ggplot2) set.seed(1) t1 <- tibble(v1 = paste0("G", 1:10), v2 = runif(10,min = 75, max = 125)) t1 t2 <- tibble(v1 = paste0("G", 1:15), v3 = sample(LETTERS[1:6],size= 15, replace = TRUE)) t2 t3 <- tibble(v1 = paste0("G", 1:20), v4 = rnorm(20,mean = 100, sd = 20))
left_join(t1, t2) %>% left_join(., t3) right_join(t1, t2) %>% right_join(., t3) full_join(t1, t2) %>% full_join(., t3) inner_join(t1, t2) %>% inner_join(., t3)
lapply
to read in csv files from the package extdata/ foldera <- dir(system.file("extdata/", package = "geospaar"), pattern = "FAOSTAT", full.names = TRUE) crops <- lapply(a, readr::read_csv)
You can also embed plots, for example:
plot(pressure)
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.