2014年10月28日 星期二

Writting Code in R Editor, Using Code in R Console

Step1: File –> New script, to open R Editor

image

 

Step 2: Write function code

Step 3: myfun() and ls(), both can’t find the function we just wrote

Step 4: Copy and paste code from R Editor to R Console

Step 5: Now it’s ok to do myfun() and ls()

image

 

The other way to use our own functions:

Step 6: Write another function, myfun2

Step 7: Click “Save Script” button

Step 8: source(“fileName.r”) to get into our own functions

image

沒有留言:

張貼留言