Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-25 Thread Liviu Andronic
Dear Duncan,


On Wed, Apr 24, 2013 at 11:04 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
 What I've done sometimes in debugging is to change that error to a
 warning in the getNamespace() function, and add some tracing code to the
 serialization code to print the names of objects as they are loaded.
 (This goes in ReadItem in src/main/serialize.c.)

 I wouldn't expect Liviu to make those changes, but perhaps a verbose
 option could be added to load(), so that it could be available to users.

 I have added this in R-devel.  The format of the printed output may well
 change before this is ever released, but it should be enough to identify the
 bad item already.

 You'll need a build of R-devel from r62658 or newer to see this.  Then

 load(/tmp/a.rda, verbose=TRUE)

 will print the names of objects as they are read (the names are read after
 the attributes and before the value).  If you want to see reams of mostly
 useless information, you can try verbose=n (for some number n=2 or more);
 this prints names and component numbers to a greater depth.

Thank you for adding this in R. I will likely test this feature when
it gets released.

Best regards,
Liviu

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-25 Thread Duncan Murdoch

On 13-04-25 3:46 AM, Liviu Andronic wrote:

Dear Duncan,


On Wed, Apr 24, 2013 at 11:04 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:

What I've done sometimes in debugging is to change that error to a
warning in the getNamespace() function, and add some tracing code to the
serialization code to print the names of objects as they are loaded.
(This goes in ReadItem in src/main/serialize.c.)

I wouldn't expect Liviu to make those changes, but perhaps a verbose
option could be added to load(), so that it could be available to users.


I have added this in R-devel.  The format of the printed output may well
change before this is ever released, but it should be enough to identify the
bad item already.

You'll need a build of R-devel from r62658 or newer to see this.  Then

load(/tmp/a.rda, verbose=TRUE)

will print the names of objects as they are read (the names are read after
the attributes and before the value).  If you want to see reams of mostly
useless information, you can try verbose=n (for some number n=2 or more);
this prints names and component numbers to a greater depth.


Thank you for adding this in R. I will likely test this feature when
it gets released.


That will be about a year from now...

Duncan Murdoch

__
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.


