[R] Closing R fails

2006-11-09 Thread john seers \(IFR\)
 
Hello All
 
I cannot close R easily:
 
 
 q()
Error in .Last() : could not find function finalizeSession
 
 
This seems to have started after I used the R.utils package. If I load
the R.utils package I can close R successfully. But I do not want to
have to do this every time I run R.
 
Is there any way I can switch off /reverse this behaviour? (I have had a
look in the archives/documentation but cannot find a solution).
 
 
Thanks for any help.
 
 
John Seers
 
 
 
 
 R.version$os 
[1] mingw32
 R.version.string
[1] R version 2.4.0 Patched (2006-10-29 r39744)
 

 
 

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Closing R fails

2006-11-09 Thread Gavin Simpson
On Thu, 2006-11-09 at 12:18 +, john seers (IFR) wrote:
  Hello All
  
 I cannot close R easily:
  
  
  q()
 Error in .Last() : could not find function finalizeSession
  
  
 This seems to have started after I used the R.utils package. If I load
 the R.utils package I can close R successfully. But I do not want to
 have to do this every time I run R.

John, 

Does R close properly if you invoke R with the --vanilla flag?

I forget the best way to do this in Windows, but editing the shortcut is
one way. Right click the R shortcut, find the Target, and add --vanilla
to the end of it. You might need to enclose the whole path and command
in  , e.g.: C:\R\R.exe --vanilla. If I've gotten this wrong then I'm
sure a Windows user will let us know.

Your problem may be related to R loading a previous session that you
saved when exiting, where you'd used R.utils, which expects to find
R.utils loaded and throws and error when you exit because it isn't.
Running R --vanilla will stop R automatically loading the saved R
session file .RData.

HTH

G

  
 Is there any way I can switch off /reverse this behaviour? (I have had a
 look in the archives/documentation but cannot find a solution).
  
 
 Thanks for any help.
  
 
 John Seers

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC  ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Closing R fails

2006-11-09 Thread Duncan Murdoch
On 11/9/2006 7:18 AM, john seers (IFR) wrote:
  
 Hello All
  
 I cannot close R easily:
  
 
 q()
 Error in .Last() : could not find function finalizeSession
 
  
 This seems to have started after I used the R.utils package. If I load
 the R.utils package I can close R successfully. But I do not want to
 have to do this every time I run R.

You seem to have a .Last function defined that contains a call to 
finalizeSession.  Remove it and the error should go away:

.Last # to print it and see if anything important is there
rm(.Last) # to remove it if not

Normally you don't need .Last, but you can define it if you want R to do 
something on shutdown.  It looks like R.utils did that for you at some 
point, and you saved the workspace afterwards.

