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, ∼1411🔥, 0💬
Popular Posts:
How to create a new PowerPoint Template? I have created a slide master and some useful slide layouts...
How to pause file transfer in FileZilla FTP Client? I want to close the computer in the middle of a ...
How to open firewall for the FTP command-line tool on Windows for data connections in active mode? I...
Where to find answers to frequently asked questions on installing and using Mozilla Firefox 2.0? Her...
Where are Microsoft Teams files located on my Windows 7 system? If you have Microsoft Teams desktop ...