[R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Liviu Andronic
Dear all,
I've bumped into the: Error in loadNamespace(name) : there is no
package called ‘R.utils’ error. I've already read a bit on this (
http://www.cybaea.net/Blogs/Data/A-warning-on-the-R-save-format.html )
but I have a follow-up question.

Given a workspace that automatically loads a package that I don't
really need/want (e.g. ‘R.utils’), how do I identify which object
requires this package to load? I would like to avoid loading ‘R.utils’
every time I open an R session.

Regards,
Liviu


 sessionInfo()
R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
LC_TIME=en_US.UTF-8
 [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] datasets  grDevices splines   graphics  utils stats
methods   base

other attached packages:
 [1] R.utils_1.23.2R.oo_1.13.0   R.methodsS3_1.4.2
tables_0.7.57 reshape2_1.2.2
 [6] car_2.0-15nnet_7.3-6MASS_7.3-23
Hmisc_3.10-1  survival_2.37-2
[11] foreign_0.8-53

loaded via a namespace (and not attached):
[1] cluster_1.14.3   grid_2.15.3  lattice_0.20-13  plyr_1.8
 rstudio_0.97.312
[6] stringr_0.6.2tools_2.15.3


-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Duncan Murdoch

On 13-04-24 5:46 AM, Liviu Andronic wrote:

Dear all,
I've bumped into the: Error in loadNamespace(name) : there is no
package called ‘R.utils’ error. I've already read a bit on this (
http://www.cybaea.net/Blogs/Data/A-warning-on-the-R-save-format.html )
but I have a follow-up question.

Given a workspace that automatically loads a package that I don't
really need/want (e.g. ‘R.utils’), how do I identify which object
requires this package to load? I would like to avoid loading ‘R.utils’
every time I open an R session.


That's not easy, because the code in R that triggers that error has no 
idea of the name of the object it is loading.


You could try a binary search to find out, but it will be tedious:
1. Install R.utils.
2. Load the workspace successfully.
3. Delete half the objects, and save it.
4. Uninstall R.utils, and see if you can load the workspace.

At this point you'll know if there's an object needing R.utils still 
left or not, and you can repeat the steps until you find a single object 
that causes the problem.  (But it might not be the only one, so deleting 
it from the original workspace might not solve your problem.)


A better approach is to *never* save and load workspaces unless you know 
exactly what is in them.  Always reply no to the question about saving 
your workspace (or set that as the default).  If you accidentally end up 
with a workspace being loaded, delete it.


Duncan Murdoch



Regards,
Liviu



sessionInfo()

R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
LC_TIME=en_US.UTF-8
  [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] datasets  grDevices splines   graphics  utils stats
methods   base

other attached packages:
  [1] R.utils_1.23.2R.oo_1.13.0   R.methodsS3_1.4.2
tables_0.7.57 reshape2_1.2.2
  [6] car_2.0-15nnet_7.3-6MASS_7.3-23
Hmisc_3.10-1  survival_2.37-2
[11] foreign_0.8-53

loaded via a namespace (and not attached):
[1] cluster_1.14.3   grid_2.15.3  lattice_0.20-13  plyr_1.8
  rstudio_0.97.312
[6] stringr_0.6.2tools_2.15.3




__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Martin Morgan

On 04/24/2013 06:03 AM, Duncan Murdoch wrote:

On 13-04-24 5:46 AM, Liviu Andronic wrote:

Dear all,
I've bumped into the: Error in loadNamespace(name) : there is no
package called ‘R.utils’ error. I've already read a bit on this (
http://www.cybaea.net/Blogs/Data/A-warning-on-the-R-save-format.html )
but I have a follow-up question.

Given a workspace that automatically loads a package that I don't
really need/want (e.g. ‘R.utils’), how do I identify which object
requires this package to load? I would like to avoid loading ‘R.utils’
every time I open an R session.


That's not easy, because the code in R that triggers that error has no idea of
the name of the object it is loading.


Maybe traceback() can provide some hints? I did, more or less arbitrarily

library(rms)
a = list(fun=ie.setup)
save(a, file=/tmp/a.rda)
remove.packages(rms)

and then in a new session

 load(/tmp/a.rda)
Error in loadNamespace(name) : there is no package called 'rms'
 traceback()
7: stop(e)
6: value[[3L]](cond)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
3: tryCatch(loadNamespace(name), error = function(e) stop(e))
2: getNamespace(c(rms, 3.6-3))
1: load(/tmp/a.rda)

with the line numbered 2 giving me the necessary hint.

Martin




You could try a binary search to find out, but it will be tedious:
1. Install R.utils.
2. Load the workspace successfully.
3. Delete half the objects, and save it.
4. Uninstall R.utils, and see if you can load the workspace.

At this point you'll know if there's an object needing R.utils still left or
not, and you can repeat the steps until you find a single object that causes the
problem.  (But it might not be the only one, so deleting it from the original
workspace might not solve your problem.)

A better approach is to *never* save and load workspaces unless you know exactly
what is in them.  Always reply no to the question about saving your workspace
(or set that as the default).  If you accidentally end up with a workspace being
loaded, delete it.

Duncan Murdoch



Regards,
Liviu



sessionInfo()

R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
LC_TIME=en_US.UTF-8
  [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] datasets  grDevices splines   graphics  utils stats
methods   base

other attached packages:
  [1] R.utils_1.23.2R.oo_1.13.0   R.methodsS3_1.4.2
tables_0.7.57 reshape2_1.2.2
  [6] car_2.0-15nnet_7.3-6MASS_7.3-23
Hmisc_3.10-1  survival_2.37-2
[11] foreign_0.8-53

loaded via a namespace (and not attached):
[1] cluster_1.14.3   grid_2.15.3  lattice_0.20-13  plyr_1.8
  rstudio_0.97.312
[6] stringr_0.6.2tools_2.15.3




__
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.



--
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Duncan Murdoch

On 13-04-24 10:12 AM, Martin Morgan wrote:

On 04/24/2013 06:03 AM, Duncan Murdoch wrote:

On 13-04-24 5:46 AM, Liviu Andronic wrote:

Dear all,
I've bumped into the: Error in loadNamespace(name) : there is no
package called ‘R.utils’ error. I've already read a bit on this (
http://www.cybaea.net/Blogs/Data/A-warning-on-the-R-save-format.html )
but I have a follow-up question.

Given a workspace that automatically loads a package that I don't
really need/want (e.g. ‘R.utils’), how do I identify which object
requires this package to load? I would like to avoid loading ‘R.utils’
every time I open an R session.


That's not easy, because the code in R that triggers that error has no idea of
the name of the object it is loading.


Maybe traceback() can provide some hints? I did, more or less arbitrarily

library(rms)
a = list(fun=ie.setup)
save(a, file=/tmp/a.rda)
remove.packages(rms)

and then in a new session

   load(/tmp/a.rda)
Error in loadNamespace(name) : there is no package called 'rms'
   traceback()
7: stop(e)
6: value[[3L]](cond)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
3: tryCatch(loadNamespace(name), error = function(e) stop(e))
2: getNamespace(c(rms, 3.6-3))
1: load(/tmp/a.rda)

with the line numbered 2 giving me the necessary hint.


That tells you that some object needs the rms package, but I don't see 
how you would know it is a that is the problem.  We already knew that 
rms was needed from the error message.


What I've done sometimes in debugging is to change that error to a 
warning in the getNamespace() function, and add some tracing code to the 
serialization code to print the names of objects as they are loaded. 
(This goes in ReadItem in src/main/serialize.c.)


I wouldn't expect Liviu to make those changes, but perhaps a verbose 
option could be added to load(), so that it could be available to users.


Duncan Murdoch



Martin




You could try a binary search to find out, but it will be tedious:
1. Install R.utils.
2. Load the workspace successfully.
3. Delete half the objects, and save it.
4. Uninstall R.utils, and see if you can load the workspace.

At this point you'll know if there's an object needing R.utils still left or
not, and you can repeat the steps until you find a single object that causes the
problem.  (But it might not be the only one, so deleting it from the original
workspace might not solve your problem.)

A better approach is to *never* save and load workspaces unless you know exactly
what is in them.  Always reply no to the question about saving your workspace
(or set that as the default).  If you accidentally end up with a workspace being
loaded, delete it.

Duncan Murdoch



Regards,
Liviu



sessionInfo()

R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)

