0 votes
1 view
in R Programming by (6.5k points)

I wonder, how can I create a numeric zero-length vector in R?

1 Answer

0 votes
by (25.3k points)

To create numeric vectors of zero length, you can use the following:

numeric()

logical()

character()

integer()

double()

complex() 

#OR

vector('numeric')

vector('character')

vector('integer')

vector('double')

vector('complex')

numeric(0)

> length(numeric())

[1] 0

> length(vector('numeric'))

[1] 0

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...