Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match canonical ordering of roxygen #67

Merged
merged 6 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions man/all.equal.integer64.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
\title{
Test if two integer64 vectors are all.equal
}
\description{
A utility to compare integer64 objects 'x' and 'y' testing for ‘near equality’, see \code{\link{all.equal}}.
}
\usage{
\method{all.equal}{integer64}(
target
Expand Down Expand Up @@ -45,6 +42,9 @@
‘"character"’ describing the differences between ‘target’ and
‘current’.
}
\description{
A utility to compare integer64 objects 'x' and 'y' testing for ‘near equality’, see \code{\link{all.equal}}.
}
\details{
In \code{\link{all.equal.numeric}} the type \code{integer} is treated as a proper subset of \code{double}
i.e. does not complain about comparing \code{integer} with \code{double}.
Expand All @@ -61,12 +61,12 @@
\author{
Leonardo Silvestri (for package nanotime)
}
\seealso{
\code{\link{all.equal}}
}
\examples{
all.equal(as.integer64(1:10), as.integer64(0:9))
all.equal(as.integer64(1:10), as.integer(1:10))
all.equal(as.integer64(1:10), as.double(1:10))
all.equal(as.integer64(1), as.double(1e300))
}
\seealso{
\code{\link{all.equal}}
}
18 changes: 9 additions & 9 deletions man/as.character.integer64.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
\title{
Coerce from integer64
}
\description{
Methods to coerce integer64 to other atomic types.
'as.bitstring' coerces to a human-readable bit representation (strings of zeroes and ones).
The methods \code{\link{format}}, \code{\link{as.character}}, \code{\link{as.double}},
\code{\link{as.logical}}, \code{\link{as.integer}} do what you would expect.
}
\usage{
as.bitstring(x, ...)

Expand All @@ -42,16 +36,22 @@
\code{as.bitstring} returns a string of class 'bitstring'. \cr
The other methods return atomic vectors of the expected types
}
\description{
Methods to coerce integer64 to other atomic types.
'as.bitstring' coerces to a human-readable bit representation (strings of zeroes and ones).
The methods \code{\link{format}}, \code{\link{as.character}}, \code{\link{as.double}},
\code{\link{as.logical}}, \code{\link{as.integer}} do what you would expect.
}
\author{
Jens Oehlschlägel <[email protected]>
}
\keyword{ classes }
\keyword{ manip }
\seealso{ \code{\link{as.integer64.character}} \code{\link{integer64}} }
\examples{
as.character(lim.integer64())
as.bitstring(lim.integer64())
as.bitstring(as.integer64(c(
-2,-1,NA,0:2
)))
}
\seealso{ \code{\link{as.integer64.character}} \code{\link{integer64}} }
\keyword{ classes }
\keyword{ manip }
16 changes: 8 additions & 8 deletions man/as.data.frame.integer64.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
\title{
integer64: Coercing to data.frame column
}
\description{
Coercing integer64 vector to data.frame.
}
\usage{
\method{as.data.frame}{integer64}(x, ...)
}
Expand All @@ -16,6 +13,9 @@
\value{
a one-column data.frame containing an integer64 vector
}
\description{
Coercing integer64 vector to data.frame.
}
\details{
'as.data.frame.integer64' is rather not intended to be called directly,
but it is required to allow integer64 as data.frame columns.
Expand All @@ -26,12 +26,12 @@
\author{
Jens Oehlschlägel <[email protected]>
}
\keyword{ classes }
\keyword{ manip }
\seealso{
\code{\link{cbind.integer64}} \code{\link{integer64}} %as.vector.integer64 removed as requested by the CRAN maintainer \code{\link{as.vector.integer64}}
}
\examples{
as.data.frame.integer64(as.integer64(1:12))
data.frame(a=1:12, b=as.integer64(1:12))
}
\seealso{
\code{\link{cbind.integer64}} \code{\link{integer64}} %as.vector.integer64 removed as requested by the CRAN maintainer \code{\link{as.vector.integer64}}
}
\keyword{ classes }
\keyword{ manip }
18 changes: 9 additions & 9 deletions man/as.integer64.character.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
\title{
Coerce to integer64
}
\description{
Methods to coerce from other atomic types to integer64.
}
\usage{
NA_integer64_

Expand All @@ -41,6 +38,12 @@
\item{keep.names}{ FALSE, set to TRUE to keep a names vector }
\item{...}{ further arguments to the \code{\link{NextMethod}} }
}
\value{
The other methods return atomic vectors of the expected types
}
\description{
Methods to coerce from other atomic types to integer64.
}
\details{
\code{as.integer64.character} is realized using C function \code{strtoll} which does not support scientific notation.
Instead of '1e6' use '1000000'.
Expand All @@ -50,15 +53,9 @@
strings shorter than 64 characters are treated as if they were left-padded with '0',
strings longer than 64 bytes are mapped to \code{NA_INTEGER64} and a warning is emitted.
}
\value{
The other methods return atomic vectors of the expected types
}
\author{
Jens Oehlschlägel <[email protected]>
}
\keyword{ classes }
\keyword{ manip }
\seealso{ \code{\link{as.character.integer64}} \code{\link{integer64}} }
\examples{
as.integer64(as.character(lim.integer64()))
as.integer64(
Expand All @@ -80,3 +77,6 @@ as.integer64(
), class = "bitstring")
)
}
\seealso{ \code{\link{as.character.integer64}} \code{\link{integer64}} }
\keyword{ classes }
\keyword{ manip }
24 changes: 12 additions & 12 deletions man/benchmark64.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
Function for measuring algorithmic performance \cr
of high-level and low-level integer64 functions
}
\description{
\code{benchmark64} compares high-level integer64 functions against the integer functions from Base R \cr
\code{optimizer64} compares for each high-level integer64 function the Base R integer function with several low-level integer64 functions with and without caching \cr
}
\usage{
benchmark64(nsmall = 2^16, nbig = 2^25, timefun = repeat.time
)
Expand Down Expand Up @@ -37,6 +33,15 @@ optimizer64(nsmall = 2^16, nbig = 2^25, timefun = repeat.time
set to FALSE to suppress plotting
}
}
\value{
\code{benchmark64} returns a matrix with elapsed seconds, different high-level tasks in rows and different scenarios to solve the task in columns. The last row named 'SESSION' contains the elapsed seconds of the exemplary sesssion.
\cr
\code{optimizer64} returns a dimensioned list with one row for each high-level function timed and two columns named after the values of the \code{nsmall} and \code{nbig} sample sizes. Each list cell contains a matrix with timings, low-level-methods in rows and three measurements \code{c("prep","both","use")} in columns. If it can be measured separately, \code{prep} contains the timing of preparatory work such as sorting and hashing, and \code{use} contains the timing of using the prepared work. If the function timed does both, preparation and use, the timing is in \code{both}.
}
\description{
\code{benchmark64} compares high-level integer64 functions against the integer functions from Base R \cr
\code{optimizer64} compares for each high-level integer64 function the Base R integer function with several low-level integer64 functions with and without caching \cr
}
\details{
\code{benchmark64} compares the following scenarios for the following use cases:
\tabular{rl}{
Expand Down Expand Up @@ -69,17 +74,9 @@ optimizer64(nsmall = 2^16, nbig = 2^25, timefun = repeat.time
}
Note that the timings for the cached variants do \emph{not} contain the time costs of building the cache, except for the timing of the exemplary user session, where the cache costs are included in order to evaluate amortization.
}
\value{
\code{benchmark64} returns a matrix with elapsed seconds, different high-level tasks in rows and different scenarios to solve the task in columns. The last row named 'SESSION' contains the elapsed seconds of the exemplary sesssion.
\cr
\code{optimizer64} returns a dimensioned list with one row for each high-level function timed and two columns named after the values of the \code{nsmall} and \code{nbig} sample sizes. Each list cell contains a matrix with timings, low-level-methods in rows and three measurements \code{c("prep","both","use")} in columns. If it can be measured separately, \code{prep} contains the timing of preparatory work such as sorting and hashing, and \code{use} contains the timing of using the prepared work. If the function timed does both, preparation and use, the timing is in \code{both}.
}
\author{
Jens Oehlschlägel <[email protected]>
}
\seealso{
\code{\link{integer64}}
}
\examples{
message("this small example using system.time does not give serious timings\n
this we do this only to run regression tests")
Expand Down Expand Up @@ -131,4 +128,7 @@ for (i in 1:nrow(optimizer64.data)){
}
par(mfrow=c(1,1))
}
\seealso{
\code{\link{integer64}}
}
\keyword{ misc }
10 changes: 5 additions & 5 deletions man/benchmark64.data.Rd
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
\docType{data}
\name{benchmark64.data}
\alias{benchmark64.data}
\docType{data}
\title{
Results of performance measurement on a Core i7 Lenovo T410 8 GB RAM under Windows 7 64bit
}
\description{
These are the results of calling \code{\link{benchmark64}}
}
\usage{data(benchmark64.data)}
\format{
The format is:
num [1:16, 1:6] 2.55e-05 2.37 2.39 1.28 1.39 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:16] "cache" "match(s,b)" "s \%in\% b" "match(b,s)" ...
..$ : chr [1:6] "32-bit" "64-bit" "hashcache" "sortordercache" ...
}
\usage{data(benchmark64.data)}
\description{
These are the results of calling \code{\link{benchmark64}}
}
\examples{
data(benchmark64.data)
print(benchmark64.data)
Expand Down
106 changes: 53 additions & 53 deletions man/bit64-package.Rd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
\docType{package}
\name{bit64-package}
\alias{bit64-package}
\alias{bit64}
Expand All @@ -9,10 +10,35 @@
\alias{length<-.integer64}
\alias{print.integer64}
\alias{str.integer64}
\docType{package}
\title{
A S3 class for vectors of 64bit integers
}
\usage{
integer64(length)

\method{is}{integer64}(x)

\method{length}{integer64}(x) <- value

\method{print}{integer64}(x, quote=FALSE, ...)

\method{str}{integer64}(object, vec.len = strO$vec.len, give.head = TRUE, give.length = give.head, ...)
}
\arguments{
\item{length}{ length of vector using \code{\link{integer}} }
\item{x}{ an integer64 vector }
\item{object}{ an integer64 vector }
\item{value}{ an integer64 vector of values to be assigned }
\item{quote}{ logical, indicating whether or not strings should be printed with surrounding quotes. }
\item{vec.len}{ see \code{\link[utils]{str}} }
\item{give.head}{ see \code{\link[utils]{str}} }
\item{give.length}{ see \code{\link[utils]{str}} }
\item{...}{ further arguments to the \code{\link{NextMethod}} }
}
\value{
\code{integer64} returns a vector of 'integer64',
i.e. a vector of \code{\link{double}} decorated with class 'integer64'.
}
\description{
Package 'bit64' provides fast serializable S3 atomic 64bit (signed) integers
that can be used in vectors, matrices, arrays and data.frames. Methods are
Expand Down Expand Up @@ -50,28 +76,6 @@ session using a couple of these operations the 64-bit integers performed 22x
sortorder-caching was most efficient with 38x (caching hashing and sorting
is not worth it with 32x at duplicated RAM consumption).
}
\usage{
integer64(length)

\method{is}{integer64}(x)

\method{length}{integer64}(x) <- value

\method{print}{integer64}(x, quote=FALSE, ...)

\method{str}{integer64}(object, vec.len = strO$vec.len, give.head = TRUE, give.length = give.head, ...)
}
\arguments{
\item{length}{ length of vector using \code{\link{integer}} }
\item{x}{ an integer64 vector }
\item{object}{ an integer64 vector }
\item{value}{ an integer64 vector of values to be assigned }
\item{quote}{ logical, indicating whether or not strings should be printed with surrounding quotes. }
\item{vec.len}{ see \code{\link[utils]{str}} }
\item{give.head}{ see \code{\link[utils]{str}} }
\item{give.length}{ see \code{\link[utils]{str}} }
\item{...}{ further arguments to the \code{\link{NextMethod}} }
}
\details{
\tabular{ll}{
Package: \tab bit64\cr
Expand All @@ -83,6 +87,24 @@ is not worth it with 32x at duplicated RAM consumption).
Encoding: \tab latin1\cr
}
}
\note{
\code{integer64} are useful for handling database keys and exact counting in +-2^63.
Do not use them as replacement for 32bit integers, integer64 are not
supported for subscripting by R-core and they have different semantics
when combined with double. Do understand that \code{integer64} can only be
useful over \code{double} if we do not coerce it to \code{double}. \cr
\cr
While \cr
integer + double -> double + double -> double \cr
or \cr
1L + 0.5 -> 1.5 \cr
for additive operations we coerce to \code{integer64} \cr
integer64 + double -> integer64 + integer64 -> integer64 \cr
hence \cr
as.integer64(1) + 0.5 -> 1LL + 0LL -> 1LL \cr
\cr
see section "Arithmetic precision and coercion" above
}
\section{Design considerations}{
64 bit integers are related to big data: we need them to overcome address space limitations.
Therefore performance of the 64 bit integer type is critical.
Expand Down Expand Up @@ -400,36 +422,6 @@ is not worth it with 32x at duplicated RAM consumption).
Following the full R behaviour here would either destroy performance or require extensive C-coding.
}
}
\note{
\code{integer64} are useful for handling database keys and exact counting in +-2^63.
Do not use them as replacement for 32bit integers, integer64 are not
supported for subscripting by R-core and they have different semantics
when combined with double. Do understand that \code{integer64} can only be
useful over \code{double} if we do not coerce it to \code{double}. \cr
\cr
While \cr
integer + double -> double + double -> double \cr
or \cr
1L + 0.5 -> 1.5 \cr
for additive operations we coerce to \code{integer64} \cr
integer64 + double -> integer64 + integer64 -> integer64 \cr
hence \cr
as.integer64(1) + 0.5 -> 1LL + 0LL -> 1LL \cr
\cr
see section "Arithmetic precision and coercion" above
}
\value{
\code{integer64} returns a vector of 'integer64',
i.e. a vector of \code{\link{double}} decorated with class 'integer64'.
}
\author{
Jens Oehlschlägel <[email protected]>
Maintainer: Jens Oehlschlägel <[email protected]>
}
\keyword{ package }
\keyword{ classes }
\keyword{ manip }
\seealso{ \code{\link{integer}} in base R }
\examples{
message("Using integer64 in vector")
x <- integer64(8) # create 64 bit vector
Expand Down Expand Up @@ -896,3 +888,11 @@ matplot(1:21, cbind(td32, t64), pch=c("d","i"), log="y")
}

}
\seealso{ \code{\link{integer}} in base R }
\author{
Jens Oehlschlägel <[email protected]>
Maintainer: Jens Oehlschlägel <[email protected]>
}
\keyword{ package }
\keyword{ classes }
\keyword{ manip }
Loading
Loading