locale:
   [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
LC_TIME=en_US.UTF-8
   [4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
   [7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] datasets  grDevices splines   graphics  utils stats
methods   base

other attached packages:
   [1] R.utils_1.23.2R.oo_1.13.0   R.methodsS3_1.4.2
tables_0.7.57 reshape2_1.2.2
   [6] car_2.0-15nnet_7.3-6MASS_7.3-23
Hmisc_3.10-1  survival_2.37-2
[11] foreign_0.8-53

loaded via a namespace (and not attached):
[1] cluster_1.14.3   grid_2.15.3  lattice_0.20-13  plyr_1.8
   rstudio_0.97.312
[6] stringr_0.6.2tools_2.15.3




__
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.





__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Liviu Andronic
Dear Duncan,


On Wed, Apr 24, 2013 at 4:57 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
 What I've done sometimes in debugging is to change that error to a warning
 in the getNamespace() function, and add some tracing code to the
 serialization code to print the names of objects as they are loaded. (This
 goes in ReadItem in src/main/serialize.c.)

 I wouldn't expect Liviu to make those changes, but perhaps a verbose
 option could be added to load(), so that it could be available to users.

That would be useful, indeed. As it stands save()/load() workspaces in
R seems very fragile and could easily trip users when working on
multiple machines or sharing their workspace with a colleague. In such
cases it is important to be able to quickly pinpoint the offending
object.

Regards,
Liviu

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Liviu Andronic
Dear Duncan,


On Wed, Apr 24, 2013 at 3:03 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:
 A better approach is to *never* save and load workspaces unless you know
 exactly what is in them.  Always reply no to the question about saving
 your workspace (or set that as the default).  If you accidentally end up
 with a workspace being loaded, delete it.

I must admit that I'm a bit surprised by this. I was always under the
impression that saving/restoring workspaces was the proper workflow in
R. If you use R interactively (e.g., not by running scripts), how else
would you store your data, intermediary results, etc., while working
on a project? Am I missing something?

Regards,
Liviu

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread R. Michael Weylandt
On Wed, Apr 24, 2013 at 4:08 PM, Liviu Andronic landronim...@gmail.com wrote:
 Dear Duncan,


 On Wed, Apr 24, 2013 at 3:03 PM, Duncan Murdoch
 murdoch.dun...@gmail.com wrote:
 A better approach is to *never* save and load workspaces unless you know
 exactly what is in them.  Always reply no to the question about saving
 your workspace (or set that as the default).  If you accidentally end up
 with a workspace being loaded, delete it.

 I must admit that I'm a bit surprised by this. I was always under the
 impression that saving/restoring workspaces was the proper workflow in
 R. If you use R interactively (e.g., not by running scripts), how else
 would you store your data, intermediary results, etc., while working
 on a project? Am I missing something?

I save the objects themselves (rather than the whole workspace) using
saveRDS() and readRDS() -- which I *think* are considered better
practice than save() and load() because they don't force names on you.

Cheers,
MW

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Hadley Wickham
 I must admit that I'm a bit surprised by this. I was always under the
 impression that saving/restoring workspaces was the proper workflow in
 R. If you use R interactively (e.g., not by running scripts), how else
 would you store your data, intermediary results, etc., while working
 on a project? Am I missing something?

You don't _store_ intermediate results - you recreate them from your
script.  If they are time consuming, then you can use readRDS/saveRDS
to cache the results. If you don't start with a clean workspace
frequently, it's difficult to tell whether or not your code is
reproducible.

Hadley

--
Chief Scientist, RStudio
http://had.co.nz/

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread John Kane

 -Original Message-
 From: h.wick...@gmail.com
 Sent: Wed, 24 Apr 2013 10:48:01 -0500
 To: landronim...@gmail.com
 Subject: Re: [R] identify object that causes Error in
 loadNamespace(name) : there is no package called ‘R.utils’
 
 I must admit that I'm a bit surprised by this. I was always under the
 impression that saving/restoring workspaces was the proper workflow in
 R. If you use R interactively (e.g., not by running scripts), how else
 would you store your data, intermediary results, etc., while working
 on a project? Am I missing something?
 
 You don't _store_ intermediate results - you recreate them from your
 script.  If they are time consuming, then you can use readRDS/saveRDS
 to cache the results. If you don't start with a clean workspace
 frequently, it's difficult to tell whether or not your code is
 reproducible.
 
 Hadley
 
 --
 Chief Scientist, RStudio
 http://had.co.nz/

Not to mention http://www.mail-archive.com/r-help@r-project.org/msg196997.html

John Kane
Kingston ON Canada


GET FREE SMILEYS FOR YOUR IM  EMAIL - Learn more at 
http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most 
webmails

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Duncan Murdoch

On 13-04-24 11:08 AM, Liviu Andronic wrote:

Dear Duncan,


On Wed, Apr 24, 2013 at 3:03 PM, Duncan Murdoch
murdoch.dun...@gmail.com wrote:

A better approach is to *never* save and load workspaces unless you know
exactly what is in them.  Always reply no to the question about saving
your workspace (or set that as the default).  If you accidentally end up
with a workspace being loaded, delete it.


I must admit that I'm a bit surprised by this. I was always under the
impression that saving/restoring workspaces was the proper workflow in
R. If you use R interactively (e.g., not by running scripts), how else
would you store your data, intermediary results, etc., while working
on a project? Am I missing something?


I think Michael and Hadley have already given good advice.  I'll just 
add one thing:  If you use R interactively, you should still be running 
scripts, just running them within an interactive session.  That way you 
have a record of what you did, and can back up (by starting over and 
running everything up to a known good spot) to make corrections.


Duncan Murdoch

__
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.


Re: [R] identify object that causes Error in loadNamespace(name) : there is no package called ‘R.utils’

2013-04-24 Thread Duncan Murdoch

On 13-04-24 10:57 AM, Duncan Murdoch wrote:

On 13-04-24 10:12 AM, Martin Morgan wrote:

On 04/24/2013 06:03 AM, Duncan Murdoch wrote:

On 13-04-24 5:46 AM, Liviu Andronic wrote:

Dear all,
I've bumped into the: Error in loadNamespace(name) : there is no
package called ‘R.utils’ error. I've already read a bit on this (
http://www.cybaea.net/Blogs/Data/A-warning-on-the-R-save-format.html )
but I have a follow-up question.

Given a workspace that automatically loads a package that I don't
really need/want (e.g. ‘R.utils’), how do I identify which object
requires this package to load? I would like to avoid loading ‘R.utils’
every time I open an R session.


That's not easy, because the code in R that triggers that error has no idea of
the name of the object it is loading.


Maybe traceback() can provide some hints? I did, more or less arbitrarily

library(rms)
a = list(fun=ie.setup)
save(a, file=/tmp/a.rda)
remove.packages(rms)

and then in a new session

load(/tmp/a.rda)
Error in loadNamespace(name) : there is no package called 'rms'
traceback()
7: stop(e)
6: value[[3L]](cond)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
3: tryCatch(loadNamespace(name), error = function(e) stop(e))
2: getNamespace(c(rms, 3.6-3))
1: load(/tmp/a.rda)

with the line numbered 2 giving me the necessary hint.


That tells you that some object needs the rms package, but I don't see
how you would know it is a that is the problem.  We already knew that
rms was needed from the error message.

What I've done sometimes in debugging is to change that error to a
warning in the getNamespace() function, and add some tracing code to the
serialization code to print the names of objects as they are loaded.
(This goes in ReadItem in src/main/serialize.c.)

I wouldn't expect Liviu to make those changes, but perhaps a verbose
option could be added to load(), so that it could be available to users.



I have added this in R-devel.  The format of the printed output may well 
change before this is ever released, but it should be enough to identify 
the bad item already.


You'll need a build of R-devel from r62658 or newer to see this.  Then

load(/tmp/a.rda, verbose=TRUE)

will print the names of objects as they are read (the names are read 
after the attributes and before the value).  If you want to see reams of 
mostly useless information, you can try verbose=n (for some number n=2 
or more); this prints names and component numbers to a greater depth.


Duncan Murdoch



Duncan Murdoch



Martin




You could try a binary search to find out, but it will be tedious:
1. Install R.utils.
2. Load the workspace successfully.
3. Delete half the objects, and save it.
4. Uninstall R.utils, and see if you can load the workspace.

At this point you'll know if there's an object needing R.utils still left or
not, and you can repeat the steps until you find a single object that causes the
problem.  (But it might not be the only one, so deleting it from the original
workspace might not solve your problem.)

A better approach is to *never* save and load workspaces unless you know exactly
what is in them.  Always reply no to the question about saving your workspace
(or set that as the default).  If you accidentally end up with a workspace being
loaded, delete it.

Duncan Murdoch



Regards,
Liviu



sessionInfo()

R version 2.15.3 (2013-03-01)
Platform: i686-pc-linux-gnu (32-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C

attached base packages:
[1] datasets  grDevices splines   graphics  utils stats
methods   base

other attached packages:
[1] R.utils_1.23.2R.oo_1.13.0   R.methodsS3_1.4.2
tables_0.7.57 reshape2_1.2.2
[6] car_2.0-15nnet_7.3-6MASS_7.3-23
Hmisc_3.10-1  survival_2.37-2
[11] foreign_0.8-53

loaded via a namespace (and not attached):
[1] cluster_1.14.3   grid_2.15.3  lattice_0.20-13  plyr_1.8
rstudio_0.97.312
[6] stringr_0.6.2tools_2.15.3




__
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.







__
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.