Re: [R] plot.hclust point to older version

2014-11-27 Thread PIKAL Petr
Hm

 -Original Message-
 From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us]
 Sent: Wednesday, November 26, 2014 8:09 PM
 To: PIKAL Petr; Martin Maechler
 Cc: R help
 Subject: Re: [R] plot.hclust point to older version

 Short answer to your question is R files and original data from
 external sources.

 I tend to keep my projects in separate directories. I make a core R

I do the same.

 file that I can run from beginning to end using source() to generate my
 primary analysis objects. I then make another file to keep my source()
 function call in, as well as a few exploratory plot commands. Recently
 I have been also sourcing the analysis script in Rmd or Rnw files to
 knit my observations with the output.

 Some people complain that their analysis takes too long to be sourcing
 it all the time. When I have that problem I set up a variable outside
 my analysis script that I test in my analysis script. If the variable
 indicates it is time to recalculate, then I do all of that and then
 save the data in sn rds or rda file. If the variable indicates that I
 should reuse the cached data, then it skips the calculations and just
 loads the data. This way I always load the right libraries along with
 the data, and I don't accidentally save data that I changed outside the
 analysis script... keeping my results reproducible. (Rds files can be
 convenient if I have several different slow analyses to compare and I
 want to only work on one at a time. I set up one control variable for
 each analysis.)

 Some people (smarter than me?) like to build their analysis into an
 Sweave or knitr file. They can then strip out an analysis R file to use
 the way I have described if they choose to do so (literate
 programming) but I have not picked up that habit yet.

 The key is keeping a record of how every object that is in your save
 file was originally created. If you tolerate auto saving and loading of
 the environment then you lose that record, and pernicious errors can

Not exactly. All commands are saved in .Rhistory, which from time to time I 
rename and keep for further use. And sometimes I also make a separate file with 
commands used, especially when I am at the end of my work on a project.


 creep into your environment from who knows where, and you might as well
 be using Excel if that is how you work. (Note that this means I hardly
 ever copy data straight from Excel via the clipboard as that is not
 reproducible. Usually this means Save As CSV in Excel to start my R
 analysis if that is the data source.)

As I understand you do more sophisticated version what I am doing. The key is 
to keep projects in separate directories and do not polute them with unrelated 
objects. The problem in my way is when I accidentaly destroy an object and I 
need to restore it, which can sometimes be tedious work. OTOH it keeps me 
focused on what I am doing :-)

Anyway, I shall consider save and saveRDS to keep copy of important objects 
outside .RData environment, if something went wrong.

Thanks for idea.

Best regards.
Petr


 ---
 
 Jeff NewmillerThe .   .  Go
 Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..
 Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 ---
 
 Sent from my phone. Please excuse my brevity.

 On November 26, 2014 2:05:54 AM PST, PIKAL Petr
 petr.pi...@precheza.cz wrote:
 Hi
 
 You say
 
  in other words, experienced R users do not let their workspace be
 saved
  automatically (to '.RData') and hence do not load any .RData
  automatically at startup.
 
 I save/load .RData for years without any issues (except of not
 installed packages when working on different PCs).I usually keep each
 project in separated .RData (and separated folder, together with all
 stuff belonging to that project), which prevent to mess things
 together.
 
 There is no such warning as do not use .RData in books I have
 available.
 
 I wonder how experienced useR keep track of several projects without
 using startup loading .RData?
 What would you recommend for keeping track of commands and created
 objects instead of .RData?
 
 Petr



Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či

Re: [R] plot.hclust point to older version

2014-11-27 Thread Martin Maechler
 PP == PIKAL Petr petr.pi...@precheza.cz
 on Thu, 27 Nov 2014 13:40:36 + writes:

PP Hm
 -Original Message-
 From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us]
 Sent: Wednesday, November 26, 2014 8:09 PM
 To: PIKAL Petr; Martin Maechler
 Cc: R help
 Subject: Re: [R] plot.hclust point to older version
 
 Short answer to your question is R files and original data from
 external sources.
 
 I tend to keep my projects in separate directories. I make a core R

