knitr::opts_chunk$set( fig.path = "man/figures/README-" )
options("width"=110) tmp <- packageDescription( basename(getwd()) )
cat("#", tmp$Title)
Status
filelist.R <- list.files("R", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE) filelist.tests <- list.files("tests", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE) filelist.cpp <- list.files("src", recursive = TRUE, pattern="\\.cpp$", ignore.case = TRUE, full.names = TRUE) lines.R <- unlist(lapply(filelist.R, readLines)) lines.tests <- unlist(lapply(filelist.tests, readLines)) lines.cpp <- unlist(lapply(filelist.cpp, readLines)) length.R <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.R, value = TRUE, invert = TRUE)) length.tests <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.tests, value = TRUE, invert = TRUE)) length.cpp <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.cpp, value = TRUE, invert = TRUE))
lines of R code: r length.R
, lines of test code: r length.tests
Version
source_files <- grep( "/R/|/src/|/tests/", list.files(recursive = TRUE, full.names = TRUE), value = TRUE ) last_change <- as.character( format(max(file.info(source_files)$mtime), tz="UTC") )
cat(tmp$Version, "(",last_change,")")
Description
#cat(tmp$Description)
License
cat(tmp$License, "<br>") cat(tmp$Author)
Credits
wp_date()
generic and its methods and is detailed in the help files. Citation
citation("wikipediatrend")
print(citation("wikipediatrend"), style = "text")
BibTex for citing
toBibtex(citation("wikipediatrend"))
Installation
Stable version from CRAN:
install.packages("wikipediatrend")
Latest development version from Github:
devtools::install_github("petermeissner/wikipediatrend")
Usage
starting up ...
library(wikipediatrend)
getting some data ...
trend_data <- wp_trend( page = c("Der_Spiegel", "Die_Zeit"), lang = c("de", "en"), from = "2007-01-01", to = Sys.Date() )
having a look ...
trend_data
having another look ...
plot( trend_data[trend_data$views < 2500, ] )
Usage 2
getting some data ...
trend_data <- wp_trend( page = c( "Climate_crisis", "2019–20_coronavirus_pandemic", "Donald_Trump", "Syria", "Crimea", "Influenza" ), lang = "en", from = "2007-01-01", to = Sys.Date() )
having a look ...
trend_data
having another look ...
options(scipen = 1000000) plot(trend_data) + ggplot2::scale_y_log10()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.