jj_initialize_df: create data.frame of defined size with initial value in each...

View source: R/jj_initialize_df.R

jj_initialize_dfR Documentation

create data.frame of defined size with initial value in each cell

Description

Creates a data.frame of size ncol * nrow filled with init. row.names and column.names may also be specified.

Usage

jj_initialize_df(
  ncol,
  nrow,
  init = NA,
  col.names = NULL,
  return_matrix = FALSE,
  sparse = FALSE,
  ...
)

Arguments

ncol

number of columns

nrow

number of rows

init

value to put into every cell

col.names

colnames to set

return_matrix

return matrix instead of data.frame, default=FALSE

row.names

rownames to set

Examples

jj_initialize_df(ncol = 3, nrow = 4, init = 0, col.names = paste0("col", 1:3), row.names = paste0("row", 1:4))

mathosi/jj documentation built on Feb. 25, 2024, 2:29 p.m.