[R] Editor/environment problem

From: Richard Valliant <rvalliant_at_survey.umd.edu>
Date: Tue 06 Jun 2006 - 05:19:29 EST


I have encountered an odd problem in editing a function. I found no mention of this in the archives but may have missed something. I'm using Version 2.3.0 (2006-04-24). The problem is that after creating a function with fix, making some typos and correcting them, my function loses contact with everything in the search path except (apparently) package:base. Here is an example: > fix(tmp)> tmpfunction (x) { var(x)}> tmp(1:5)[1] 2.5> fix(tmp) # Typos (,/ at end of var(x) ) were intentionally introduced# line is now: var(x),/ Error in edit(name, file, title, editor) : an error occurred on line 3 use a command like x <- edit() to recover> tmp <- edit() # Typos corrected but new ones introduced# Line is now var(x)**** Error in edit(name, file, title, editor) : an error occurred on line 3 use a command like x <- edit() to recover> tmp <- edit() # Typos fixed.# List the function. Note the <environment: base> at end. Not there before. > tmpfunction (x) {

    var(x)}<environment: base>> tmp(1:5)Error in tmp(1:5) : could not find function "var" TIARichard

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 06 05:30:52 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 06 Jun 2006 - 06:10:35 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.