Home > other >  Accessing the length of a variable in a dataset
Accessing the length of a variable in a dataset

Time:01-22

Is it possible to find the length of a variable in a dataset ? My dataset name is 'usairports' and I want to find the length of the 'ownership' variable.

length(usairports("ownership")

I tried this but it gave me the wrong output. Thank you!

CodePudding user response:

Please try

length(usairports$ownership)

or

length(usairports[['ownership']])
  •  Tags:  
  • r
  • Related