PP I do the same.

 file that I can run from beginning to end using source() to generate my
 primary analysis objects. I then make another file to keep my source()
 function call in, as well as a few exploratory plot commands. Recently
 I have been also sourcing the analysis script in Rmd or Rnw files to
 knit my observations with the output.
 
 Some people complain that their analysis takes too long to be sourcing
 it all the time. When I have that problem I set up a variable outside
 my analysis script that I test in my analysis script. If the variable
 indicates it is time to recalculate, then I do all of that and then
 save the data in sn rds or rda file. If the variable indicates that I
 should reuse the cached data, then it skips the calculations and just
 loads the data. This way I always load the right libraries along with
 the data, and I don't accidentally save data that I changed outside the
 analysis script... keeping my results reproducible. (Rds files can be
 convenient if I have several different slow analyses to compare and I
 want to only work on one at a time. I set up one control variable for
 each analysis.)

 Some people (smarter than me?) like to build their analysis into an
 Sweave or knitr file. They can then strip out an analysis R file to use
 the way I have described if they choose to do so (literate
 programming) but I have not picked up that habit yet.

I do that occasionally, but in much less than in 50% of my R hacking

 The key is keeping a record of how every object that is in your save
 file was originally created. If you tolerate auto saving and loading of
 the environment then you lose that record, and pernicious errors can

PP Not exactly. All commands are saved in .Rhistory, which from time to 
time I rename and keep for further use. And sometimes I also make a separate 
file with commands used, especially when I am at the end of my work on a 
project.

Huaah Of course real useRs don't use .Rhistory either !
As Jeff says:  Use  name.R  files - often more than one per
project.

And I did not say one should not use save() and load() or the
*.rds equivalent which is preferable but I still did not get
into the full habit of using... one reason is the mismatch of
saveRDS() and readRDS()  {where as  write - read; or save -
load are the natural word pairs for me}.

So, yes, Jeff indeed is one of the real useRs .. in my sense ;-)

 creep into your environment from who knows where, and you might as well
 be using Excel if that is how you work. (Note that this means I hardly
 ever copy data straight from Excel via the clipboard as that is not
 reproducible. Usually this means Save As CSV in Excel to start my R
 analysis if that is the data source.)

PP As I understand you do more sophisticated version what I am doing. The 
key is to keep projects in separate directories and do not polute them with 
unrelated objects. The problem in my way is when I accidentaly destroy an 
object and I need to restore it, which can sometimes be tedious work. OTOH it 
keeps me focused on what I am doing :-)

PP Anyway, I shall consider save and saveRDS to keep copy of important 
objects outside .RData environment, if something went wrong.

PP Thanks for idea.

Once you become careful about that and organizing your *.R files
which keep the project  100% reproducible  you may start to
see that using .RData is just a hindrance for the discipline of
reproducible { research / data analysis / computational experiments }
using R...

Yes, I'm not sounding very nice, above... Sorry, please apologize.
Martin


PP Best regards.
PP Petr


 ---
 
 Jeff NewmillerThe .   .  Go
 Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
 Live:   OO#.. Dead: OO#..
 Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.
 rocks...1k
 ---
 
 Sent from my phone. Please excuse my brevity.
 
 On November 26, 2014 2:05:54 AM PST, PIKAL Petr
 petr.pi...@precheza.cz wrote:
 Hi
 
 You

Re: [R] plot.hclust point to older version

2014-11-26 Thread Martin Maechler

 Thanks! That worked

