Difference between revisions of "R Programming Language Basics"

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
(Created page with "* Set working directory <pre> > setwd('~/Desktop/R_scripts') </pre> * Read data <pre> > data=read.table('Statistic.csv') </pre> * Review data <pre> > data 1 A 2.0 2 B ...")
(No difference)

Revision as of 09:59, 9 March 2014

  • Set working directory
> setwd('~/Desktop/R_scripts')
  • Read data
> data=read.table('Statistic.csv')
  • Review data
> data
1    A    2.0
2    B    3.0
3    C    4.0
  • Assign a specific column to variable
> grade=data[,2]
  • Plotting
> plot(grade, xlab='Name', ylab='Score', ylim=c(1,3)
> boxplot(grade, xlab='Name', ylab='Score', ylim=c(1,3)
  • View basic arithmetic summary data
> summary
Min.