Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
docs [covr]
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Jun 1, 2015
1 parent 8795e78 commit 5c6b9eb
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 18 deletions.
10 changes: 10 additions & 0 deletions R/gs_cell-specification.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
#' package, where you can find full documentation for the functions used in the
#' examples below.
#'
#' @examples
#' \dontrun{
#' gs_gap() %>% gs_read(ws = 2, range = "A1:D8")
#' gs_gap() %>% gs_read(ws = "Europe", range = cell_rows(1:4))
#' gs_gap() %>% gs_read(ws = "Europe", range = cell_rows(100:103),
#' col_names = FALSE)
#' gs_gap() %>% gs_read(ws = "Africa", range = cell_cols(1:4))
#' gs_gap() %>% gs_read(ws = "Asia", range = cell_limits(c(1, 5), c(4, NA)))
#' }
#'
#' @template cellranger
#' @name cell-specification
NULL
Expand Down
2 changes: 1 addition & 1 deletion R/gs_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#'
#' @template ss
#' @template ws
#' @param range blah blah
#' @template range
#' @param ... optional arguments passed on to functions that control reading and
#' transforming the data
#' @template verbose
Expand Down
2 changes: 1 addition & 1 deletion R/gs_read_cellfeed.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#'
#' @template ss
#' @template ws
#' @param range blah blah
#' @template range
#' @param return_empty logical; indicates whether to return empty cells
#' @param return_links logical; indicates whether to return the edit and self
#' links (used internally in cell editing workflow)
Expand Down
6 changes: 4 additions & 2 deletions R/gs_simplify_cellfeed.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
#' @param notation character; the result vector can have names that reflect
#' which cell the data came from; this argument selects between the "A1" and
#' "R1C1" positioning notations; specify "none" to suppress names
#' @param col_names blah blah
#' @param col_names if \code{TRUE}, the first row of the input will be
#' interpreted as a column name and NOT included in the result; useful when
#' reading a single column or variable
#'
#' @return a named vector
#' @return a vector
#'
#' @examples
#' \dontrun{
Expand Down
11 changes: 9 additions & 2 deletions man-roxygen/cellranger.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#' @seealso The \code{\link[=cellranger]{cellranger}} package has full
#' documentation on cell specification and offers additional functions for
#' manipulating "A1:D10" style spreadsheet ranges. See a full list of
#' functions in the \link[cellranger:00Index]{cellranger index}.
#' manipulating "A1:D10" style spreadsheet ranges. Here are the most relevant:
#' \itemize{
#' \item \code{\link[cellranger]{cell_limits}}
#' \item \code{\link[cellranger]{cell_rows}}
#' \item \code{\link[cellranger]{cell_cols}}
#' \item \code{\link[cellranger]{anchored}}
#' }
#' See a full list of functions in the \link[cellranger:00Index]{cellranger
#' index}.
1 change: 1 addition & 0 deletions man-roxygen/range.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#' @param range a cell range, as described in \code{\link{cell-specification}}
21 changes: 19 additions & 2 deletions man/cell-specification.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,27 @@ cell range processing is handled by the \code{\link[=cellranger]{cellranger}}
package, where you can find full documentation for the functions used in the
examples below.
}
\examples{
\dontrun{
gs_gap() \%>\% gs_read(ws = 2, range = "A1:D8")
gs_gap() \%>\% gs_read(ws = "Europe", range = cell_rows(1:4))
gs_gap() \%>\% gs_read(ws = "Europe", range = cell_rows(100:103),
col_names = FALSE)
gs_gap() \%>\% gs_read(ws = "Africa", range = cell_cols(1:4))
gs_gap() \%>\% gs_read(ws = "Asia", range = cell_limits(c(1, 5), c(4, NA)))
}
}
\seealso{
The \code{\link[=cellranger]{cellranger}} package has full
documentation on cell specification and offers additional functions for
manipulating "A1:D10" style spreadsheet ranges. See a full list of
functions in the \link[cellranger:00Index]{cellranger index}.
manipulating "A1:D10" style spreadsheet ranges. Here are the most relevant:
\itemize{
\item \code{\link[cellranger]{cell_limits}}
\item \code{\link[cellranger]{cell_rows}}
\item \code{\link[cellranger]{cell_cols}}
\item \code{\link[cellranger]{anchored}}
}
See a full list of functions in the \link[cellranger:00Index]{cellranger
index}.
}
2 changes: 1 addition & 1 deletion man/gs_read.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object}
\item{ws}{positive integer or character string specifying index or title,
respectively, of the worksheet}

\item{range}{blah blah}
\item{range}{a cell range, as described in \code{\link{cell-specification}}}

\item{...}{optional arguments passed on to functions that control reading and
transforming the data}
Expand Down
2 changes: 1 addition & 1 deletion man/gs_read_cellfeed.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object}
\item{ws}{positive integer or character string specifying index or title,
respectively, of the worksheet}

\item{range}{blah blah}
\item{range}{a cell range, as described in \code{\link{cell-specification}}}

\item{return_empty}{logical; indicates whether to return empty cells}

Expand Down
6 changes: 4 additions & 2 deletions man/gs_simplify_cellfeed.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ as \code{NA} values}
which cell the data came from; this argument selects between the "A1" and
"R1C1" positioning notations; specify "none" to suppress names}

\item{col_names}{blah blah}
\item{col_names}{if \code{TRUE}, the first row of the input will be
interpreted as a column name and NOT included in the result; useful when
reading a single column or variable}
}
\value{
a named vector
a vector
}
\description{
In some cases, you do not want to convert the data retrieved from the cell
Expand Down
16 changes: 10 additions & 6 deletions tests/testthat/test-gs-register.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
context("register sheets")

iris_pvt_url %>%
gs_url(verbose = FALSE) %>%
saveRDS("for_reference/iris_pvt_googlesheet.rds")
if(!file.exists("for_reference/iris_pvt_googlesheet.rds")) {
iris_pvt_url %>%
gs_url(verbose = FALSE) %>%
saveRDS("for_reference/iris_pvt_googlesheet.rds")
}

GAP_KEY %>%
gs_key(verbose = FALSE) %>%
saveRDS("for_reference/gap_googlesheet.rds")
if(!file.exists("for_reference/gap_googlesheet.rds")) {
GAP_KEY %>%
gs_key(verbose = FALSE) %>%
saveRDS("for_reference/gap_googlesheet.rds")
}

pseudo_expect_equal_to_reference <- function(x, ref) {
ref_rds <- file.path("for_reference", paste0(ref, "_googlesheet.rds"))
Expand Down

0 comments on commit 5c6b9eb

Please sign in to comment.