Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughjonesd/codesamples
R Code Samples From Various Sources
https://github.com/hughjonesd/codesamples
Last synced: 4 days ago
JSON representation
R Code Samples From Various Sources
- Host: GitHub
- URL: https://github.com/hughjonesd/codesamples
- Owner: hughjonesd
- License: other
- Created: 2023-12-23T19:53:42.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-07-03T13:42:29.000Z (4 months ago)
- Last Synced: 2024-11-01T18:51:50.657Z (11 days ago)
- Language: R
- Homepage:
- Size: 129 MB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - hughjonesd/codesamples - R Code Samples From Various Sources (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# codesamples
A large database of R snippets from Stack Overflow, Github and
package examples.## Installation
You can install the development version of codesamples from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("hughjonesd/codesamples")
```## Example
```{r}
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]])
```