File: anchored.Rd

package info (click to toggle)
r-cran-cellranger 1.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 324 kB
  • sloc: makefile: 2
file content (75 lines) | stat: -rw-r--r-- 2,533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/anchor.R
\name{anchored}
\alias{anchored}
\title{Specify cell limits via an anchor cell}
\usage{
anchored(anchor = "A1", dim = c(1L, 1L), input = NULL, col_names = NULL,
  byrow = FALSE)
}
\arguments{
\item{anchor}{character, specifying the upper left cell in "A1" or "R1C1"
notation}

\item{dim}{integer vector, of length two, holding the number of rows and
columns of the targetted rectangle; ignored if \code{input} is provided}

\item{input}{a one- or two-dimensioanl input object, used to determine the
extent of the targetted rectangle}

\item{col_names}{logical, indicating whether a row should be reserved for the
column or variable names of a two-dimensional input; if omitted, will be
determined by checking whether \code{input} has column names}

\item{byrow}{logical, indicating whether a one-dimensional input should run
down or to the right}
}
\value{
a \code{\link{cell_limits}} object
}
\description{
Specify the targetted cell rectangle via an upper left anchor cell and the
rectangle's row and column extent. The extent can be specified directly via
\code{dims} or indirectly via the \code{input} object. Specification via
\code{input} anticipates a write operation into the spreadsheet. If
\code{input} is one-dimensional, the \code{byrow} argument controls whether
the rectangle will extend down from the anchor or to the right. If
\code{input} is two-dimensional, the \code{col_names} argument controls
whether cells will be reserved for column or variable names. If
\code{col_names} is unspecified, default behavior is to set it to \code{TRUE}
if \code{input} has columns names and \code{FALSE} otherwise.
}
\examples{
anchored()
as.range(anchored())
dim(anchored())

anchored("Q24")
as.range(anchored("Q24"))
dim(anchored("Q24"))

anchored(anchor = "R4C2", dim = c(8, 2))
as.range(anchored(anchor = "R4C2", dim = c(8, 2)))
as.range(anchored(anchor = "R4C2", dim = c(8, 2)), fo = "A1")
dim(anchored(anchor = "R4C2", dim = c(8, 2)))

(input <- head(iris))
anchored(input = input)
as.range(anchored(input = input))
dim(anchored(input = input))

anchored(input = input, col_names = FALSE)
as.range(anchored(input = input, col_names = FALSE))
dim(anchored(input = input, col_names = FALSE))

(input <- LETTERS[1:8])
anchored(input = input)
as.range(anchored(input = input))
dim(anchored(input = input))

anchored(input = input, byrow = TRUE)
as.range(anchored(input = input, byrow = TRUE))
dim(anchored(input = input, byrow = TRUE))

}