Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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
edited 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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...