Of course: As in about 99.99% of all cases where Bill Dunlap  helps.


 You probably have a local copy of an old version of plot.hclust or 
 plot.dendrogram in your global environmenet or another package that masks the 
 one in package:stats.  E.g., I fired up R-2.14.2 and copied those 2 plot 
 methods to .GlobalEnv and then saved by workspace when quitting R.  I then 
 fired up R-3.1.1, which loads the workspace saved by the older version of R.  
 I get:

  objects()
 [1] plot.dendrogram plot.hclust
  plot(hclust(dist(c(2,3,5,7,11,13,17,19
 Error in .Internal(dend.window(n, merge, height, hang, labels, ...)) :
   there is no .Internal function 'dend.window'
  traceback()
 2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
 1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

 Note how calling traceback() after an error gives more information about the 
 source of the error.

 To fix this, get rid of the .RData file that is being loaded when R starts.

In the spirit of the old -- now politically incorrect -- sayings
 `` Real men don't . '''
I'd like to emphasize my own view that
 Real useRs don't use .RData

in other words, experienced R users do not let their workspace
be saved automatically (to '.RData') and hence do not load any
.RData automatically at startup.

Consequently, use R with the '--no-save' command line argument
(maybe also with '--no-restore').

ESS (Emacs Speaks Statistics) users can put

(custom-set-variables
 '(inferior-R-args --no-restore-history --no-save )
)

into their ~/.emacs
{and I'd like to see a way to do this easily with RStudio...}

Martin Maechler,
ETH Zurich and R Core Team 

 Bill Dunlap
 TIBCO Software
 wdunlap tibco.comhttp://tibco.com

 On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner 
 r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:
 On 26/11/14 08:53, Michael Mason wrote:
 Here you are. I expect most folks won't get the error.

 N   = 100; M = 1000
 mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
 h   = hclust(as.dist(1-cor(mat)))
 plot(h)

 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
there is no .Internal function 'dend.window'



 Thanks again


 On 11/25/14 11:29 AM, Rolf Turner 
 r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:



 Reproducible example???

 (I know from noddink about hclust, but I tried the example from the help
 page and it plotted without any problem.)

 cheers,

 Rolf Turner

 On 26/11/14 06:13, Michael Mason wrote:
 Hello fellow R users,

 I have recently updated to R 3.1.2. When trying to plot an hclust
 object to generate the dendrogram I get the following error:

 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
 there is no .Internal function 'dend.window'


 I am indeed using R3.1.2 but my understanding is that the .Internal API
 to the C code is no longer used. I have tried detaching the stats
 package and restarting R to no avail.
 I would love any help from any wiser guRus.

 Please keep communications on-list; there are others on the list far more 
 likely to be able to help you than I.  I am cc-ing this reply to the list.

 For what it's worth, I can run your example without error.

 As to how to track down what is going wrong on your system, I'm afraid I have 
 no idea.  Someone on the list may have some thoughts.

 cheers,

 Rolf Turner

 --
 Rolf Turner
 Technical Editor ANZJS

 __
 R-help@r-project.orgmailto: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.

 
 --CONFIDENTIALITY NOTICE--: The information contained in this email is 
 intended for the exclusive use of the addressee and may contain confidential 
 information. If you are not the intended recipient, you are hereby notified 
 that any form of dissemination of this communication is strictly prohibited. 
 www.benaroyaresearch.org

   [[alternative HTML version deleted]]

 __
 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] plot.hclust point to older version

2014-11-26 Thread Pascal Oettli
 into their ~/.emacs
 {and I'd like to see a way to do this easily with RStudio...}


In RStudio:

Tools - Global Options - General - uncheck Restore .RData into
workspace at startup and choose Never for Save workspace to .RData
on exit


-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan

__
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] plot.hclust point to older version

2014-11-26 Thread PIKAL Petr
Hi

You say

 in other words, experienced R users do not let their workspace be saved
 automatically (to '.RData') and hence do not load any .RData
 automatically at startup.

I save/load .RData for years without any issues (except of not installed 
packages when working on different PCs).I usually keep each project in 
separated .RData (and separated folder, together with all stuff belonging to 
that project), which prevent to mess things together.

There is no such warning as do not use .RData in books I have available.

I wonder how experienced useR keep track of several projects without using 
startup loading .RData?
What would you recommend for keeping track of commands and created objects 
instead of .RData?

Petr


 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Martin
 Maechler
 Sent: Wednesday, November 26, 2014 10:03 AM
 To: Michael Mason
 Cc: R help
 Subject: Re: [R] plot.hclust point to older version


  Thanks! That worked

 Of course: As in about 99.99% of all cases where Bill Dunlap  helps.


  You probably have a local copy of an old version of plot.hclust or
 plot.dendrogram in your global environmenet or another package that
 masks the one in package:stats.  E.g., I fired up R-2.14.2 and copied
 those 2 plot methods to .GlobalEnv and then saved by workspace when
 quitting R.  I then fired up R-3.1.1, which loads the workspace saved
 by the older version of R.  I get:

   objects()
  [1] plot.dendrogram plot.hclust
   plot(hclust(dist(c(2,3,5,7,11,13,17,19
  Error in .Internal(dend.window(n, merge, height, hang, labels, ...))
 :
there is no .Internal function 'dend.window'
   traceback()
  2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
  1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

  Note how calling traceback() after an error gives more information
 about the source of the error.

  To fix this, get rid of the .RData file that is being loaded when R
 starts.

 In the spirit of the old -- now politically incorrect -- sayings  ``
 Real men don't . '''
 I'd like to emphasize my own view that
  Real useRs don't use .RData

 in other words, experienced R users do not let their workspace be saved
 automatically (to '.RData') and hence do not load any .RData
 automatically at startup.

 Consequently, use R with the '--no-save' command line argument (maybe
 also with '--no-restore').

 ESS (Emacs Speaks Statistics) users can put

 (custom-set-variables
  '(inferior-R-args --no-restore-history --no-save )
 )

 into their ~/.emacs
 {and I'd like to see a way to do this easily with RStudio...}

 Martin Maechler,
 ETH Zurich and R Core Team

  Bill Dunlap
  TIBCO Software
  wdunlap tibco.comhttp://tibco.com

  On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner
 r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:
  On 26/11/14 08:53, Michael Mason wrote:
  Here you are. I expect most folks won't get the error.

  N   = 100; M = 1000
  mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
  h   = hclust(as.dist(1-cor(mat)))
  plot(h)

  Error in .Internal(dend.window(n, merge, height2, hang, labels, ...))
 :
 there is no .Internal function 'dend.window'



  Thanks again


  On 11/25/14 11:29 AM, Rolf Turner
 r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:



  Reproducible example???

  (I know from noddink about hclust, but I tried the example from the
  help page and it plotted without any problem.)

  cheers,

  Rolf Turner

  On 26/11/14 06:13, Michael Mason wrote:
  Hello fellow R users,

  I have recently updated to R 3.1.2. When trying to plot an hclust
  object to generate the dendrogram I get the following error:

  Error in .Internal(dend.window(n, merge, height2, hang, labels, ...))
 :
  there is no .Internal function 'dend.window'


  I am indeed using R3.1.2 but my understanding is that the .Internal
  API to the C code is no longer used. I have tried detaching the stats
  package and restarting R to no avail.
  I would love any help from any wiser guRus.

  Please keep communications on-list; there are others on the list far
 more likely to be able to help you than I.  I am cc-ing this reply to
 the list.

  For what it's worth, I can run your example without error.

  As to how to track down what is going wrong on your system, I'm
 afraid I have no idea.  Someone on the list may have some thoughts.

  cheers,

  Rolf Turner

  --
  Rolf Turner
  Technical Editor ANZJS

  __
  R-help@r-project.orgmailto: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.

  
  --CONFIDENTIALITY NOTICE--: The information contained in this email
 is
  intended for the exclusive use of the addressee and may contain
  confidential information. If you

Re: [R] plot.hclust point to older version

2014-11-26 Thread William Dunlap
How disruptive would it be if R were changed so the startup line
   [Previously saved workspace restored]
were changed to show the complete name, from normalizePath(), of the
saved workspace file?  E.g.,
   [Previously saved workspace restored from 'C:\Program Files\R\.RData']

(It is bad enough that the file name starts with a dot so it is hidden from
'ls',
but on Windows lots of people don't know what directory R is starting in.
On
my Windows PC R-3.1.2 starts in C:/Program Files/R, the parent of its RHOME
directory.)


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Wed, Nov 26, 2014 at 1:02 AM, Martin Maechler maech...@stat.math.ethz.ch
 wrote:


  Thanks! That worked

 Of course: As in about 99.99% of all cases where Bill Dunlap  helps.


  You probably have a local copy of an old version of plot.hclust or
 plot.dendrogram in your global environmenet or another package that masks
 the one in package:stats.  E.g., I fired up R-2.14.2 and copied those 2
 plot methods to .GlobalEnv and then saved by workspace when quitting R.  I
 then fired up R-3.1.1, which loads the workspace saved by the older version
 of R.  I get:

   objects()
  [1] plot.dendrogram plot.hclust
   plot(hclust(dist(c(2,3,5,7,11,13,17,19
  Error in .Internal(dend.window(n, merge, height, hang, labels, ...)) :
there is no .Internal function 'dend.window'
   traceback()
  2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
  1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

  Note how calling traceback() after an error gives more information about
 the source of the error.

  To fix this, get rid of the .RData file that is being loaded when R
 starts.

 In the spirit of the old -- now politically incorrect -- sayings
  `` Real men don't . '''
 I'd like to emphasize my own view that
  Real useRs don't use .RData

 in other words, experienced R users do not let their workspace
 be saved automatically (to '.RData') and hence do not load any
 .RData automatically at startup.

 Consequently, use R with the '--no-save' command line argument
 (maybe also with '--no-restore').

 ESS (Emacs Speaks Statistics) users can put

 (custom-set-variables
  '(inferior-R-args --no-restore-history --no-save )
 )

 into their ~/.emacs
 {and I'd like to see a way to do this easily with RStudio...}

 Martin Maechler,
 ETH Zurich and R Core Team

  Bill Dunlap
  TIBCO Software
  wdunlap tibco.comhttp://tibco.com

  On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner r.tur...@auckland.ac.nz
 mailto:r.tur...@auckland.ac.nz wrote:
  On 26/11/14 08:53, Michael Mason wrote:
  Here you are. I expect most folks won't get the error.

  N   = 100; M = 1000
  mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
  h   = hclust(as.dist(1-cor(mat)))
  plot(h)

  Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
 there is no .Internal function 'dend.window'



  Thanks again


  On 11/25/14 11:29 AM, Rolf Turner r.tur...@auckland.ac.nzmailto:
 r.tur...@auckland.ac.nz wrote:



  Reproducible example???

  (I know from noddink about hclust, but I tried the example from the help
  page and it plotted without any problem.)

  cheers,

  Rolf Turner

  On 26/11/14 06:13, Michael Mason wrote:
  Hello fellow R users,

  I have recently updated to R 3.1.2. When trying to plot an hclust
  object to generate the dendrogram I get the following error:

  Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
  there is no .Internal function 'dend.window'


  I am indeed using R3.1.2 but my understanding is that the .Internal API
  to the C code is no longer used. I have tried detaching the stats
  package and restarting R to no avail.
  I would love any help from any wiser guRus.

  Please keep communications on-list; there are others on the list far
 more likely to be able to help you than I.  I am cc-ing this reply to the
 list.

  For what it's worth, I can run your example without error.

  As to how to track down what is going wrong on your system, I'm afraid I
 have no idea.  Someone on the list may have some thoughts.

  cheers,

  Rolf Turner

  --
  Rolf Turner
  Technical Editor ANZJS

  __
  R-help@r-project.orgmailto: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.

  
  --CONFIDENTIALITY NOTICE--: The information contained in this email is
 intended for the exclusive use of the addressee and may contain
 confidential information. If you are not the intended recipient, you are
 hereby notified that any form of dissemination of this communication is
 strictly prohibited. www.benaroyaresearch.org

[[alternative HTML version deleted]]

  __
  R-help@r-project.org mailing list
  

Re: [R] plot.hclust point to older version

2014-11-26 Thread Jeff Newmiller
Short answer to your question is R files and original data from external 
sources.

I tend to keep my projects in separate directories. I make a core R file that I 
can run from beginning to end using source() to generate my primary analysis 
objects. I then make another file to keep my source() function call in, as well 
as a few exploratory plot commands. Recently I have been also sourcing the 
analysis script in Rmd or Rnw files to knit my observations with the output.

Some people complain that their analysis takes too long to be sourcing it all 
the time. When I have that problem I set up a variable outside my analysis 
script that I test in my analysis script. If the variable indicates it is time 
to recalculate, then I do all of that and then save the data in sn rds or rda 
file. If the variable indicates that I should reuse the cached data, then it 
skips the calculations and just loads the data. This way I always load the 
right libraries along with the data, and I don't accidentally save data that I 
changed outside the analysis script... keeping my results reproducible. (Rds 
files can be convenient if I have several different slow analyses to compare 
and I want to only work on one at a time. I set up one control variable for 
each analysis.)

Some people (smarter than me?) like to build their analysis into an Sweave or 
knitr file. They can then strip out an analysis R file to use the way I have 
described if they choose to do so (literate programming) but I have not 
picked up that habit yet.

The key is keeping a record of how every object that is in your save file was 
originally created. If you tolerate auto saving and loading of the environment 
then you lose that record, and pernicious errors can creep into your 
environment from who knows where, and you might as well be using Excel if that 
is how you work. (Note that this means I hardly ever copy data straight from 
Excel via the clipboard as that is not reproducible. Usually this means Save As 
CSV in Excel to start my R analysis if that is the data source.)
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On November 26, 2014 2:05:54 AM PST, PIKAL Petr petr.pi...@precheza.cz wrote:
Hi

You say

 in other words, experienced R users do not let their workspace be
saved
 automatically (to '.RData') and hence do not load any .RData
 automatically at startup.

I save/load .RData for years without any issues (except of not
installed packages when working on different PCs).I usually keep each
project in separated .RData (and separated folder, together with all
stuff belonging to that project), which prevent to mess things
together.

There is no such warning as do not use .RData in books I have
available.

I wonder how experienced useR keep track of several projects without
using startup loading .RData?
What would you recommend for keeping track of commands and created
objects instead of .RData?

Petr


 -Original Message-
 From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
Martin
 Maechler
 Sent: Wednesday, November 26, 2014 10:03 AM
 To: Michael Mason
 Cc: R help
 Subject: Re: [R] plot.hclust point to older version


  Thanks! That worked

 Of course: As in about 99.99% of all cases where Bill Dunlap  helps.


  You probably have a local copy of an old version of plot.hclust or
 plot.dendrogram in your global environmenet or another package that
 masks the one in package:stats.  E.g., I fired up R-2.14.2 and copied
 those 2 plot methods to .GlobalEnv and then saved by workspace when
 quitting R.  I then fired up R-3.1.1, which loads the workspace saved
 by the older version of R.  I get:

   objects()
  [1] plot.dendrogram plot.hclust
   plot(hclust(dist(c(2,3,5,7,11,13,17,19
  Error in .Internal(dend.window(n, merge, height, hang, labels,
...))
 :
there is no .Internal function 'dend.window'
   traceback()
  2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
  1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

  Note how calling traceback() after an error gives more information
 about the source of the error.

  To fix this, get rid of the .RData file that is being loaded when R
 starts.

 In the spirit of the old -- now politically incorrect -- sayings  ``
 Real men don't . '''
 I'd like to emphasize my own view that
  Real useRs don't use .RData

 in other words, experienced R users do not let their workspace be
saved
 automatically (to '.RData') and hence do not load any .RData

Re: [R] plot.hclust point to older version

2014-11-26 Thread David Winsemius

On Nov 26, 2014, at 9:49 AM, William Dunlap wrote:

 How disruptive would it be if R were changed so the startup line
   [Previously saved workspace restored]
 were changed to show the complete name, from normalizePath(), of the
 saved workspace file?  E.g.,
   [Previously saved workspace restored from 'C:\Program Files\R\.RData']
 
 (It is bad enough that the file name starts with a dot so it is hidden from
 'ls',
 but on Windows lots of people don't know what directory R is starting in.
 On
 my Windows PC R-3.1.2 starts in C:/Program Files/R, the parent of its RHOME
 directory.)

On the Mac Gui that happens with no effort as well as a message saying where 
the GUI history file resides. I just checked my .Rprofile file to make sure it 
wasn't doing that. I also have a line that prints the data and time:

utils:::timestamp(stamp = Sys.Date() )

Couldn't you just create a template .Rprofile with the appropriate message 
printed to console?

-- 
david.
 
 
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com
 
 On Wed, Nov 26, 2014 at 1:02 AM, Martin Maechler maech...@stat.math.ethz.ch
 wrote:
 
 
 Thanks! That worked
 
 Of course: As in about 99.99% of all cases where Bill Dunlap  helps.
 
 
 You probably have a local copy of an old version of plot.hclust or
 plot.dendrogram in your global environmenet or another package that masks
 the one in package:stats.  E.g., I fired up R-2.14.2 and copied those 2
 plot methods to .GlobalEnv and then saved by workspace when quitting R.  I
 then fired up R-3.1.1, which loads the workspace saved by the older version
 of R.  I get:
 
 objects()
 [1] plot.dendrogram plot.hclust
 plot(hclust(dist(c(2,3,5,7,11,13,17,19
 Error in .Internal(dend.window(n, merge, height, hang, labels, ...)) :
  there is no .Internal function 'dend.window'
 traceback()
 2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
 1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
 
 Note how calling traceback() after an error gives more information about
 the source of the error.
 
 To fix this, get rid of the .RData file that is being loaded when R
 starts.
 
 In the spirit of the old -- now politically incorrect -- sayings
 `` Real men don't . '''
 I'd like to emphasize my own view that
 Real useRs don't use .RData
 
 in other words, experienced R users do not let their workspace
 be saved automatically (to '.RData') and hence do not load any
 .RData automatically at startup.
 
 Consequently, use R with the '--no-save' command line argument
 (maybe also with '--no-restore').
 
 ESS (Emacs Speaks Statistics) users can put
 
 (custom-set-variables
 '(inferior-R-args --no-restore-history --no-save )
 )
 
 into their ~/.emacs
 {and I'd like to see a way to do this easily with RStudio...}
 
 Martin Maechler,
 ETH Zurich and R Core Team
 
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.comhttp://tibco.com
 
 On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner r.tur...@auckland.ac.nz
 mailto:r.tur...@auckland.ac.nz wrote:
 On 26/11/14 08:53, Michael Mason wrote:
 Here you are. I expect most folks won't get the error.
 
 N   = 100; M = 1000
 mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
 h   = hclust(as.dist(1-cor(mat)))
 plot(h)
 
 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
   there is no .Internal function 'dend.window'
 
 
 
 Thanks again
 
 
 On 11/25/14 11:29 AM, Rolf Turner r.tur...@auckland.ac.nzmailto:
 r.tur...@auckland.ac.nz wrote:
 
 
 
 Reproducible example???
 
 (I know from noddink about hclust, but I tried the example from the help
 page and it plotted without any problem.)
 
 cheers,
 
 Rolf Turner
 
 On 26/11/14 06:13, Michael Mason wrote:
 Hello fellow R users,
 
 I have recently updated to R 3.1.2. When trying to plot an hclust
 object to generate the dendrogram I get the following error:
 
 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
there is no .Internal function 'dend.window'
 
 
 I am indeed using R3.1.2 but my understanding is that the .Internal API
 to the C code is no longer used. I have tried detaching the stats
 package and restarting R to no avail.
 I would love any help from any wiser guRus.
 
 Please keep communications on-list; there are others on the list far
 more likely to be able to help you than I.  I am cc-ing this reply to the
 list.
 
 For what it's worth, I can run your example without error.
 
 As to how to track down what is going wrong on your system, I'm afraid I
 have no idea.  Someone on the list may have some thoughts.
 
 cheers,
 
 Rolf Turner
 
 --
 Rolf Turner
 Technical Editor ANZJS
 
 __
 R-help@r-project.orgmailto: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.
 
 
 --CONFIDENTIALITY NOTICE--: The information contained in this email is
 

Re: [R] plot.hclust point to older version

2014-11-25 Thread Rolf Turner



Reproducible example???

(I know from noddink about hclust, but I tried the example from the help 
page and it plotted without any problem.)


cheers,

Rolf Turner

On 26/11/14 06:13, Michael Mason wrote:

Hello fellow R users,

I have recently updated to R 3.1.2. When trying to plot an hclust object to 
generate the dendrogram I get the following error:

Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
   there is no .Internal function 'dend.window'


I am indeed using R3.1.2 but my understanding is that the .Internal API to the 
C code is no longer used. I have tried detaching the stats package and 
restarting R to no avail.
I would love any help from any wiser guRus.


--
Rolf Turner
Technical Editor ANZJS

__
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] plot.hclust point to older version

2014-11-25 Thread Rolf Turner

On 26/11/14 08:53, Michael Mason wrote:

Here you are. I expect most folks won't get the error.

N   = 100; M = 1000
mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
h   = hclust(as.dist(1-cor(mat)))
plot(h)

Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
   there is no .Internal function 'dend.window'



Thanks again


On 11/25/14 11:29 AM, Rolf Turner r.tur...@auckland.ac.nz wrote:




Reproducible example???

(I know from noddink about hclust, but I tried the example from the help
page and it plotted without any problem.)

cheers,

Rolf Turner

On 26/11/14 06:13, Michael Mason wrote:

Hello fellow R users,

I have recently updated to R 3.1.2. When trying to plot an hclust
object to generate the dendrogram I get the following error:

Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
there is no .Internal function 'dend.window'


I am indeed using R3.1.2 but my understanding is that the .Internal API
to the C code is no longer used. I have tried detaching the stats
package and restarting R to no avail.
I would love any help from any wiser guRus.


Please keep communications on-list; there are others on the list far 
more likely to be able to help you than I.  I am cc-ing this reply to 
the list.


For what it's worth, I can run your example without error.

As to how to track down what is going wrong on your system, I'm afraid I 
have no idea.  Someone on the list may have some thoughts.


cheers,

Rolf Turner

--
Rolf Turner
Technical Editor ANZJS

__
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] plot.hclust point to older version

2014-11-25 Thread William Dunlap
You probably have a local copy of an old version of plot.hclust or
plot.dendrogram in your global environmenet or another package that masks
the one in package:stats.  E.g., I fired up R-2.14.2 and copied those 2
plot methods to .GlobalEnv and then saved by workspace when quitting R.  I
then fired up R-3.1.1, which loads the workspace saved by the older version
of R.  I get:

 objects()
[1] plot.dendrogram plot.hclust
 plot(hclust(dist(c(2,3,5,7,11,13,17,19
Error in .Internal(dend.window(n, merge, height, hang, labels, ...)) :
  there is no .Internal function 'dend.window'
 traceback()
2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

Note how calling traceback() after an error gives more information about
the source of the error.

To fix this, get rid of the .RData file that is being loaded when R starts.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner r.tur...@auckland.ac.nz
wrote:

 On 26/11/14 08:53, Michael Mason wrote:

 Here you are. I expect most folks won't get the error.

 N   = 100; M = 1000
 mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
 h   = hclust(as.dist(1-cor(mat)))
 plot(h)

 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
there is no .Internal function 'dend.window'



 Thanks again


 On 11/25/14 11:29 AM, Rolf Turner r.tur...@auckland.ac.nz wrote:



 Reproducible example???

 (I know from noddink about hclust, but I tried the example from the help
 page and it plotted without any problem.)

 cheers,

 Rolf Turner

 On 26/11/14 06:13, Michael Mason wrote:

 Hello fellow R users,

 I have recently updated to R 3.1.2. When trying to plot an hclust
 object to generate the dendrogram I get the following error:

 Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
 there is no .Internal function 'dend.window'


 I am indeed using R3.1.2 but my understanding is that the .Internal API
 to the C code is no longer used. I have tried detaching the stats
 package and restarting R to no avail.
 I would love any help from any wiser guRus.


 Please keep communications on-list; there are others on the list far more
 likely to be able to help you than I.  I am cc-ing this reply to the list.

 For what it's worth, I can run your example without error.

 As to how to track down what is going wrong on your system, I'm afraid I
 have no idea.  Someone on the list may have some thoughts.

 cheers,

 Rolf Turner

 --
 Rolf Turner
 Technical Editor ANZJS

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


[[alternative HTML version deleted]]

__
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] plot.hclust point to older version

2014-11-25 Thread Michael Mason
Thanks! That worked

From: William Dunlap wdun...@tibco.commailto:wdun...@tibco.com
Date: Tuesday, November 25, 2014 12:53 PM
To: Rolf Turner r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz
Cc: Michael Mason 
mma...@benaroyaresearch.orgmailto:mma...@benaroyaresearch.org, R help 
R-help@r-project.orgmailto:R-help@r-project.org
Subject: Re: [R] plot.hclust point to older version

You probably have a local copy of an old version of plot.hclust or 
plot.dendrogram in your global environmenet or another package that masks the 
one in package:stats.  E.g., I fired up R-2.14.2 and copied those 2 plot 
methods to .GlobalEnv and then saved by workspace when quitting R.  I then 
fired up R-3.1.1, which loads the workspace saved by the older version of R.  I 
get:

 objects()
[1] plot.dendrogram plot.hclust
 plot(hclust(dist(c(2,3,5,7,11,13,17,19
Error in .Internal(dend.window(n, merge, height, hang, labels, ...)) :
  there is no .Internal function 'dend.window'
 traceback()
2: plot.hclust(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19
1: plot(hclust(dist(c(2, 3, 5, 7, 11, 13, 17, 19

Note how calling traceback() after an error gives more information about the 
source of the error.

To fix this, get rid of the .RData file that is being loaded when R starts.


Bill Dunlap
TIBCO Software
wdunlap tibco.comhttp://tibco.com

On Tue, Nov 25, 2014 at 12:18 PM, Rolf Turner 
r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:
On 26/11/14 08:53, Michael Mason wrote:
Here you are. I expect most folks won't get the error.

N   = 100; M = 1000
mat = matrix(1:(N*M) + rnorm(N*M,0,.5),N,M)
h   = hclust(as.dist(1-cor(mat)))
plot(h)

Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
   there is no .Internal function 'dend.window'



Thanks again


On 11/25/14 11:29 AM, Rolf Turner 
r.tur...@auckland.ac.nzmailto:r.tur...@auckland.ac.nz wrote:



Reproducible example???

(I know from noddink about hclust, but I tried the example from the help
page and it plotted without any problem.)

cheers,

Rolf Turner

On 26/11/14 06:13, Michael Mason wrote:
Hello fellow R users,

I have recently updated to R 3.1.2. When trying to plot an hclust
object to generate the dendrogram I get the following error:

Error in .Internal(dend.window(n, merge, height2, hang, labels, ...)) :
there is no .Internal function 'dend.window'


I am indeed using R3.1.2 but my understanding is that the .Internal API
to the C code is no longer used. I have tried detaching the stats
package and restarting R to no avail.
I would love any help from any wiser guRus.

Please keep communications on-list; there are others on the list far more 
likely to be able to help you than I.  I am cc-ing this reply to the list.

For what it's worth, I can run your example without error.

As to how to track down what is going wrong on your system, I'm afraid I have 
no idea.  Someone on the list may have some thoughts.

cheers,

Rolf Turner

--
Rolf Turner
Technical Editor ANZJS

__
R-help@r-project.orgmailto: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.


--CONFIDENTIALITY NOTICE--: The information contained in this email is intended 
for the exclusive use of the addressee and may contain confidential 
information. If you are not the intended recipient, you are hereby notified 
that any form of dissemination of this communication is strictly prohibited. 
www.benaroyaresearch.org

[[alternative HTML version deleted]]

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