Category: Statistics

Plotting in R using ggplot2

Change title of legend scale_fill_discrete(name = “Fishing method”) To hide y-axis scale par(mar=c(4, 4, 2, 0.5)) par(mar=c(2,2,2,2)) ggplot(mtcars,aes(x=factor(cyl),y=mpg))+ geom_point()+ theme(axis.text.x = element_text(colour=”grey20″,size=20,angle=90,hjust=.5,vjust=.5,face=”plain”), axis.text.y = element_text(colour=”grey20″,size=12,angle=0,hjust=1,vjust=0,face=”plain”), axis.title.x = element_text(colour=”grey20″,size=12,angle=0,hjust=.5,vjust=0,face=”plain”), axis.title.y = element_text(colour=”grey20″,size=12,angle=90,hjust=.5,vjust=.5,face=”plain”)) theme(axis.text.x=element_text(colour=”grey20″, size=10, face=”plain”))

Read More →

Joins in R

Outer join: merge(x = df1, y = df2, by = “CustomerId”, all = TRUE) Left outer: merge(x = df1, y = df2, by = “CustomerId”, all.x=TRUE) Right outer: merge(x = df1, y = df2, by = “CustomerId”, all.y=TRUE) Cross join: merge(x = df1, y = df2, by = NULL)

Read More →

Good Statistical Report

Provide standard deviation instead of variance when giving a mean Round your numbers (no more than 3)in r, you can use summary(,digits =2) Think of logical plot ratio Line up digits

Read More →

How to use Git

Assuming git is already installed on your computer, this is how you can start using git to track versions of your codes or development. Make a project directory (if you already have it, skip this part) mkdir myProj Go to the project directory cd myProj Create git repository for your project and add the file […]

Read More →