R Data Structure
Jump to navigation
Jump to search
An R Data Structure is a data structure that is expressed in as R code.
- Context:
- It can be associated to zero or more R Data Items.
- It can defined by an R DDL Statement (within the R programming language).
- It can accessed by an R DAL Statement (within the R programming language).
- It can have an R Data Structure Class, an R Data Structure Mode, and one or more R Data Structure Attributes.
- It can contain R Missing Values
if(length(which (is.na(data_structure) )) > 0) {print "ds has missing values"}
- It can (typically) be accessed by an R program.
- Example(s):
- an R Vector Structure, for R Vectors.
- a R Array Structure, for R Arrays.
- a R Hash Structure.
- Counter-Example(s):
- See: R Statement, R c() Function.
References
2012
- http://cran.r-project.org/doc/manuals/R-intro.html#Vectors-and-assignment
- R operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers. To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R command
> x <- c(10.4, 5.6, 3.1, 6.4, 21.7)
This is an assignment statement using the function c() which in this context can take an arbitrary number of vector arguments and whose value is a vector got by concatenating its arguments end to end.6
A number occurring by itself in an expression is taken as a vector of length one.
- R operates on named data structures. The simplest such structure is the numeric vector, which is a single entity consisting of an ordered collection of numbers. To set up a vector named x, say, consisting of five numbers, namely 10.4, 5.6, 3.1, 6.4 and 21.7, use the R command
- http://genomics.jhu.edu/modules/genRmod006.html
- R objects can be of different class and mode, and can have a distinct set of attributes.