Skip to content

Commit

Permalink
fix typos as suggested by @brodieG
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryO committed Apr 18, 2019
1 parent 4b1f2fd commit da6ca5f
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/list_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @inheritParams base::list.files
#' @export
#' @template example-prune
#' @return a character vector is dataframe names, including their relative path
#' @return a character vector of dataframe names, including their relative path
#' @family storage
list_data <- function(root = ".", path = ".", recursive = TRUE) {
UseMethod("list_data", root)
Expand Down
7 changes: 4 additions & 3 deletions R/meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ meta.numeric <- function(x, ...) {

#' @export
#' @rdname meta
#' @param optimize recode the data to get smaller text files. Defaults to TRUE
#' @param optimize recode and re-order the data to get smaller text files.
#' Defaults to TRUE
#' @param index an optional named vector with existing factor indices. The names must match the existing factor levels. Unmatched levels from `x` will get new indices.
#' @inheritParams utils::write.table
meta.factor <- function(x, optimize = TRUE, na = "NA", index, ...) {
Expand Down Expand Up @@ -160,7 +161,7 @@ meta.Date <- function(x, optimize = TRUE, ...){
#' @importFrom assertthat assert_that
#' @importFrom git2r hash
meta.data.frame <- function(x, optimize = TRUE, na = "NA", sorting, ...) {
assert_that(!has_name(x, "..generic"), msg = "'..generic' is a reserved name")
assert_that(!has_name(x, "..generic"), msg = "'..generic' is a reserved column name")
generic <- list(optimize = optimize, "NA string" = na)

dots <- list(...)
Expand All @@ -173,7 +174,7 @@ meta.data.frame <- function(x, optimize = TRUE, na = "NA", sorting, ...) {
}

# apply sorting
if (missing(sorting) || is.null(sorting)) {
if (missing(sorting) || is.null(sorting) || !length(sorting)) {
warning("no sorting applied")
} else {
assert_that(is.character(sorting))
Expand Down
2 changes: 1 addition & 1 deletion R/relabel.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Relabel factor levels
#'
#' Imaging the situation where we have a dataframe with a factor variable and we
#' Imagine the situation where we have a dataframe with a factor variable and we
#' have stored it with `write_vc(optimize = TRUE)`. The raw data file contains
#' the factor indices and the metadata contains the link between the factor
#' index and the corresponding label.
Expand Down
2 changes: 1 addition & 1 deletion R/write_vc.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' This will create two files. The `".tsv"` file contains the raw data.
#' The `".yml"` contains the meta data on the columns in YAML format.
#' @param x the `data.frame
#' @param x the `data.frame`
#' @param file the name of the file without file extension. Can include a
#' relative path. It is relative to the `root`.
#' @param root The root of a project. Can be a file path or a `git-repository`.
Expand Down
2 changes: 1 addition & 1 deletion man/list_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/meta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/relabel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/write_vc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/version_control.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ options(width = 83)

## Introduction

This vignette focuses on what `git2rdata` does to make storing dataframes under version control more efficient and convenient. All details on the actual file format are described in the [plain text storage](plain_text.html) vignette. Hence we not discuss the `optimize` and `na` arguments.
This vignette focuses on what `git2rdata` does to make storing dataframes under version control more efficient and convenient. All details on the actual file format are described in the [plain text storage](plain_text.html) vignette. Hence we will not discuss the `optimize` and `na` arguments to the `write_vc()` function.

We will neither illustrate the efficiency of `write_vc()` and `read_vc()` since that is covered in the [efficiency](efficiency.html) vignette.
We will not illustrate the efficiency of `write_vc()` and `read_vc()` since that is covered in the [efficiency](efficiency.html) vignette.

## Setup

Expand Down Expand Up @@ -58,7 +58,7 @@ Version control systems like [git](https://git-scm.com/), [subversion](https://s

## Sorting observations

Version control systems often track changes in plain text files based on row based differences. In layman's terms it only records which lines in a file are removed and which lines are inserted at what location. Changing an existing line implies removing the old version and inserting the new one. This is illustrated is the minimal example below.
Version control systems often track changes in plain text files based on row based differences. In layman's terms they only record which lines in a file are removed and which lines are inserted at what location. Changing an existing line implies removing the old version and inserting the new one. This is illustrated in the minimal example below.

Original version

Expand Down
4 changes: 2 additions & 2 deletions vignettes/workflow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This vignette describes a suggested workflow for storing dataframes. This time w

The rationale behind this workflow is that we have read-only access to a database containing the raw data. The database is beyond our control. Observations in the database can be added, removed or updated without our knowledge. These changes cannot be traced in the database.

The database defines a variable number of dataframe (e.g. species can be added or removed). We have defined a standard analysis which should run for each group. We want to repeat the analyses with some predefined frequency (e.g. once every year). In order to make the analyses reproducible, we want to store the relevant data in a git repository.
The database defines a variable number of dataframes (e.g. species can be added or removed). We have defined a standard analysis which should run for each group. We want to repeat the analyses with some predefined frequency (e.g. once every year). In order to make the analyses reproducible, we want to store the relevant data in a git repository.

## Setup

Expand All @@ -43,7 +43,7 @@ init_repo <- git2r::clone(remote, path, progress = FALSE)
git2r::config(init_repo, user.name = "me", user.email = "me@me.com")
# add an initial commit with .gitignore file
writeLines("C.*", file.path(path, ".gitignore"))
git2r::add(init_repo, ".gitignore")
git2r::add(init_repo, ".gitignore", force=TRUE)
git2r::commit(init_repo, message = "Initial commit")
# push initial commit to remote
git2r::push(init_repo, "origin", "refs/heads/master")
Expand Down

0 comments on commit da6ca5f

Please sign in to comment.