buffer | R Documentation |
Pads an object to a desired length, either with replicates of itself or another repeated object.
buffer(x, length.out = len(x), fill = NULL, preserveClass = TRUE)
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 |
preserveClass |
determines whether to return an object of the same class as the original argument. Otherwise, returns a matrix. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.