Powerpoint presentation of R script
https://www.slideshare.net/ddroy/revisiting-the-fundamental-concepts-and-assumptions-of-statistics-pps
R is a free and powerful programming language and environment for statistical computing, data exploration, data analysis and data visualization that is supported by the R Foundation for Statistical Computing. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. Graphics of R is useful for Data visualization. For data examination, data visualization locates the errors in data structure with respect to outliers, relations among different data sets. R allows extremely flexible use of data structure. Furthermore, R includes user friendly logical functions. R can deal with problems in a wide range of field as it has more than 75000 packages. For example,psych package is useful for examining psychometric properties of psychological instruments. The package can be downloaded from internet for temporary periods.
Download
The website is :
Cran Mirror: https://cran.r-project.org/bin/windows/base/
R-Studio: https://www.rstudio.com/products/rstudio/download/
Download of R is followed by the download of cran mirror.
Data analysis command (uni and bivariate)
- value=read.csv(choose.files(),header=T,sep=",")
- x=read.table(file="clipboard",header=T,sep="\t")
- write.table(x,file="copydata",sep="\t")
- write.csv(pathvalue)# writing data on the screen
- write.csv(pathvalue[1])# data examination
- write.csv(pathvalue,file="pathvalue.csv")# writing on the drive
- c=read.csv(file="clipboard",header=T,sep="\t")
- scan()
- readline()
- View(x)
- xx=na.omit(x)
- NROW(value)
- length(value)
- str(value)
- names(value)
- value[2] # name of the trainees
- summary(value)
- median(value$Age,na.rm=T)
- range(value$Age,na.rm=T)
- mean(value$Age,na.rm=T)
- tx=table(value$Age)
- xec=cut(as.numeric(value$EMOTIONAL.CONTROL),breaks = 2, labels=c("HighEC", "LOWEC"))
- table(xec) # highec and lowec
- table(value[4]) #frequency of male and female
- pie(table(value[4])) # multiple functions in single command
- boxplot(value$Age~value$Sex)
- xec=cut(as.numeric(value$EMOTIONAL.CONTROL),breaks = c(0,5,10,14),labels=c("high", “moderate”,”less”))
- wilcox.test(value$Age~agecateg)
- kruskal.test(value$Age~agecateg)
- pathvalue=data.frame(value[12:26]) # data frame of pathoriented values
- pathvalue[1:5,] # first 5 data of pathoriented values
- file.info(dir())#check the file
- pathvalue$EMOTIONAL.CONTROL==03# error identified
- cor(x,use="all.obs",method="spearman")
- cor(x,use="all.obs",method="kendall")
- Which(is.na(pathvalue[2]))
- sexcode=replace(x$SEX.CODE,x$SEX.CODE == "1", "male")
- agecode=factor(x$AGE.CODE, levels=c(1,2), labels=c("13-30","31-48>"))
- x=subset(patients,patients$Classification==4)
Generally we are dealing with single dimensional data. When single dimensional data are converted into two,three or more dimensions, it becomes matrix.
xx=matrix(x$age, nrow =198,ncol =2)
Here, x$age is single dimensional data. It becomes 2 dimensions.
Loop
for(i in 1:45) {
t=(table(climate[i]))
print(i)
print(t)
}
9. data.frame(value$Name,value$Age<35,value$Age)
No comments:
Post a Comment