Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NArray

Set up an array of NAs, solely from the list of dimnames


Description

Defines an array of NAs, solely from the list of dimnames

Usage

NArray( x, cells=NA )
ZArray( x, cells=0 )

Arguments

x

A (possibly named) list to be used as dimnames for the resulting array

cells

Value(s) to fill the array

Details

This is a simple useful way of defining arrays to be used for collection of results. The point is that everything is defined from the named list, so in the process of defining what you want to collect, there is only one place in the program to edit. It's just a wrapper for array. ZArray is just a wrapper for NArray with a different default.

Value

An array with dimnames attribute x, and all values equal to cells.

Author(s)

Bendix Carstensen

Examples

ftable(
NArray( list(Aye = c("Yes", "Si", "Oui"),
             Bee = c("Hum", "Buzz"),
             Sea = c("White", "Black", "Red", "Dead") ) ) )

Epi

Statistical Analysis in Epidemiology

v2.44
GPL-2
Authors
Bendix Carstensen [aut, cre], Martyn Plummer [aut], Esa Laara [ctb], Michael Hills [ctb]
Initial release
2021-02-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.