You are on page 1of 37

ก

ก
R  ก 


. ก

    ก ก  
  ก ก 
     ! ก" !" 
  ก
 
• # # $%ก &#! "& '(ก R ( )1 ก & ( ก ) )
– ( CD '(ก R "&
• # # $%ก &#! "& '(ก R ( ) 2 ก & -)
( ) 
.. ##. -&#.
/ &#. # # 

#.-  -(ก 0.
!1 ก
- &# 
2 ก#- #  #3 #3 4 - !2 ก
   % 5-$!1 6
 ก
R
• '7 '(ก2 !5'(8" ') (Free software)  8."2 ก 
2 &
 # # (" ก 9  '(ก 3:" #%; 8'< ..
2538  Robert Gentleman ( Ross Lhaka ()/ &#.
# #  &#  (- ' #&@ (-
• 'A!! '(ก R 5)/ 8 "ก 5(5## %:)(& ก2 :.$% R
Foundation  % http://www.r-project.org/index.html
• '(ก R '7@9-(&-' / Open Source  % 'B ก 8"C5"
& 5"" ก    '(ก  ; #% #:" ก
&# ก  download Program R ! ก Internet

:' %

http://www.r-project.org/index.html
The R Project for Statistical Computing

About R
What is R?
Contributors
Screenshots
What's new?
Download, Packages
CRAN
R Project
Foundation
Members & Donors
Mailing Lists
Bug Tracking
Developer Page
Conferences
Getting Started:
Search
•R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX
platforms, Windows and MacOS. To download R, please choose your preferred CRAN mirror.
Documentation •If you have questions about R like how to download and install the software, or what the license terms are, please read
Manuals our answers to frequently asked questions before you send an email.
FAQs
The R Journal
Wiki
Books News:
Certification •R version 2.10.0 has been released on 2009-10-26 and will spread through CRAN in the next days.
Other •The first issue of The R Journal is now available
•useR! 2010, the R user conference, will be held at NIST, Gaithersburg, Maryland, USA, July 21-23, 2010.
Misc •We have started to collect information about local UseR Groups in the R Wiki.
Bioconductor
Related Projects
User Groups •This server is hosted by the Department of Statistics and Mathematics of the WU Wien .
Links
CRAN Mirrors

Thailand

http://mirror.kapook.com/cran/ Kapook.com, Bangkok

The Comprehensive R Archive Network


Download and Install R
Precompiled binary distributions of the base system and
contributed packages, Windows and Mac users most likely want
one of these versions of R:
Linux
MacOS X
Windows
Binaries for base distribution (managed by
base
Duncan Murdoch)

Binaries of contributed packages (managed by


contrib
Uwe Ligges)

This directory contains binaries for a base distribution and packages to run on i386/x64
Windows.
Note: CRAN does not have Windows systems and cannot check these binaries for
viruses. Use the normal precautions with downloaded executables.
Subdirectories:
Please do not submit binaries to CRAN. Package developers might want to contact
Duncan Murdoch or Uwe Ligges directly in case of questions / suggestions related to
Windows binaries.
You may also want to read the R FAQ and R for Windows FAQ.
R-2.10.0 for Windows
Download R 2.10.0 for Windows (31 megabytes)
Installation and other instructions
New features in this version: Windows specific, all platforms.
If you want to double-check that the package you have downloaded exactly
matches the package distributed by R, you can compare the md5sum of the .exe to
the true fingerprint. You will need a version of md5sum for windows: both graphical
and command line versions are available.
Frequently asked questions
How do I install R when using Windows Vista?
How do I update packages in my previous version of R?
Please see the R FAQ for general information about R and the R Windows FAQ for
Windows-specific information.
R-2.10.0-win32.exe
R-2.10.0-win32.exe

Welcome to the R for windows 2.10.0

ก Next :' $% D


:) " Download ! ก Internet
 ! - File '(ก8"5)("&
 % drive D !  & '(ก R-
2.9.0- win32 ก install
Program :"  "&ก #3ก:' % &
'(ก R-2.9.0- win32 ("&
Next :' $% D
)&'ก '(ก R
1. Rgui 'ก"&&# &-) 2 &# &-$
R console '7&# &-2   2 % ((C-
( R-graph '7&# &-2 " ก 9

2. Rterm '7&# &-2   2 % (@F%'ก # R console  2 %ก:")

&# clear " !

:' % R-cosole #3ก& :' % clear window $ ก Ctrl+L ก:" $ก

 ก
R &'  (  R Gui
• File 8." 'B 'B&# &- ' / )  D 8."  ก$Fก:9-8."
$กก #-"5
• Edit 8.""  ก:9- $" "5/ 8&# &- )  D .)
Gui preference '  &$" !:"
• View 8."ก 2 8"($ก #กก ( ( $%$ $
( / 
• Misc 8."ก2  $ก #กก 2 &
8."(#% % '(ก 5)
.) &(' :9- 8."ก #ก$" #% % '(ก ก:&"5)

 ก
R &'  (  R Gui
• Packages 8."  ก package #% # 8." # 3 Package
– 2 % load package, install package , update
package 8 % % ! -8"8."2 % Install package(s) from
local zip file ("&:' load package  ! ก Drive D  %
folder Package
• Windows 8."!  &# &-85'( )  D ก  $ก(
  )  D  Windows
• Help 8."2 # ก 8." '(ก R
ก()*' ก
R ++

(R Comanander)
• '7ก 8." '(ก R ( 5 $:) "  2 % 2  :" 
'G8"ก $ก2 % $ก SPSS ( )!2 '7 " # 3 '(ก
R commander ก)  3
– :' % " )  Rgui
– $ก 5 Package(s) $ก Install package(s) !' กH2
&) CRAN mirror $ก Thailand  5)8ก"! Load :" &
ก&) $ก' $% ! ก3ก'G Ok
– $ก 5 %.$%&) Rcmdr ก'G OK
– '(กก!2 ก  # 3 R commander 8" ("& " ! &) !
# 3 Package &$% #% #$:) 8"ก Yes
ก()*' ก
R ++

(R Comanander)
• $ก() %!  ก Package  $ก! ก CRAN
• '(ก!8." & 20-30   8ก  load package 3
 ! -!8" Load ! ก Folder  % ! -  :&"8"("&8
Drive D &  38" $ก Install packages from load
zip ( ("& $ก % folder Rcmdr ก Open ("& 2 :4:-
ก :9- ก open ! ก3 !ก&) ! # 3 !....
 (  R commander +,ก- 
 .,. 3

 ( &)
• Scrip window '7&# &- %8."(2 % %C"8." $ก! ก 5
( $ Syntex 8 Spss)
• Output Window '7&# &-! % (C- %:"! กก 8."
52 %
• Massage Window '7&# &-! % ("5 )  D .) $%
ก# Error ! กก 8." 5
ก&.ก ก
R Commander

(0
, Install R commander 
,&ก  )
•  ก '(ก R ('ก #F3 8." ก)
• 8":' %&# &- Rgui
• $ก 5 Package $ก load packages ! &# &-
' กHF3.$% Select one
• $ก Package .$% Rcmdr
• ก'G ok !' กH&# &- R commander  8" 3

  Window R commander
• File 8."  ก $Fก :9-' / )  D
• Edit 8."ก "  " 2 %
• Data 8."!ก  ก %&ก"5( &('
• Statistics 8."&#  -"5 # # 5 3$ '7 5ก R
commander
• Graph 8."  ก 2 % ก %&ก ก 9
• Models 8."!ก ก &("5 %:"! ก Statistics
• Distributions 8."&#  - ก %&กก (!ก(!"585'( )  D
• Tools 8."!ก  ก %&ก Package ก   ก '(ก # !ก 
" !
• Help 8."2 # ก 8." '(ก R
Tool Bars  R commander

8."(.$%"5 %!2 ก &#  -"& R commander


& 8."8"#3ก %'G No active data ("& $ก"5 %5)8 Workspace "  :&"8
R commander ก)

8."2 (ก":."5 %5)8 Data set

8."2 5   "5 %58)  Data set

8."2 ( &( (Model)  %C5"8."" F3 ("&! ก 5 Statistics .) &( %
:"! ก ก &#  -( &( %:"! กก &#  -& (''& (ANOVA)
ก  ก
R - '2 3+) (2 R console)

8"2 &
 ) 5 5
7
C- %:" enter
8"2 &
 ) e กก2  5
C- %:" enter 8")"5 & F3 10 & % ก (!ก(!('ก #

ก"5:&" % &(' X
%8"() X C- %:" enter

C- %:" enter

Xกก2  -8

C- %:" enter


 (  ++
&'  ก
R
• Numeric '7"5( &    2  2 &
:"
• Character '7"5( &ก 2  2 &
:):" 8 SPSS
8."2 &) String "5)8 $%  “…….” 
• Logical '7"5 %  ) '7 !#$ ! '(ก R !8."2 # 
( 3 TRUE $ T 8."( !#
FALSE $ F 8."( !
"5 %ก) & 3 !5)85'( )  D  3
Vector,Matrices,Arrays,( ( Data Frame
( )& ก!"( 3)
ก4(
( . R commander
ก OK
ก variable 1 !F3" )  Variable editor
3.$% &('&) sex ก2  type '7
( character
ก view data set !:"'5  3
 ก"5 %" ! ก R commander
"&2 % attach(X) ก enter
("&  ก x F3 ("&ก #- x ("& Enter
!:"5'
5&ก6
• :' % R commamder
• Data load data set
• Drive D floder Data_R $ก :9- Data7a1
• ก view data 5
• :' % 5 graphs $ก bar graph
• ก ok
5&ก import DATA
• R commander
• Data import data from SPSS data set
• Enter name “data set”
• ก ok
• Drive d folder DATA_SPSS
• ก open $ก :9- DATA.SAV
• ก open
• ก view data set
5& 7
• mean sd n NA
• AGE 37.04124 9.18776 97 3
• ID 50.50000 29.01149 100 0
• INCOME 4917.70833 1510.52412 96 4
• LIKE 4465.00000 3942.06273 100 0
• TIME 236.40000 62.55034 100 0

• )  '(ก R 8") % link  3


http://cid-
4a93862d7a4cb9c4.skydrive.live.com/browse.aspx/.Public/%E0%B8%AA%E0%B9%
88%E0%B8%87%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B9%82%E0%B8%9B%E
0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1R%5E5KMITL%5E6?vi
ew=details

You might also like