Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (490)
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, ∼1788🔥, 0💬
Popular Posts:
What is the difference between a Web page and a filtered Web page? Word supports 2 Web page formats:...
What is "Send to Bluetooth" in Microsoft Word? Should I disable it? "Send to Bluetooth" is a COM Add...
I have an Apple iPad Air Model MD788C/A. Is it good? Yes. Apple iPad Air Model MD788C/A is a very go...
How to add or change the footer on a layout in PowerPoint? I want my slide footers to have the same ...
What are URL:sfb and URL:lync15 Protocols? URL:sfb and URL:lync15 protocols are special network prot...