Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (398)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
Basic Data Types
What are primary Data Types?
✍: FYIcenter.com
There are 5 primary data types supported in R.
1. Character - Character data type represents a sequence of characters as shown below:
> s = "Hello World!" > print(s) [1] "Hello World!" > is.character(s) [1] TRUE > typeof(s) [1] "character"
2. Numeric (or Double) - Numeric data type represents a numeric value as shown below:
> n = 3 > is.numeric(n) [1] TRUE > typeof(n) [1] "double" > pi = 3.14 > is.numeric(pi) [1] TRUE
3. Integer - Integer data type represents an integer value as shown below. Note that no easy way to enter an integer literal. You can use the as.integer() conversion function to convert a given value into an integer.
> n = 3 > is.integer(n) [1] FALSE > i = as.integer(3) > is.integer(i) [1] TRUE > typeof(i) [1] "integer"
4. Complex - Complex data type represents a complex value as shown below.
> c = 2 + 2i > print(c) [1] 2+2i > is.complex(c) [1] TRUE > typeof(c) [1] "complex"
2023-06-11, 290🔥, 0💬
Popular Posts:
What is this Website about? This Website provides a collection of Frequently Asked Questions (FAQ) a...
How to see the key exchange process in an SFTP connection with FileZilla FTP Client? If you are conn...
How to download FrameMaker 2017 Release for my Windows computer? I want to try it. You can follow th...
How to install Mozilla Firefox 2.0 add-on: FireFTP? FireFTP is a Mozilla Firefox 2 add-on that provi...
How to login to Facebook with a Web browser? If you want to login to Facebook with a Web browser, yo...