buffer: Pads an object to a desired length, either with replicates of...

Description Usage Arguments Examples

Description

Pads an object to a desired length, either with replicates of itself or another repeated object.

Usage

1
buffer(x, length.out = len(x), fill = NULL, preserveClass = TRUE)

Arguments

x

an R object

length.out

the desired length of the final output

fill

R object to fill empty rows in columns below the max size. If unspecified, repeats input rows in the same way as cbind.

preserveClass

determines whether to return an object of the same class as the original argument. Otherwise, returns a matrix.

Examples

1
2
3
4
5
6
buffer(c(1,2,3),20)
buffer(matrix(c(1,2,3,4),nrow=2),20)
buffer(list(1,2,3),20)
df<-data.frame(as.factor(c('Hello','Goodbye')),c(1,2))
buffer(df,5)
buffer((factor(x=c('Hello'))),5)


Search within the rowr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.