R Code Samples From Various Sources
OTHER License
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
A large database of R snippets from Stack Overflow, Github and package examples.
You can install the development version of codesamples from GitHub with:
# install.packages("remotes")
remotes::install_github("hughjonesd/codesamples")
library(codesamples)
dim(github_data)
dim(so_questions)
dim(package_examples)
first_lines <- strsplit(github_data$snippet[[1]], "\n")[[1]][1:23]
cat(first_lines, sep = "\n")
cat(package_examples$snippet[[1]])
cat(so_questions$snippet[[1]])