as.column: as.column

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function returns a given vector as a column (with dimension).

Usage

1

Arguments

x

any vector or array.

Details

x can either be a vector with no dimension attributes (a list of values), a vector with dimensions, or a matrix/array. If x is a matrix/array, the function gives x if ncol(x) is less than or equal to nrow(x), or its transpose if ncol(x) is greater than or equal to nrow(x). For any input, the input is given non-null dimensions.

Value

y

a vector identical to x, but given as a column.

Author(s)

Matt Nunes (nunesrpackages@gmail.com), Marina Knight

See Also

as.row

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
vector<-1:8
#
vector          
#
#...vector has no dimension attributes
# 
as.column(vector)        
#
#...gives output dimension of (8,1)
#
F<-matrix(c(6,2,2,10,6,17),3,2)
#
#
as.column(F)

#
#the function has no effect on F
#
F<-t(F)
F
#now has dimension (2,3)...
#
as.column(F)
#
#the output is made to have more rows than columns

nunesmatt/adlift documentation built on May 15, 2019, 3:33 p.m.