- R Data Visualization Cookbook
- Atmajitsinh Gohil
- 137字
- 2021-08-06 19:21:05
Data types in R
Everything in R is in the form of objects. Objects can be manipulated in R. Some of the common objects in R are numeric vectors, character vectors, complex vectors, logical vectors, and integer vectors.

How to do it…
In order to generate a numeric vector in R, we can use the C()
notation to specify it as follows:
x = c(1:5) # Numeric Vector
To generate a character vector, we can specify the same within quotes (" ") as follows:
y ="I am Home" # Character Vector
To generate a complex vector, we can use the i
notation as follows:
c = c(1+3i) #complex vector
A list is a combination of a character and a numeric vector and can be specified using the list()
notation:
z = list(c(1:5),"I am Home") # List
推薦閱讀
- Advanced Machine Learning with Python
- Java入門很輕松(微課超值版)
- QGIS:Becoming a GIS Power User
- Python完全自學教程
- Fast Data Processing with Spark(Second Edition)
- Scala編程(第5版)
- Python程序設計開發寶典
- Go語言入門經典
- Learning Unreal Engine Game Development
- Improving your Penetration Testing Skills
- Perl 6 Deep Dive
- Mastering Responsive Web Design
- 像程序員一樣使用MySQL
- Mastering MeteorJS Application Development
- 西門子PLC 200/300/400應用程序設計實例精講(第2版)