Skip to content
Back to formatted view

Raw Message

Message-ID: <57D77748-E300-4212-9340-7057264390A4@xs4all.nl>
Date: 2012-05-07T18:17:28Z
From: Berend Hasselman
Subject: Problem in executing R-script
In-Reply-To: <SNT139-W6D4146173F3B7459F3A928A130@phx.gbl>

On 07-05-2012, at 19:41, Suhaila Haji Mohd Hussin wrote:

> 
> Hello. I'm a newbie here.
> In my script (I name it readData.R), I wrote the followings:
> readData <-function(){	med = read.csv("medicalData.csv");}
> Then I tested the script by 'Source R Code' then on the command I typed 'readData()' then I typed 'med' to check if the variable contains the medical data but it returned 'Object med is not found'. What did I do wrong? Please help.

Have a look at section 10.5 "Assignment within functions" of the "An Introduction to R " manual.

Berend