Professional Documents
Culture Documents
Hardware Requirement:
Intel P-IV 2.70 GHz Processor, 1 GB RAM, 256 GB HDD, 15” LCD Monitor, Keyboard,
Mouse.
Software Requirement:
R Tool, R Studio, Ubuntu 14.04 LTS
Theory:
Initially in developing any application or doing any programming in any
programming language, you might have seen that variables are required to store
data that you will be using within a program. Also you might have noticed
(usually in common or most programming languages like C or C++) that those
variables are assigned with a type and that variable has to assign that type of data
only. In this chapter you will learn about the concept of data types that R
programming uses within its script.
Data Types in R:
There are several basic data types in R which are of frequent occurrence in
coding R calculations and programs. Though seemingly in the clear, they can at
a halt deliver surprises. Here you will try to understand all of the different forms
of data type well by direct testing with the R code.
1) Numeric
2) Integer
3) Complex
SYCET/ CSE/LOM/IDSR
4) Logical
5) Character
6) Raw
> s = as.integer(3)
Warning message:
SYCET/ CSE/LOM/IDSR
Output:
[1] False
> g = as.character(62.48)
Output:
[1] "3.14"
Output:
[1] "character"
v <- charToRaw("Hello")
print(class(v))
it produces the following result −
Output:
[1] "raw"
SYCET/ CSE/LOM/IDSR
Conclusion:
Hence we have studied data types in R.