diff --git a/.Rbuildignore b/.Rbuildignore index 456c6fd..482860f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^.*\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^data-raw$ diff --git a/DESCRIPTION b/DESCRIPTION index 8520524..8f3ecca 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,3 +11,4 @@ Description: More about what it does (maybe more than one line) License: MIT + file LICENSE Encoding: UTF-8 LazyData: true +RoxygenNote: 6.0.1 diff --git a/data-raw/fetch_data.R b/data-raw/fetch_data.R new file mode 100644 index 0000000..eb9d830 --- /dev/null +++ b/data-raw/fetch_data.R @@ -0,0 +1,12 @@ + +inflammation <- read.csv("https://raw.githubusercontent.com/TIBHannover/FAIR-R/gh-pages/_episodes_rmd/inflammation.csv", header=FALSE) + +library(dplyr) +library(tidyr) + +inflammation_long <- inflammation %>% + tbl_df() %>% + mutate(PatientID = 1:n()) %>% + gather(Time, InflammationScore, -PatientID) + +devtools::use_data(inflammation, overwrite = TRUE) diff --git a/data/inflammation.rda b/data/inflammation.rda new file mode 100644 index 0000000..f43cd12 Binary files /dev/null and b/data/inflammation.rda differ diff --git a/maRgheRitaR.Rproj b/maRgheRitaR.Rproj index e9b1f9e..0919928 100644 --- a/maRgheRitaR.Rproj +++ b/maRgheRitaR.Rproj @@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/man/center.Rd b/man/center.Rd new file mode 100644 index 0000000..cda30de --- /dev/null +++ b/man/center.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/center.R +\name{center} +\alias{center} +\title{Centering datasets} +\usage{ +center(dataset, desired) +} +\arguments{ +\item{dataset}{The numeric vector to be centered} + +\item{desired}{The numeric midpoint value around which the data will be centered} +} +\value{ +A new vector containing the original data centered around the desired values +} +\description{ +Some more description +} +\details{ +And even more +} diff --git a/man/rescale.Rd b/man/rescale.Rd new file mode 100644 index 0000000..38a1db5 --- /dev/null +++ b/man/rescale.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/rescale.R +\name{rescale} +\alias{rescale} +\title{Rescaling datasets} +\usage{ +rescale(v) +} +\arguments{ +\item{v}{A numeric vector} +} +\value{ +A new numeric vector, rescaled from the input vector to the range of 0 to 1 +} +\description{ +Rescaling datasets +} +\examples{ +rescale(c(1,2,3)) # [1] 0.0 0.5 1.0 +rescale(c(1,2,3,4,5)) # [1] 0.00 0.25 0.50 0.75 1.00 +}