I think the basic answer here is "package it", which I did a couple of times but found inconvenient if I was going to change the function fairly often, i've taken a different tact, just including custom functions when R starts, i wrote a function that runs when I start the R session, loading the functions in a given directory
Gedit's R plugin handles the Rprofile.conf for me, so thats how I made it automatically load, you could just edit that file and change the value of .start{ } #### # jcress, fall 2010 # load all of the scripts in a directory (called path) # also, define a new function which parses the content in ls() # so we can clean the session without removing the functions loaded #### path <- "~/.Rstartfiles" for (nm in list.files(path, pattern = "\\.[RrSsQq]$")) { source(file.path(path, nm)) cat("loading", nm, "\n") } cleanls <- function(objects){ for (func in list.files("/home/jcress/.Rstartfiles")){ objects[(which(objects == eval(removeext(func))))] <- "" } objects[which(objects=="cleanls")] <- "" return(c(objects[which(objects != "")])) } rm(list=cleanls(ls())) -- View this message in context: http://r.789695.n4.nabble.com/How-to-run-own-R-functions-in-JRI-tp2965288p2965473.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.