save function

La82

New Member
#1
Okay, so this is probably really really basic, but I simply cant get it to work. I want to use this function make.rm (http://cran.r-project.org/doc/contrib/Lemon-kickstart/makerm.R).

I have tried saving the script in my working directory, but when I try to run the command I get the following error: could not find function "make.rm"

So could anyone please specify how to save the script to get a working function? As far as I can see the function is not a part of a package, but I might be wrong...

Hope you can help

Lonnie
 

Dason

Ambassador to the humans
#2
You need to source the script. Just saving the script as a file won't cause it to get read into R (are you coming from a MATLAB background?).

Code:
setwd("path/to/directory/makerm.R")
source("makerm.R")