Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (430)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
Data Structure - Factor
What is a Factor?
✍: FYIcenter.com
A factor is a data structure that stores a vector
and its distinct values as categories.
1. Create a factor object with the factor() function -
> f = factor( c("Bike", "Car", "Truck", "Car", "Bike", "Truck") )
> f
[1] Bike Car Truck Car Bike Truck
Levels: Bike Car Truck
> typeof(f)
[1] "integer"
> is.factor(f)
[1] TRUE
2. Get factor length and members -
> f = factor( c("Bike", "Car", "Truck", "Car", "Bike", "Truck") )
> length(f)
[1] 6
> f[4]
[1] Car
Levels: Bike Car Truck
2023-05-31, 924🔥, 0💬
Popular Posts:
How to fix the Microphone Permissions error with making a call with Messenger in iPhone? If your Mic...
What is TestReail? TestRail is a comprehensive web-based test case management software to efficientl...
How to convert slide files created with older versions of PowerPoint to the current PowerPoint? I ha...
What are Control Connection and Data Connection used in FTP protocol? FTP protocol uses two independ...
Why am I getting the "Spawn Failed: Server at http://127.0.0.1:47353/u ser/fyicenter/didn't respond ...