https://github.com/mojaveazure/exdata
Document Code for Generating Datasets
https://github.com/mojaveazure/exdata
Last synced: 2 months ago
JSON representation
Document Code for Generating Datasets
- Host: GitHub
- URL: https://github.com/mojaveazure/exdata
- Owner: mojaveazure
- License: other
- Created: 2021-02-26T06:58:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-30T21:56:15.000Z (almost 4 years ago)
- Last Synced: 2025-01-31T15:40:39.162Z (4 months ago)
- Language: R
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
``````{r ghurl, echo=FALSE}
ghurl <- function(x) {
x <- unlist(x = strsplit(x = x, split = ','))
x <- trimws(x = x)
x <- grep(pattern = "https://github.com", x = x, value = TRUE)[1]
return(unname(obj = x))
}
``````{r cran_cannoncial, echo=FALSE}
cran.cannoncial <- "https://cran.r-project.org/package="
``````{r load_description, echo=FALSE}
description <- read.dcf(file = "DESCRIPTION")
# Get package name
pkg <- as.vector(x = description[, "Package"])
# Get GitHub URL
github.url <- ghurl(x = description[, "URL"])
# Parse version
pkg.version <- package_version(x = description[1, 'Version'])
stage <- if (pkg.version >= package_version(x = "1.0.0")) {
"stable"
} else if (pkg.version >= package_version(x = "0.1.0")) {
"maturing"
} else {
"experimental"
}
color <- c("experimental" = "orange", "maturing" = "blue", "stable" = "brightgreen")[stage]
```# `r pkg` v`r pkg.version`
[](`r ""`)

[](`r paste0(cran.cannoncial, pkg)`)
[](`r paste0(cran.cannoncial, pkg)`)
[](`r paste0(cran.cannoncial, pkg)`)#### `r description[1, "Title"]`
```{r description, echo=FALSE, results="asis"}
cat(gsub(pattern = "\n", replacement = " ", x = description[, "Description"]))
```## Installation
You can install `r pkg` from GitHub with:
```{r devel_install, echo=FALSE, results="asis"}
github.base <- unlist(x = strsplit(x = github.url, split = "/"))
github.base <- paste(rev(x = rev(x = github.base)[1:2]), collapse = "/")
cat(
"```r",
"if (!requireNamespace('remotes', quietly = TRUE) {",
" install.packages('remotes')",
"}",
paste0("remotes::install_github('", github.base,"')"),
"```",
sep = "\n"
)
```