2. First step:
>getwd()
>
(To know where is R software located in computer)
Second step:
>setwd
>setwd(“E/Rcourse/”)
(To change work location of directory)
Third step
Save file in CSV format in new work location ( In Rcourse -E drive)
3. Calculation in R by importing data in CSV
format
Mean
Median
SD
Correlation
Regression
4. Calculation of MEAN
>setwd(“E/Rcourse/”)
>data<-read.csv(“file name.csv")
>data
(incomplete data)
>data<-read.csv(“file name.csv", header=FALSE)
(complete data with proper heading)
>data
(give comments to each column by using # key)
> #V1 EMPLOYEE NUMBERS
> #V2 NUMBERS OF HOURS WORKED
> #V3 TOTAL REMUNERATIONS
> #V4 NUMBER OF DAYS ABSENT
5. Check data column wise
> data[,1]
> data[,2]
> data[,3]
> data[,4]
Find out mean
> mean(data[,1])
> mean(data[,2])
> mean(data[,3])
> mean(data[,4])
8. Absolute and relative frequencies:
Absolute frequency: Actual frequency
Relative frequency: Proportion
Data on gender:
M,F,F,M,F,M,M,F,F,M
1,2,2,1,2,1,1,2,2,1
Absolute frequency:
Total Male:5
Total Female:5
Relative Frequency:
Total male/Total persons= 05/10= 0.5
Total Female/Total persons= 05/10= 0.5