Small R helper functions for York University Libraries
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
man
tests
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
NAMESPACE
README.org
yulr.Rproj

README.org

yulr

Overview

yulr is a set of small helper functions for R work at York University Libraries: little things to save time that were getting repeated in code in various places, which are better managed in a proper library.

Installation

Install from GitHub with devtools.

# install.packages("devtools")
devtools::install_github("yorkulibraries/yulr")

If you get an error like this:

Error in system(full, intern = quiet, ignore.stderr = quiet, ...) :
error in running command

then run this and retry (it has nothing to do with this code in particular, it’s about package installation generally):

options(unzip = "internal")

Functions

academic_year()

R> academic_year("2016-08-31")
[1] 2015
R> academic_year("2016-09-01")
[1] 2016

link_to_sp_books()

R> link_to_sp_books("557306", "Marcus Aurelius: A Biography")
[1] "<a href=\"https://books.scholarsportal.info/viewdoc.html?id=557306\">Marcus Aurelius: A Biography</a>"

link_to_vufind()

R> link_to_vufind("a3400583", "R Packages")
[1] "<a href=\"https://www.library.yorku.ca/find/Record/3400583\">R Packages</a>"

readable_marc245()

R> readable_marc245("$a The order of things : $b an archaeology of the human sciences / $c Michel Foucault")
[1] "The order of things : an archaeology of the human sciences / Michel Foucault"

start_of_academic_year()

R> start_of_academic_year(2018)
[1] "2018-09-01"
R> start_of_academic_year(academic_year(Sys.Date())) # (Run in academic 2018.)
[1] "2018-09-01"

TO DO

A vignette.

Bugs

None known.