Duncan Murdoch

  
 Is there any way I can switch off /reverse this behaviour? (I have had a
 look in the archives/documentation but cannot find a solution).
  
  
 Thanks for any help.
  
  
 John Seers
  
  
  
  
 R.version$os 
 [1] mingw32
 R.version.string
 [1] R version 2.4.0 Patched (2006-10-29 r39744)
 
 
  
  
 
   [[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
 and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Closing R fails

2006-11-09 Thread john seers \(IFR\)


Hi Gavin

Thanks for helping.

 Does R close properly if you invoke R with the --vanilla flag?

It sure does.

So, deleting .RData from my workspace seems to fix it more neatly. But,
of course, the problem come backs whenever I use R.utils. (Unless I
remember not to save my workspace).

A good improvement though.

Thanks.

John




 
---

John Seers
Institute of Food Research
Norwich Research Park
Colney
Norwich
NR4 7UA
 

tel +44 (0)1603 251497
fax +44 (0)1603 507723
e-mail [EMAIL PROTECTED] 
e-disclaimer at http://www.ifr.ac.uk/edisclaimer/ 
 
Web sites:

www.ifr.ac.uk   
www.foodandhealthnetwork.com


-Original Message-
From: Gavin Simpson [mailto:[EMAIL PROTECTED] 
Sent: 09 November 2006 12:46
To: john seers (IFR)
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Closing R fails


On Thu, 2006-11-09 at 12:18 +, john seers (IFR) wrote:
  Hello All
  
 I cannot close R easily:
  
  
  q()
 Error in .Last() : could not find function finalizeSession
  
  
 This seems to have started after I used the R.utils package. If I load
 the R.utils package I can close R successfully. But I do not want to
 have to do this every time I run R.

John, 

Does R close properly if you invoke R with the --vanilla flag?

I forget the best way to do this in Windows, but editing the shortcut is
one way. Right click the R shortcut, find the Target, and add --vanilla
to the end of it. You might need to enclose the whole path and command
in  , e.g.: C:\R\R.exe --vanilla. If I've gotten this wrong then I'm
sure a Windows user will let us know.

Your problem may be related to R loading a previous session that you
saved when exiting, where you'd used R.utils, which expects to find
R.utils loaded and throws and error when you exit because it isn't.
Running R --vanilla will stop R automatically loading the saved R
session file .RData.

HTH

G

  
 Is there any way I can switch off /reverse this behaviour? (I have had
a
 look in the archives/documentation but cannot find a solution).
  
 
 Thanks for any help.
  
 
 John Seers

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC  ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Closing R fails

2006-11-09 Thread Gavin Simpson
On Thu, 2006-11-09 at 13:46 +, john seers (IFR) wrote:
 
 Hi Gavin
 
 Thanks for helping.

You're welcome

 
  Does R close properly if you invoke R with the --vanilla flag?
 
 It sure does.
 
 So, deleting .RData from my workspace seems to fix it more neatly. But,
 of course, the problem come backs whenever I use R.utils. (Unless I
 remember not to save my workspace).

I gave up saving workspaces a while back. I prefer to have everything as
a script (or scripts) that I can re-run, describing the analysis from
data processing to results. Most of the work I do doesn't involve the
huge data sets that some list members work does, so I can usually re-run
the scripts from scratch and continue where I left off.

If I have complex or tedious data manipulation scripts to process data
before analysis, or a computationally complex bit of analysis, I may opt
to save the resulting objects using save(), which I then load as
required using a load() call within my analysis script, rather than
re-run them each time.

I've been caught out a few times with things being loaded that I'd
forgotten about when I reused a workspace.

All the best,

G

 
 A good improvement though.
 
 Thanks.
 
 John
 
 
 
 
  
 ---
 
 John Seers
 Institute of Food Research
 Norwich Research Park
 Colney
 Norwich
 NR4 7UA
  
 
 tel +44 (0)1603 251497
 fax +44 (0)1603 507723
 e-mail [EMAIL PROTECTED] 
 e-disclaimer at http://www.ifr.ac.uk/edisclaimer/ 
 
 Web sites:
 
 www.ifr.ac.uk   
 www.foodandhealthnetwork.com
 
 
 -Original Message-
 From: Gavin Simpson [mailto:[EMAIL PROTECTED] 
 Sent: 09 November 2006 12:46
 To: john seers (IFR)
 Cc: r-help@stat.math.ethz.ch
 Subject: Re: [R] Closing R fails
 
 
 On Thu, 2006-11-09 at 12:18 +, john seers (IFR) wrote:
   Hello All
   
  I cannot close R easily:
   
   
   q()
  Error in .Last() : could not find function finalizeSession
   
   
  This seems to have started after I used the R.utils package. If I load
  the R.utils package I can close R successfully. But I do not want to
  have to do this every time I run R.
 
 John, 
 
 Does R close properly if you invoke R with the --vanilla flag?
 
 I forget the best way to do this in Windows, but editing the shortcut is
 one way. Right click the R shortcut, find the Target, and add --vanilla
 to the end of it. You might need to enclose the whole path and command
 in  , e.g.: C:\R\R.exe --vanilla. If I've gotten this wrong then I'm
 sure a Windows user will let us know.
 
 Your problem may be related to R loading a previous session that you
 saved when exiting, where you'd used R.utils, which expects to find
 R.utils loaded and throws and error when you exit because it isn't.
 Running R --vanilla will stop R automatically loading the saved R
 session file .RData.
 
 HTH
 
 G
 
   
  Is there any way I can switch off /reverse this behaviour? (I have had
 a
  look in the archives/documentation but cannot find a solution).
   
  
  Thanks for any help.
   
  
  John Seers
 
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC  ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
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
and provide commented, minimal, self-contained, reproducible code.