Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in R Programming by (7.3k points)

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

1 Answer

0 votes
by

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!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...