[R] Where does R search when source() ?

Cliff Lunneborg cliff at ms.washington.edu
Mon Jul 12 23:39:44 CEST 2004


I have found the use of save( ) and attach( ) when supported by a pair
of functions written by my colleague John Miyamoto, move( ) and rm.sv( )
quite useful in managing (1) collections of useful homebrew functions,
(2) project workspaces, and (3) "packages" under development. An .Rdata
file containing these and other handy functions together with a brief
supporting document can be downloaded from a course website:

http://faculty.washington.edu/lunnebor/Stat342/

Click on Exercises to get to the proper page.

**********************************************************
Cliff Lunneborg, Professor Emeritus, Statistics &
Psychology, University of Washington, Seattle
cliff at ms.washington.edu





----- Original Message ----- 
From: <r-help-request at stat.math.ethz.ch>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, July 12, 2004 3:04 AM
Subject: R-help Digest, Vol 17, Issue 11


| Send R-help mailing list submissions to
| r-help at stat.math.ethz.ch
|
| To subscribe or unsubscribe via the World Wide Web, visit
| https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| or, via email, send a message with subject or body 'help' to
| r-help-request at stat.math.ethz.ch
|
| You can reach the person managing the list at
| r-help-owner at stat.math.ethz.ch
|
| When replying, please edit your Subject line so it is more specific
| than "Re: Contents of R-help digest..."
|
|
| Today's Topics:
|
|    1. Fwd: newsletter (Martin Wegmann)
|    2. Re: Fwd: newsletter (Martin Wegmann)
|    3. Re: where does R search when source()? (Duncan Murdoch)
|    4. Re: where does R search when source()? (Duncan Murdoch)
|    5. Re: Creating a minimal package (was: where does R search when
|       source()?) (Duncan Murdoch)
|    6. Re: Creating a minimal package (Douglas Bates)
|    7. RE: Interpreting Results of Bootstrapping (Y C Tao)
|    8. Neural Net and SNOW (Ron Piccinini)
|    9. variable definition (Andrew R. Criswell)
|   10. Re: Distribution of Data (was:  your reference on this
|       problem highly appreciated) (Spencer Graves)
|   11. Re: variable definition (Wolski)
|   12. Re: variable definition (Achim Zeileis)
|   13. Re: dyn.load() for windows (Utsav Boobna)
|   14. Re: dyn.load() for windows (Duncan Murdoch)
|   15. RE: where does R search when source()? (Shin, Daehyok)
|   16. Re: variable definition (Gabor Grothendieck)
|   17. Re: where does R search when source()? (Duncan Murdoch)
|   18. RE: where does R search when source()? (Shin, Daehyok)
|   19. How to bring an Splus object into R (Victoria Landsman)
|   20. RE: How to bring an Splus object into R (Liaw, Andy)
|   21. Re: How to bring an Splus object into R (Peter Wilkinson)
|   22. Re: How to bring an Splus object into R (Victoria Landsman)
|   23. Re: Viewport parameters (Paul Murrell)
|   24. Re: Creating a minimal package (was: where does R search when
|       source()?) (Gabor Grothendieck)
|   25. WinXP "developer" asks: Tcl/Tk (Rcmdr) under OS X?
|       (White, Charles E WRAIR-Wash DC)
|   26. Re: WinXP "developer" asks: Tcl/Tk (Rcmdr) under OS X?
|       (Ulises Mora Alvarez)
|   27. Re: Creating a minimal package (was: where does R search when
|       source()?) (Duncan Murdoch)
|   28. Re: Creating a minimal package (was: where does R search when
|       source()?) (Gabor Grothendieck)
|   29. Association between discrete and continuous variable
|       (Richard A. O'Keefe)
|   30. Re: Creating a minimal package (Uwe Ligges)
|   31. Re: Association between discrete and continuous variable
|       (Jonathan Baron)
|   32. lme unequal random-effects variances varIdent pdMat Pinheiro
|       Bates nlme (Jacob Wegelin)
|   33. Re: Association between discrete and continuous variable
|       (Murray Jorgensen)
|   34. Nested source()s (Murray Jorgensen)
|   35. pixmapIndexed color question (Christoph Lehmann)
|
|
| ----------------------------------------------------------------------
|
| Message: 1
| Date: Sun, 11 Jul 2004 13:10:36 +0200
| From: Martin Wegmann <wegmann_mailinglist at gmx.net>
| Subject: [R] Fwd: newsletter
| To: "R-list" <r-help at stat.math.ethz.ch>
| Message-ID: <200407111310.36708.wegmann_mailinglist at gmx.net>
| Content-Type: text/plain;  charset="iso-8859-1"
|
|
|
| ----------  Forwarded Message  ----------
|
| Subject: newsletter
| Date: Sunday 11 July 2004 05:38
| From: Thomas Lumley <tlumley at u.washington.edu>
| To: r-announce at r-project.org
|
| The new issue of the R Newsletter (1/2004) is out on
|  http://www.r-project.org/
|
|          -thomas
|
| Thomas Lumley Assoc. Professor, Biostatistics
| tlumley at u.washington.edu University of Washington, Seattle
|
| _______________________________________________
| R-announce at stat.math.ethz.ch mailing list
| https://www.stat.math.ethz.ch/mailman/listinfo/r-announce
|
|
|
| ------------------------------
|
| Message: 2
| Date: Sun, 11 Jul 2004 13:16:52 +0200
| From: Martin Wegmann <wegmann_mailinglist at gmx.net>
| Subject: Re: [R] Fwd: newsletter
| To: r-help at stat.math.ethz.ch
| Message-ID: <200407111316.52663.wegmann_mailinglist at gmx.net>
| Content-Type: text/plain;  charset="iso-8859-1"
|
| sorry, did not intend to forward this mail to r-help ... Martin
|
| On Sunday 11 July 2004 13:10, Martin Wegmann wrote:
| > ----------  Forwarded Message  ----------
| >
| > Subject: newsletter
| > Date: Sunday 11 July 2004 05:38
| > From: Thomas Lumley <tlumley at u.washington.edu>
| > To: r-announce at r-project.org
| >
| > The new issue of the R Newsletter (1/2004) is out on
| >  http://www.r-project.org/
| >
| >          -thomas
| >
| > Thomas Lumley Assoc. Professor, Biostatistics
| > tlumley at u.washington.edu University of Washington, Seattle
| >
| > _______________________________________________
| > R-announce at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-announce
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
| > http://www.R-project.org/posting-guide.html
|
|
|
| ------------------------------
|
| Message: 3
| Date: Sun, 11 Jul 2004 07:58:06 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] where does R search when source()?
| To: sdhyok at email.unc.edu
| Cc: "R, Help" <r-help at stat.math.ethz.ch>
| Message-ID: <6na2f0hb599ce32nrhnk09v17j6ur5kin0 at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| On Sat, 10 Jul 2004 23:28:39 -0400, "Shin, Daehyok"
| <sdhyok at email.unc.edu> wrote:
|
| >Considering replies to my question, typical practices of R users
seem:
| >1. Creating a special function to source frequently used scripts.
|
| That's not right.  The practice I was describing is to have frequently
| used code in a function, not in a script.
|
| >2. Creating a personal package containing frequently used scripts.
|
| And here it would be frequently used *functions*.
| >
| >Both of them needs additional steps to edit the function or to
| >create/install the package
| >when a script file is edited or added.
|
| There's no additional step.  You write the function and use it.
|
| Duncan Murdoch
|
|
|
| ------------------------------
|
| Message: 4
| Date: Sun, 11 Jul 2004 08:25:40 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] where does R search when source()?
| To: renaud.lancelot at cirad.fr
| Cc: sdhyok at email.unc.edu, "R, Help" <r-help at stat.math.ethz.ch>, "Liaw,
| Andy" <andy_liaw at merck.com>
| Message-ID: <m2c2f01d2ripcrpnj3i4b292r9bv5eu3oo at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| On Sun, 11 Jul 2004 10:13:52 +0300, Renaud Lancelot
| <renaud.lancelot at cirad.fr> wrote:
|
| >I do agree with you: in my opinion, creating a package is not a
general
| >solution when you just want to save the script of a whole data
analysis
| >for the purpose of, say, a paper or a report.
|
| I agree that this is a good use for a script, but I don't think it's
| what Daehyok was talking about. He wants a library of frequently used
| scripts to be available in multiple projects.   In R, the best way to
| do that isn't to use scripts at all, it's to put the code in
| functions.
|
| The problem with script code that is not in functions is that it needs
| to have hard-coded variable names, and those can have undesirable side
| effects.  But if you start R with an empty workspace, then load data
| for a particular project from a script, collisions are unlikely.
|
| >To meet this goal, I save the script in a text file and I use a text
| >editor with sourcing facilities (e.g. WinEdt + R-WinEdt, Xemacs +
| >ESS,...: see Software ==> Other section on CRAN).
|
| R for Windows will have such an editor built in with the next major
| release (in the fall).
|
| Duncan Murdoch
|
|
|
| ------------------------------
|
| Message: 5
| Date: Sun, 11 Jul 2004 08:27:52 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] Creating a minimal package (was: where does R search
| when source()?)
| To: Gabor Grothendieck <ggrothendieck at myway.com>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <ngc2f0h8up0ip07bshguimh85644ltme39 at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| On Sun, 11 Jul 2004 05:40:33 +0000 (UTC), Gabor Grothendieck
| <ggrothendieck at myway.com> wrote:
|
| >Roger,
| >
| >A list of the steps referred to below would be of interest.
| >I realize the extensions manual exists but what I was
| >thinking of was just a list of the minimal steps you take
| >when you create a package for yourself.
|
| There's really just one step: call package.skeleton().
|
| Duncan Murdoch
|
|
|
| ------------------------------
|
| Message: 6
| Date: Sun, 11 Jul 2004 07:31:37 -0500
| From: Douglas Bates <bates at stat.wisc.edu>
| Subject: Re: [R] Creating a minimal package
| To: Gabor Grothendieck <ggrothendieck at myway.com>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <40F13329.4060905 at stat.wisc.edu>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| Gabor Grothendieck wrote:
| > Roger,
| >
| > A list of the steps referred to below would be of interest.
| > I realize the extensions manual exists but what I was
| > thinking of was just a list of the minimal steps you take
| > when you create a package for yourself.
| >
| > Thanks.
|
| It has already been automated.  See
|
| ?package.skeleton
|
|
| >
| > Roger D. Peng <rpeng <at> jhsph.edu> writes:
| >
| > :
| > : In fact, there is an elegant solution, and that is to write a
| > : package.  If this is all for personal use, then writing a package
| > : can be as simple as creating a few directories, copying the
| > : script files, and then running R CMD INSTALL.  I do this all the
| > : time when I have multiple projects that use the same code.
| > :
| > : -roger
| > :
| > : Shin, Daehyok wrote:
| > : > To my knowledge, it is a common practice for users to archive
some script
| > : > files in other directories than current working directory, when
the script
| > : > files are frequently used in many cases. So, it is somewhat
surprising to
| > me
| > : > there is no elegant solution to set up default search paths in
R.
| > : >
| > : > Here is my suggestion.
| > : > According to the setup of Python
(http://docs.python.org/tut/node8.html),
| > : > when source() is called,
| > : >
| > : > 1. Search current working directory.
| > : > 2. If not found, search the directories specified by the
environment
| > : > variable RPATH.
| > : >
| > : > I think this change will help users to manage script files more
easily.
| > What
| > : > do you think of it?
| > : >
| > : > Daehyok Shin
| > : >
| > : >
| > : >>-----Original Message-----
| > : >>From: Liaw, Andy [mailto:andy_liaw <at> merck.com]
| > : >>Sent: Saturday, July 10, 2004 PM 10:07
| > : >>To: 'sdhyok <at> email.unc.edu'; R, Help
| > : >>Subject: RE: [R] where does R search when source()?
| > : >>
| > : >>
| > : >>Not really.  The best I can come up with is something like:
| > : >>
| > : >>runScript <- function(script, dir="", ...) source(file.path(dir,
script,
| > : >>...)
| > : >>scriptdir <- "/path/to/scripts"
| > : >>
| > : >>runScript(scriptdir, "myScript.R")
| > : >>
| > : >>Andy
| > : >>
| > : >>
| > : >>>From: Shin, Daehyok
| > : >>>
| > : >>>The reason I asked is to separate script files from data files.
| > : >>>Usually, I am working in the directory containing data files,
but some
| > : >>>script files are in other shared directories. In the case, is
| > : >>>there any way
| > : >>>to access the script files conveniently without specifying
| > : >>>its absolute
| > : >>>path? In other word, any way to set up default search paths for
script
| > : >>>files?
| > : >>>
| > : >>>Daehyok Shin (Peter)
| > : >>>
| > : >>>
| > : >>>>The former.  No documentation says otherwise, so why would you
| > : >>>>think that it
| > : >>>>might search somewhere else?
| > : >>>>
| > : >>>>Andy
| > : >>>>
| > : >>>>
| > :
>>>>------------------------------------------------------------------
| > : >>>>------------
| > : >>>>Notice:  This e-mail message, together with any attachments,
| > : >>>>contains information of Merck & Co., Inc. (One Merck Drive,
| > : >>>>Whitehouse Station, New Jersey, USA 08889), and/or its
affiliates
| > : >>>>(which may be known outside the United States as Merck Frosst,
| > : >>>>Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be
| > : >>>>confidential, proprietary copyrighted and/or legally
privileged.
| > : >>>>It is intended solely for the use of the individual or entity
| > : >>>>named on this message.  If you are not the intended recipient,
| > : >>>>and have received this message in error, please notify us
| > : >>>>immediately by reply e-mail and then delete it from your
system.
| > :
>>>>------------------------------------------------------------------
| > : >>>>------------
| > : >>>>
| > : >>>
| > : >>>
| > : >>>
| > : >>
| > :
>>------------------------------------------------------------------
| > : >>------------
| > : >>Notice:  This e-mail message, together with any attachments,
| > : >>contains information of Merck & Co., Inc. (One Merck Drive,
| > : >>Whitehouse Station, New Jersey, USA 08889), and/or its
affiliates
| > : >>(which may be known outside the United States as Merck Frosst,
| > : >>Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be
| > : >>confidential, proprietary copyrighted and/or legally privileged.
| > : >>It is intended solely for the use of the individual or entity
| > : >>named on this message.  If you are not the intended recipient,
| > : >>and have received this message in error, please notify us
| > : >>immediately by reply e-mail and then delete it from your system.
| > :
>>------------------------------------------------------------------
| > : >>------------
| > : >>
| > : >
| > : >
| > : > ______________________________________________
| > : > R-help <at> stat.math.ethz.ch mailing list
| > : > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > : > PLEASE do read the posting guide!
http://www.R-project.org/posting-
| > guide.html
| > : >
| > :
| > : ______________________________________________
| > : R-help <at> stat.math.ethz.ch mailing list
| > : https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > : PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
| > :
| > :
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
|
|
|
| ------------------------------
|
| Message: 7
| Date: Sun, 11 Jul 2004 06:55:50 -0700 (PDT)
| From: Y C Tao <nov_tao at yahoo.com>
| Subject: RE: [R] Interpreting Results of Bootstrapping
| To: ted.harding at nessie.mcc.ac.uk, andy_liaw at merck.com
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <20040711135550.22535.qmail at web53506.mail.yahoo.com>
| Content-Type: text/plain; charset=us-ascii
|
| You are right, the outlier caused the problem. Using
| Spearman or Kendall's correlation seems to solve the
| problem. Thanks!
|
| Y. C. Tao
|
| --- Ted.Harding at nessie.mcc.ac.uk wrote:
| > Hi!
| >
| > Simply plot(x1,x2): you will see that there is one
| > point
| > (number 23) at (x1,x2) = (25.34,6.744) which is a
| > very
| > long way from all the other points (which, among
| > themselves,
| > form a somewhat diffuse cluster with some suggestion
| > of
| > further structure).
| >
| > When you bootstrap, the correlation you obtain in
| > any sample
| > will depend on whether or not this outlying point is
| > included
| > in the sample. If it is included, this single point
| > will generate
| > a relatively high value of the correlation
| > coefficient simply
| > because it is such a long way from all the others
| > (i.e. it is
| > highly influential).
| >
| > If it is not included, then the diffuse character of
| > the other
| > points will generate a very low value of the
| > correlation
| > coefficient.
| >
| >   > cor(x1,x2)
| >   [1] 0.7471931
| >   > cor(x1[-23],x2[-23])
| >   [1] 0.03914653
| >
| > Therefore your bootstrap distribution will have two
| > peaks: one
| > peak, around 0.75, corresponding to the bootstrap
| > samples which
| > include this outlying point, and the other, around
| > 0, corresponding
| > to the bootstrap samples which do not include it.
| >
| > This is the explanation and, at the same time, the
| > interpretation.
| >
| > Best wishes,
| > Ted.
| >
| > On 11-Jul-04 Y C Tao wrote:
| > > I tried to bootstrap the correlation between two
| > > variables x1 and x2. The resulting distribution
| > has
| > > two distinct peaks, how should I interprete it?
| > >
| > > The original code is attached.
| > >
| > > Y. C. Tao
| > >
| > > ----------------
| > >
| > > library(boot);
| > >
| > > my.correl<-function(d, i) cor(d[i,1], d[i,2])
| > >
| > >
| >
| x1<-c(-2.612,-0.7859,-0.5229,-1.246,1.647,1.647,0.1811,
| > >
| > -0.07097,0.8711,0.4323,0.1721,2.143,4.33,0.5002,
| > >
| > 0.4015,-0.5225,2.538,0.07959,-0.6645,4.521,-1.371,
| > >
| > 0.3327,25.24,-0.5417,2.094,0.6064,-0.4476,-0.5891,
| > >
| >
| -0.08879,-0.9487,-2.459e-05,-0.03887,0.2116,-0.0625,1.555,
| > >
| > 0.2069,-0.2142,-0.807,-0.6499,2.384,-0.02063,1.179,
| > >
| > -0.0003586,-1.408,0.6928,0.689,0.1854,0.4351,0.5663,
| > >        0.07171,-0.07004);
| > >
| > > x2<-c(
| >
| 0.08742,0.2555,-0.00337,0.03995,-1.208,-1.208,-0.001374,
| > >
| > -1.282,1.341,-0.9069,-0.2011,1.557,0.4517,-0.4376,
| > >
| >
| 0.4747,0.04965,-0.1668,-0.6811,-0.7011,-1.457,0.04652,
| > >
| > -1.117,6.744,-1.332,0.1327,-0.1479,-2.303,0.1235,
| >
| > >
| >
| 0.5916,0.05018,-0.7811,0.5869,-0.02608,0.9594,-0.1392,
| > >
| > 0.4089,0.1468,-1.507,-0.6882,-0.1781,0.5434,-0.4957,
| > >
| >
| 0.02557,-1.406,-0.5053,-0.7345,-1.314,0.3178,-0.2108,
| > >        0.4186,-0.03347);
| > >
| > > b<-boot(cbind(x1, x2), my.correl, 2000)
| > > hist(b$t, breaks=50)
| >
| > [The above rearranged to have 7 values in each
| > conplete line]
| >
| >
| >
| >
| --------------------------------------------------------------------
| > E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
| > Fax-to-email: +44 (0)870 167 1972
| > Date: 11-Jul-04
| >  Time: 10:40:34
| > ------------------------------ XFMail
| > ------------------------------
| >
|
|
|
| ------------------------------
|
| Message: 8
| Date: Sun, 11 Jul 2004 17:25:42 +0200 (CEST)
| From: Ron Piccinini <ronpicci at yahoo.fr>
| Subject: [R] Neural Net and SNOW
| To: r-help at stat.math.ethz.ch
| Message-ID: <20040711152542.77987.qmail at web52904.mail.yahoo.com>
| Content-Type: text/plain; charset=iso-8859-1
|
| Hello R masteRs,
|
| I was wondering if somebody had already implemented a
| parallel version of the function Nnet (with the SNOW
| package for instance) and would be willing to share a
| few pointers on how to achieve it. I have a training
| set of dimensions 905,000 X 5. Should I just get more
| RAM and run the nnet on one procesor? Or is there a
| slick way to parallelize the computations?
| I have tried to load the training set on each node and
| have the nnet function run on the master, but it seems
| that the master node will still put the whole training
| set in memory....
|
| Thank you in advance for your suggestions,
|
| Ron Piccinini.
|
|
|
| ------------------------------
|
| Message: 9
| Date: Sun, 11 Jul 2004 22:02:03 +0700 (ICT)
| From: "Andrew R. Criswell" <andrew.c at bu.ac.th>
| Subject: [R] variable definition
| To: r-help at stat.math.ethz.ch
| Message-ID: <32966.169.210.7.172.1089558123.squirrel at email.bu.ac.th>
| Content-Type: text/plain; charset=windows-874
|
| Hello All:
|
| This function obviously fails
|
|     x <- function(z) paste("go", z, sep = ".") <- 10
|     x("now")
|
| But is there a way to define the name of a variable through passing a
| parameter in a function call?
|
| Thanks,
| ANDREW
|
|
|
| ------------------------------
|
| Message: 10
| Date: Sun, 11 Jul 2004 09:04:48 -0700
| From: Spencer Graves <spencer.graves at pdf.com>
| Subject: Re: [R] Distribution of Data (was:  your reference on this
| problem highly appreciated)
| To: Yong Wang <wang at galton.uchicago.edu>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <40F16520.6040902 at pdf.com>
| Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
|       There are many tools for this, e.g., qqnorm, density, and in
| library(MASS) fitdistr.  Also do a literature search on
transformations
| (especially to transformations to normality) and on mixture
| distributions, esp. Titterington, Smith and Makov (1986) Statistical
| Analysis of Finite Mixture Distributions (Wiley).
|
|       What is the nature of your application?  If you tell us more
about
| the context, many people could tell you which distributions might be
| plausible and which would not be credible except as an approximation,
| e.g., a normal distribution for numbers that can not be negative and
| whose distribution might be positively skewed.
|
|       hope this helps.  spencer graves
| p.s.  PLEASE do read the posting guide!
| http://www.R-project.org/posting-guide.html
|
| Yong Wang wrote:
|
| >please help me on this
| >----- Message Text -----
| >Dear all R users
| >first, sorry for that this question might not be appropriate to ask
here.
| >
| >I wanna know theories or techinques aimed at following questions:
| >
| >I have a sample, say,K(at the range from 0 to 20000); the sample
data's
| >central  moments m(1)---m(j) are estimated(j can be large).
| >also, I can use some methodology to calculate the upper and lower
bound of
| >the probabilty of any interested interval, say, for the interval
| >(400--800)
| >
| >with all these information, I wanna recover the distribution of the
data,
| >at least recover to some approximating  analytic form.Does anybady
know
| >such theory or techiniques?
| >
| >your help will be highly appreciated.
| >best regards
| >yong
| >
| >______________________________________________
| >R-help at stat.math.ethz.ch mailing list
| >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| >PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
| >
| >
|
|
|
| ------------------------------
|
| Message: 11
| Date: Sun, 11 Jul 2004 18:05:29 +0200
| From: "Wolski" <wolski at molgen.mpg.de>
| Subject: Re: [R] variable definition
| To: andrew.c at bu.ac.th, r-help at stat.math.ethz.ch
| Message-ID: <200407111805290512.012F1DE8 at mail.math.fu-berlin.de>
| Content-Type: text/plain; charset="us-ascii"
|
| Hallo!
| ?assign
|
| z<-"now"
| assign(paste("go", z, sep = ".") ,10)
|
|
| Sincerely
| Eryk
|
| *********** REPLY SEPARATOR  ***********
|
| On 7/11/2004 at 10:02 PM Andrew R. Criswell wrote:
|
| >>>Hello All:
| >>>
| >>>This function obviously fails
| >>>
| >>>    x <- function(z) <- 10
| >>>    x("now")
| >>>
| >>>But is there a way to define the name of a variable through passing
a
| >>>parameter in a function call?
| >>>
| >>>Thanks,
| >>>ANDREW
| >>>
| >>>______________________________________________
| >>>R-help at stat.math.ethz.ch mailing list
| >>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| >>>PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
|
|
|
| Dipl. bio-chem. Eryk Witold Wolski    @    MPI-Moleculare Genetic
| Ihnestrasse 63-73 14195 Berlin       'v'
| tel: 0049-30-83875219               /   \
| mail: wolski at molgen.mpg.de        ---W-W---- 
http://www.molgen.mpg.de/~wolski
|
|
|
| ------------------------------
|
| Message: 12
| Date: Sun, 11 Jul 2004 18:11:00 +0200 (CEST)
| From: Achim Zeileis <Achim.Zeileis at wu-wien.ac.at>
| Subject: Re: [R] variable definition
| To: "Andrew R. Criswell" <andrew.c at bu.ac.th>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <Pine.LNX.4.58.0407111809580.6830 at thorin.ci.tuwien.ac.at>
| Content-Type: TEXT/PLAIN; charset=US-ASCII
|
|
| On Sun, 11 Jul 2004, Andrew R. Criswell wrote:
|
| > Hello All:
| >
| > This function obviously fails
| >
| >     x <- function(z) paste("go", z, sep = ".") <- 10
| >     x("now")
| >
| > But is there a way to define the name of a variable through passing
a
| > parameter in a function call?
|
| I'm not exactly sure what you want to do, but looking at
|   ?assign
| might be of some help.
| Z
|
| > Thanks,
| > ANDREW
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
| >
|
|
|
| ------------------------------
|
| Message: 13
| Date: Sun, 11 Jul 2004 09:13:17 -0700 (PDT)
| From: Utsav Boobna <catch_utsav at yahoo.com>
| Subject: Re: [R] dyn.load() for windows
| To: Duncan Murdoch <dmurdoch at pair.com>
| Cc: rhelp <r-help at stat.math.ethz.ch>
| Message-ID: <20040711161317.25358.qmail at web14828.mail.yahoo.com>
| Content-Type: text/plain; charset=us-ascii
|
| Hi,
|
| When I check the dll file by tdump, following error
| message was recieved.
|
| C:\Borland\BCC55\Bin>tdump Sample.dll
| Turbo Dump  Version 5.0.16.12 Copyright (c) 1988, 2000
| Inprise Corporation
|                     Display of File SAMPLE.DLL
| ERROR: Invalid signature for an .EXE file - found
| 0C80, expected 5A4D
|
| Please help.
|
| Cheers,
| Utsav
|
|
| --- Duncan Murdoch <dmurdoch at pair.com> wrote:
| > On Fri, 9 Jul 2004 03:29:55 -0700 (PDT), Utsav
| > Boobna
| > <catch_utsav at yahoo.com> wrote :
| >
| > >Hi
| > >I am using Borland C++ compiler 5.5 and R 1.7.1
| > >
| > >got the dll using
| > >
| > >c:\> bcc32 -u- -6 -O2 -osample.dll -WDE sample.c
| >
| > I don't know the bcc32 command line options.  Can
| > you examine the
| > sample.dll file (using e.g. "tdump sample.dll", if
| > you have tdump, or
| > "objdump -x sample.dll" using the objdump tool from
| > our tools
| > collection), and make sure it really is a DLL file?
| >
| > Once you work out what is necessary to produce a DLL
| > that works,
| > please write up a short description and send it to
| > me to include on my
| > page
| >
| >
| http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/
| >
| > I don't think there's anything there now that would
| > help you, but you
| > might browse it for inspiration...
| >
| > Duncan Murdoch
| >
| > >
| > >
| > >Then in R I used
| > >
| > >> dyn.load("sample.dll")
| > >
| > >Error in dyn.load(x, as.logical(local),
| > >as.logical(now)) :
| > >        unable to load shared library
| > "C:/sample.dll":
| > >  LoadLibrary failure:  %1 ist keine zulässige
| > >Win32-Anwendung.
| > >
| > >(Its in German ... meaning "%1 is not a valid Win32
| > >application.")
| > >
| > >
| > >
| > >Thanks,
| > >Utsav
| > >
| > >--- Duncan Murdoch <dmurdoch at pair.com> wrote:
| > >> On Fri, 9 Jul 2004 01:58:27 -0700 (PDT), Utsav
| > >> Boobna
| > >> <catch_utsav at yahoo.com> wrote:
| > >>
| > >> >Hi,
| > >> >   I compiled several C program files on Borland
| > >> C++
| > >> >compiler to get one dll output (as instructed in
| > >> the
| > >> >file readme.package). Now when I try to load
| > this
| > >> >*.dll to R using dyn.load(), then the machine
| > gives
| > >> >the error message "*.dll is not a valid windows
| > >> >data,....". The out put of R is
| > >> >
| > >> >I am working on win2k.
| > >> >What could be the possible reason for that?
| > >>
| > >> Please show us your code and the exact error
| > message
| > >> (using cut and
| > >> paste).  It might also help if you gave an exact
| > >> description of how
| > >> you produced the DLL (though I'm not familiar
| > with
| > >> BC++, someone else
| > >> might be), and gave version numbers of BC++ and
| > R.
| > >>
| > >> Duncan Murdoch
| > >>
| > >
| > >______________________________________________
| > >R-help at stat.math.ethz.ch mailing list
| >
| >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > >PLEASE do read the posting guide!
| > http://www.R-project.org/posting-guide.html
| >
| >
|
|
|
| ------------------------------
|
| Message: 14
| Date: Sun, 11 Jul 2004 12:27:07 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] dyn.load() for windows
| To: Utsav Boobna <catch_utsav at yahoo.com>
| Cc: rhelp <r-help at stat.math.ethz.ch>
| Message-ID: <kvp2f09hbcgpnr5fu3pufln09r9fijtclf at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| On Sun, 11 Jul 2004 09:13:17 -0700 (PDT), Utsav Boobna
| <catch_utsav at yahoo.com> wrote:
|
| >Hi,
| >
| >When I check the dll file by tdump, following error
| >message was recieved.
| >
| >C:\Borland\BCC55\Bin>tdump Sample.dll
| >Turbo Dump  Version 5.0.16.12 Copyright (c) 1988, 2000
| >Inprise Corporation
| >                    Display of File SAMPLE.DLL
| >ERROR: Invalid signature for an .EXE file - found
| >0C80, expected 5A4D
|
| That's a sign that there's something wrong with your bcc32 command.
| It's producing something (an .OBJ file?) that's named SAMPLE.DLL, but
| isn't a true DLL.
|
| You need to check the Borland documentation to find how to create a
| DLL.   Once you work this out and you've got things working well,
| *please* write up the details and send them to me.
|
| Alternatively, use the tools we recommend.  There are lots of people
| here who are familiar with them and can help you to get them to work.
| Borland has a better debugger than gdb and probably produces faster
| code than gcc, but there's a big advantage in using something that
| someone else can help you with.  As far as I know, *you're* the
| world's foremost expert on using BCC32 with R.  If that's not a
| position you feel qualified to hold, then use different tools.
|
| Duncan Murdoch
|
|
|
| ------------------------------
|
| Message: 15
| Date: Sun, 11 Jul 2004 12:41:20 -0400
| From: "Shin, Daehyok" <sdhyok at email.unc.edu>
| Subject: RE: [R] where does R search when source()?
| To: "Duncan Murdoch" <dmurdoch at pair.com>, <renaud.lancelot at cirad.fr>
| Cc: "R, Help" <r-help at stat.math.ethz.ch>
| Message-ID: <OAEOKPIGCLDDHAEMCAKICEHOCPAA.sdhyok at email.unc.edu>
| Content-Type: text/plain; charset="us-ascii"
|
|
| I agree that this is a good use for a script, but I don't think it's
| what Daehyok was talking about. He wants a library of frequently used
| scripts to be available in multiple projects.   In R, the best way to
| do that isn't to use scripts at all, it's to put the code in
| functions.
| What I asked is the way to set up default search paths for source
function,
| whether or not files in the paths contain a set of functions or simple
| script code.
| Daehyok Shin
|
|
|
| ------------------------------
|
| Message: 16
| Date: Sun, 11 Jul 2004 16:47:04 +0000 (UTC)
| From: Gabor Grothendieck <ggrothendieck at myway.com>
| Subject: Re: [R] variable definition
| To: r-help at stat.math.ethz.ch
| Message-ID: <loom.20040711T182945-616 at post.gmane.org>
| Content-Type: text/plain; charset=us-ascii
|
| Wolski <wolski <at> molgen.mpg.de> writes:
|
| >
| > Hallo!
| > ?assign
| >
| > z<-"now"
| > assign(paste("go", z, sep = ".") ,10)
|
| Assuming that you wish to create a variable called go.now with the
| value of 10 in the caller environment to f:
|
|    R> f <- function(z) assign(paste("go", z, sep = "."), 10,
parent.frame())
|    R> f("now")
|    R> go.now
|    [1] 10
|
|
|
| ------------------------------
|
| Message: 17
| Date: Sun, 11 Jul 2004 13:12:31 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] where does R search when source()?
| To: <sdhyok at email.unc.edu>
| Cc: "R, Help" <r-help at stat.math.ethz.ch>
| Message-ID: <9is2f09uuhheps65u8ecufkj5km39upk9p at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| I wrote:
|
| >I agree that this is a good use for a script, but I don't think it's
| >what Daehyok was talking about. He wants a library of frequently used
| >scripts to be available in multiple projects.   In R, the best way to
| >do that isn't to use scripts at all, it's to put the code in
| >functions.
|
| On Sun, 11 Jul 2004 12:41:20 -0400, "Shin, Daehyok"
| <sdhyok at email.unc.edu> wrote:
|
| >What I asked is the way to set up default search paths for source
function,
| >whether or not files in the paths contain a set of functions or
simple
| >script code.
|
| Gabor gave you a way to do that.  I was responding to your suggestion
| that R should be modified to make this more convenient, because
|
| >To my knowledge, it is a common practice for users to archive some
script
| >files in other directories than current working directory, when the
script
| >files are frequently used in many cases. So, it is somewhat
surprising to me
| >there is no elegant solution to set up default search paths in R.
|
| I don't think this is a common practice; if it is, it shouldn't be.
| Frequently used code should be in functions.  There are a lot of ways
| to get those functions into your workspace, but R packages are the
| best one.  There *is* a mechanism (the .libPaths function) for
| specifying a search path for packages.
|
| Duncan Murdoch
|
|
|
| ------------------------------
|
| Message: 18
| Date: Sun, 11 Jul 2004 13:16:40 -0400
| From: "Shin, Daehyok" <sdhyok at email.unc.edu>
| Subject: RE: [R] where does R search when source()?
| To: "Duncan Murdoch" <dmurdoch at pair.com>
| Cc: "R, Help" <r-help at stat.math.ethz.ch>
| Message-ID: <OAEOKPIGCLDDHAEMCAKIEEHPCPAA.sdhyok at email.unc.edu>
| Content-Type: text/plain; charset="us-ascii"
|
| > >Considering replies to my question, typical practices of R users
seem:
| > >1. Creating a special function to source frequently used scripts.
| >
| > That's not right.  The practice I was describing is to have
frequently
| > used code in a function, not in a script.
|
| Here, I meant "scripts " is "script files" whether they contains a
series of
| commands, or reusable functions.
| This practice is not based on other replies, not yours.
|
| >
| > >2. Creating a personal package containing frequently used scripts.
| >
| > And here it would be frequently used *functions*.
| > >
|
| If the script files is a collection of functions, as you said,
creating a
| package can be one solution.
|
| > >Both of them needs additional steps to edit the function or to
| > >create/install the package
| > >when a script file is edited or added.
| >
| > There's no additional step.  You write the function and use it.
|
| Why are there no additional steps?
| You suggested creating and installing a package is the solution to
source
| frequently used functions.
| Then, every time I add/modify a function in a script file, or add new
script
| file, I have to re-create and re-install the package,
| which are additional steps, not directly related with the addition or
| modification.
|
| More fundamental problem here is that the functions may have no common
| context except "frequently used".
| In the case, bundling all the functions into one package may not be a
proper
| choice.
|
| So, I still think creating new package mayb be too heavy solution.
| Why don't we simply extend a little bit the searching range of source
| function?
|
| >
| > Duncan Murdoch
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
| > http://www.R-project.org/posting-guide.html
| >
|
|
|
| ------------------------------
|
| Message: 19
| Date: Sun, 11 Jul 2004 22:54:19 +0200
| From: "Victoria Landsman" <msvika at mscc.huji.ac.il>
| Subject: [R] How to bring an Splus object into R
| To: <r-help at stat.math.ethz.ch>
| Message-ID: <009701c46789$3c54fe00$8600a8c0 at home2>
| Content-Type: text/plain
|
| Dear all,
| I like to bring the list created in Splus into R. What is the shortest
way to do this?
| Much thanks, Vicky.
| [[alternative HTML version deleted]]
|
|
|
| ------------------------------
|
| Message: 20
| Date: Sun, 11 Jul 2004 16:06:28 -0400
| From: "Liaw, Andy" <andy_liaw at merck.com>
| Subject: RE: [R] How to bring an Splus object into R
| To: "'Victoria Landsman'" <msvika at mscc.huji.ac.il>,
| r-help at stat.math.ethz.ch
| Message-ID:
| <3A822319EB35174CA3714066D590DCD504AF8013 at usrymx25.merck.com>
| Content-Type: text/plain
|
| >From the `R Data Import/Export' manual, shipped with R, as well as
available
| from the official R web site (last three paragraphs of Section 3.1,
| describing functions in the `foreign' package):
|
| Function read.S which can read binary objects produced by S-PLUS 3.x,
4.x or
| 2000
| on (32-bit) Unix or Windows (and can read them on a di
| erent OS). This is able to read
| many but not all S objects: in particular it can read vectors,
matrices and
| data frames and
| lists containing those.
| Function data.restore reads S-PLUS data dumps (created by data.dump)
with
| the same restrictions (except that dumps from the Alpha platform can
also be
| read).
| It should be possible to read data dumps from S-PLUS 5.x and 6.x
written
| with
| data.dump(oldStyle=T).
| If you have access to S-PLUS, it is usually more reliable to dump the
| object(s) in S-PLUS
| and source the dumpfile in R. For S-PLUS 5.x and 6.x you may need to
use
| dump(...,
| oldStyle=T), and to read in very large objects it may be preferable to
use
| the dumpfile as
| a batch script rather than source.
|
| Please learn to read the manual yourself.
|
| Andy
|
| > From: Victoria Landsman
| >
| > Dear all,
| > I like to bring the list created in Splus into R. What is the
| > shortest way to do this?
| > Much thanks, Vicky.
| > [[alternative HTML version deleted]]
| >
|
|
|
| ------------------------------
|
| Message: 21
| Date: Sun, 11 Jul 2004 16:51:59 -0400
| From: Peter Wilkinson <pwilkinson at videotron.ca>
| Subject: Re: [R] How to bring an Splus object into R
| To: Victoria Landsman <msvika at mscc.huji.ac.il>,
| r-help at stat.math.ethz.ch
| Message-ID: <6.1.1.1.2.20040711165025.01bd87a0 at pop.videotron.ca>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| Actually I have wondered about the same but from R to S.  To solve
that I
| have written the data from R into a tab separated file, then imported
it
| into S.
|
| Peter
|
|
| At 04:54 PM 7/11/2004, Victoria Landsman wrote:
| >Dear all,
| >I like to bring the list created in Splus into R. What is the
shortest way
| >to do this?
| >Much thanks, Vicky.
| >         [[alternative HTML version deleted]]
| >
| >______________________________________________
| >R-help at stat.math.ethz.ch mailing list
| >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| >PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
|
|
|
| ------------------------------
|
| Message: 22
| Date: Mon, 12 Jul 2004 00:06:08 +0200
| From: "Victoria Landsman" <msvika at mscc.huji.ac.il>
| Subject: Re: [R] How to bring an Splus object into R
| To: <r-help at stat.math.ethz.ch>
| Message-ID: <00b601c46793$4519f900$8600a8c0 at home2>
| Content-Type: text/plain; charset="iso-8859-1"
|
| Much thanks to all who replied me. I used 'dump' in Splus5 and then
'source'
| in R 1.9.1 (both on Unix) and it works.
| Vicky.
|
|
|
| ----- Original Message -----
| From: "Peter Wilkinson" <pwilkinson at videotron.ca>
| To: "Victoria Landsman" <msvika at mscc.huji.ac.il>;
<r-help at stat.math.ethz.ch>
| Sent: Sunday, July 11, 2004 10:51 PM
| Subject: Re: [R] How to bring an Splus object into R
|
|
| > Actually I have wondered about the same but from R to S.  To solve
that I
| > have written the data from R into a tab separated file, then
imported it
| > into S.
| >
| > Peter
| >
| >
| > At 04:54 PM 7/11/2004, Victoria Landsman wrote:
| > >Dear all,
| > >I like to bring the list created in Splus into R. What is the
shortest
| way
| > >to do this?
| > >Much thanks, Vicky.
| > >         [[alternative HTML version deleted]]
| > >
| > >______________________________________________
| > >R-help at stat.math.ethz.ch mailing list
| > >https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > >PLEASE do read the posting guide!
| http://www.R-project.org/posting-guide.html
| >
| >
|
|
|
| ------------------------------
|
| Message: 23
| Date: Mon, 12 Jul 2004 09:09:06 +1200
| From: Paul Murrell <p.murrell at auckland.ac.nz>
| Subject: Re: [R] Viewport parameters
| To: simon.woodhead at bristol.ac.uk
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <40F1AC72.7040307 at stat.auckland.ac.nz>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| Hi
|
|
| Simon Woodhead wrote:
| > Hello all,
| >
| > In the Grid addon package from Paul Murrell is there a way of
finding
| > the parameter settings for the viewport you are in? I understand in
| > Lattice there is a function trellis.get.par(), is there something
| > similar for Grid?
|
|
| If you're using R 1.9.something, then get.gpar() should do the trick.
|
| Paul
| -- 
| Dr Paul Murrell
| Department of Statistics
| The University of Auckland
| Private Bag 92019
| Auckland
| New Zealand
| 64 9 3737599 x85392
| paul at stat.auckland.ac.nz
| http://www.stat.auckland.ac.nz/~paul/
|
|
|
| ------------------------------
|
| Message: 24
| Date: Sun, 11 Jul 2004 21:28:44 +0000 (UTC)
| From: Gabor Grothendieck <ggrothendieck at myway.com>
| Subject: Re: [R] Creating a minimal package (was: where does R search
| when source()?)
| To: r-help at stat.math.ethz.ch
| Message-ID: <loom.20040711T231128-574 at post.gmane.org>
| Content-Type: text/plain; charset=us-ascii
|
| Duncan Murdoch <dmurdoch <at> pair.com> writes:
|
| :
| : On Sun, 11 Jul 2004 05:40:33 +0000 (UTC), Gabor Grothendieck
| : <ggrothendieck <at> myway.com> wrote:
| :
| : >Roger,
| : >
| : >A list of the steps referred to below would be of interest.
| : >I realize the extensions manual exists but what I was
| : >thinking of was just a list of the minimal steps you take
| : >when you create a package for yourself.
| :
| : There's really just one step: call package.skeleton().
| :
| : Duncan Murdoch
|
| I was hoping for something that really was that simple but
| I tried and so far it seems that I also must also
|
| 1. when I run skeleton.package realize that I must use the arg
|    path = "library"
|    The example that is shown there appears to omit that.
|
| 2. download and install tools.zip, perl and windows help as listed at:
|
|    http://www.murdoch-sutherland.com/Rtools/
|
| I got tripped up for quite a while when it could not find hhc.exe and
| I finally realized I had not downloaded the windows help distribution.
|
| 3. change the name of the package in the DESCRIPTION file -- it seems
| that the name = arg on package.skeleton did not change it for me.
|
| 4. make changes to the documentation files.  I am just working on this
| now.  Some default null documentation exists but it appears that it
| MUST be modified in order to get a working package so this makes
another
| step.
|
| There maybe other things but its taken me several hours just to get
| this far and I do not yet have a functioning package.
|
| I think it would be handy if everything you need to know to actually
| create a minimal functioning package were in ?skeleton.package
| so that one could create a minimal functioning package without
actually
| reading the extensions manual and then incrementally improve it.
Right
| now there is quite a bit you have to know just to get to that point.
|
| I have so far looked at skeleton.package, readme.packages in rw1091,
| murdoch-suthertherland.com link mentioned above and the extensions
manual
| so the startup to doing this is really a multi-step complex process.
|
| The skeleton.package idea actually seems quite nifty but I think it
| needs more work before one can really claim that its a one-step
process
| to create the example package.
|
|
|
| ------------------------------
|
| Message: 25
| Date: Sun, 11 Jul 2004 17:36:08 -0400
| From: "White, Charles E WRAIR-Wash DC"
| <charles.edwin.white at us.army.mil>
| Subject: [R] WinXP "developer" asks: Tcl/Tk (Rcmdr) under OS X?
| To: <r-help at stat.math.ethz.ch>
| Cc: jfox at mcmaster.ca
| Message-ID:
| <12D0D00E1404D511A4820090274CA09C03FBA6E0 at dasmtyjqf010.amedd.army.mil>
| Content-Type: text/plain
|
| It is my understanding that Tcl/Tk does not come with the base
installation of R under OS X (
http://www.sciviews.org/_rgui/projects/TclTk.html). Is there a simple
way to explain how a user with limited tolerance for computer complexity
can obtain and install Tcl/Tk for OS X?
|
| Thanks.
|
| Chuck
|
| Background: Roughly a third of my target audience uses OS X. I do not
and I do not have access to a machine I could use as a development
platform.
|
| Charles E. White, Senior Biostatistician, MS
| Walter Reed Army Institute of Research
| 503 Robert Grant Ave., Room 1w102
| Silver Spring, MD 20910-1557
| 301 319-9781
| Personal/Professional Site:
http://users.starpower.net/cwhite571/professional/
|
|
| [[alternative HTML version deleted]]
|
|
|
| ------------------------------
|
| Message: 26
| Date: Sun, 11 Jul 2004 19:59:29 -0500 (CDT)
| From: Ulises Mora Alvarez <umalvarez at fata.unam.mx>
| Subject: Re: [R] WinXP "developer" asks: Tcl/Tk (Rcmdr) under OS X?
| To: "White, Charles E WRAIR-Wash DC" <charles.edwin.white at us.army.mil>
| Cc: jfox at mcmaster.ca, r-help at stat.math.ethz.ch
| Message-ID:
| <Pine.LNX.4.44.0407111951240.5455-100000 at athena.fata.unam.mx>
| Content-Type: TEXT/PLAIN; charset=US-ASCII
|
| Take a look at the aqua binary of Tcl/Tk at
|
| http://www.apple.com/downloads/macosx/unix_open_source/
|
|
| Or you could try with the R binary of Jan de Leeuw (which includes
Tcl/Tk)
| at
|
| http://gifi.stat.ucla.edu/pub/
|
| Regards.
|
|
| On Sun, 11 Jul 2004, White, Charles E WRAIR-Wash DC wrote:
|
| > It is my understanding that Tcl/Tk does not come with the base
installation of R under OS X (
http://www.sciviews.org/_rgui/projects/TclTk.html). Is there a simple
way to explain how a user with limited tolerance for computer complexity
can obtain and install Tcl/Tk for OS X?
| >
| > Thanks.
| >
| > Chuck
| >
| > Background: Roughly a third of my target audience uses OS X. I do
not and I do not have access to a machine I could use as a development
platform.
| >
| > Charles E. White, Senior Biostatistician, MS
| > Walter Reed Army Institute of Research
| > 503 Robert Grant Ave., Room 1w102
| > Silver Spring, MD 20910-1557
| > 301 319-9781
| > Personal/Professional Site:
http://users.starpower.net/cwhite571/professional/
| >
| >
| > [[alternative HTML version deleted]]
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
| >
|
| -- 
| Ulises M. Alvarez
| LAB. DE ONDAS DE CHOQUE
| FISICA APLICADA Y TECNOLOGIA AVANZADA
| UNAM
| umalvarez at fata.unam.mx
|
|
|
| ------------------------------
|
| Message: 27
| Date: Sun, 11 Jul 2004 22:22:32 -0400
| From: Duncan Murdoch <dmurdoch at pair.com>
| Subject: Re: [R] Creating a minimal package (was: where does R search
| when source()?)
| To: Gabor Grothendieck <ggrothendieck at myway.com>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <ebr3f098aho62muqapebiplkh1n3prf7et at 4ax.com>
| Content-Type: text/plain; charset=us-ascii
|
| Thanks for the information.  It *should* be that simple; thanks for
| pointing out ways in which it is not.
|
| Some more specific comments below...
|
| On Sun, 11 Jul 2004 21:28:44 +0000 (UTC), Gabor Grothendieck
| <ggrothendieck at myway.com> wrote:
|
| >Duncan Murdoch <dmurdoch <at> pair.com> writes:
| >
| >:
| >: On Sun, 11 Jul 2004 05:40:33 +0000 (UTC), Gabor Grothendieck
| >: <ggrothendieck <at> myway.com> wrote:
| >:
| >: >Roger,
| >: >
| >: >A list of the steps referred to below would be of interest.
| >: >I realize the extensions manual exists but what I was
| >: >thinking of was just a list of the minimal steps you take
| >: >when you create a package for yourself.
| >:
| >: There's really just one step: call package.skeleton().
| >:
| >: Duncan Murdoch
| >
| >I was hoping for something that really was that simple but
| >I tried and so far it seems that I also must also
| >
| >1. when I run skeleton.package realize that I must use the arg
| >   path = "library"
| >   The example that is shown there appears to omit that.
|
| The default is to put it in the current directory.  The assumption is
| that you started R where you want to work, or have switched to that
| directory later.  This is usually true for Unix users, but generally
| not for Windows users.
|
| I'm not sure what sort of change to make here.  path = "library"
| (literally) won't usually work, because it won't try to create the
| directory.  Suggestion?
|
| >2. download and install tools.zip, perl and windows help as listed
at:
| >
| >   http://www.murdoch-sutherland.com/Rtools/
| >
| >I got tripped up for quite a while when it could not find hhc.exe and
| >I finally realized I had not downloaded the windows help
distribution.
|
| Something I've meant to do for a long time (and got started on, once)
| is to write a program that checks your system for the package building
| requirements.  Just run it, and it'll tell you what it thinks is
| missing (and how to find it).
|
| >3. change the name of the package in the DESCRIPTION file -- it seems
| >that the name = arg on package.skeleton did not change it for me.
|
| Sounds like an oversight to me, but very easy to fix.
|
| >4. make changes to the documentation files.  I am just working on
this
| >now.  Some default null documentation exists but it appears that it
| >MUST be modified in order to get a working package so this makes
another
| >step.
|
| Should also be pretty easy to fix...
| >
| >There maybe other things but its taken me several hours just to get
| >this far and I do not yet have a functioning package.
| >
| >I think it would be handy if everything you need to know to actually
| >create a minimal functioning package were in ?skeleton.package
| >so that one could create a minimal functioning package without
actually
| >reading the extensions manual and then incrementally improve it.
Right
| >now there is quite a bit you have to know just to get to that point.
|
| That's a good point.  I think we're moving towards a point where Perl
| won't be necessary; the other tools are mostly reasonably small, and I
| think we could set things up so that the install process worked with
| or without HHC.
|
| >I have so far looked at skeleton.package, readme.packages in rw1091,
| >murdoch-suthertherland.com link mentioned above and the extensions
manual
| >so the startup to doing this is really a multi-step complex process.
|
| >The skeleton.package idea actually seems quite nifty but I think it
| >needs more work before one can really claim that its a one-step
process
| >to create the example package.
|
|
|
| ------------------------------
|
| Message: 28
| Date: Mon, 12 Jul 2004 04:32:55 +0000 (UTC)
| From: Gabor Grothendieck <ggrothendieck at myway.com>
| Subject: Re: [R] Creating a minimal package (was: where does R search
| when source()?)
| To: r-help at stat.math.ethz.ch
| Message-ID: <loom.20040712T055834-547 at post.gmane.org>
| Content-Type: text/plain; charset=us-ascii
|
| Duncan Murdoch <dmurdoch <at> pair.com> writes:
|
| : On Sun, 11 Jul 2004 21:28:44 +0000 (UTC), Gabor Grothendieck
| : <ggrothendieck <at> myway.com> wrote:
| :
|
| : >1. when I run skeleton.package realize that I must use the arg
| : >   path = "library"
| : >   The example that is shown there appears to omit that.
| :
| : The default is to put it in the current directory.  The assumption
is
| : that you started R where you want to work, or have switched to that
| : directory later.  This is usually true for Unix users, but generally
| : not for Windows users.
| :
| : I'm not sure what sort of change to make here.  path = "library"
| : (literally) won't usually work, because it won't try to create the
| : directory.  Suggestion?
|
| Perhaps we could use:
|
|    path = .libPaths()[[1]]
|
| as the default value of path in package.skeleton.
|
|
|
| ------------------------------
|
| Message: 29
| Date: Mon, 12 Jul 2004 18:23:12 +1200 (NZST)
| From: "Richard A. O'Keefe" <ok at cs.otago.ac.nz>
| Subject: [R] Association between discrete and continuous variable
| To: r-help at stat.math.ethz.ch
| Message-ID: <200407120623.i6C6NChO415915 at atlas.otago.ac.nz>
|
| What's the reommended way, in R, to determine the strength of
| association between a discrete variable and a continuous variable?
|
| Yes, I have read the manuals, trawled the archives, &c.
|
|
|
| ------------------------------
|
| Message: 30
| Date: Mon, 12 Jul 2004 08:43:46 +0200
| From: Uwe Ligges <ligges at statistik.uni-dortmund.de>
| Subject: Re: [R] Creating a minimal package
| To: Gabor Grothendieck <ggrothendieck at myway.com>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <40F23322.6010809 at statistik.uni-dortmund.de>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| Gabor Grothendieck wrote:
|
| > Duncan Murdoch <dmurdoch <at> pair.com> writes:
| >
| > : On Sun, 11 Jul 2004 21:28:44 +0000 (UTC), Gabor Grothendieck
| > : <ggrothendieck <at> myway.com> wrote:
| > :
| >
| > : >1. when I run skeleton.package realize that I must use the arg
| > : >   path = "library"
| > : >   The example that is shown there appears to omit that.
| > :
| > : The default is to put it in the current directory.  The assumption
is
| > : that you started R where you want to work, or have switched to
that
| > : directory later.  This is usually true for Unix users, but
generally
| > : not for Windows users.
| > :
| > : I'm not sure what sort of change to make here.  path = "library"
| > : (literally) won't usually work, because it won't try to create the
| > : directory.  Suggestion?
| >
| > Perhaps we could use:
| >
| >    path = .libPaths()[[1]]
| >
| > as the default value of path in package.skeleton.
|
| Actually, that's a bad idea, because you don't want a source package
in
| your binary library tree.
| I'm really happy with the default and the documentation which tells us
| about the "path" argument. Most (all?) functions I know do write to
the
| current working directory. You do not want another default for
| write.table() et al. to write the data to, do you?
|
| Uwe Ligges
|
|
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
|
|
|
| ------------------------------
|
| Message: 31
| Date: Mon, 12 Jul 2004 03:40:33 -0400
| From: Jonathan Baron <baron at psych.upenn.edu>
| Subject: Re: [R] Association between discrete and continuous variable
| To: "Richard A. O'Keefe" <ok at cs.otago.ac.nz>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <20040712074033.GA95 at psych>
| Content-Type: text/plain; charset=us-ascii
|
| On 07/12/04 18:23, Richard A. O'Keefe wrote:
| >What's the reommended way, in R, to determine the strength of
| >association between a discrete variable and a continuous variable?
|
| Analysis of variance?  aov()?  R^2?
|
| It seems to me, though, that there are many possible answers, and
| this really doesn't have much to do with R because R could
| implement them all.  It may matter whether the discrete variable
| is ordered or not, whether it is fixed or random, what the error
| distributions of the continuous variable look like, what measures
| of association are traditional in your field, etc. etc.
|
| Jon
| -- 
| Jonathan Baron, Professor of Psychology, University of Pennsylvania
| Home page:            http://www.sas.upenn.edu/~baron
| R search page:        http://finzi.psych.upenn.edu/
|
|
|
| ------------------------------
|
| Message: 32
| Date: Mon, 12 Jul 2004 00:50:58 -0700 (PDT)
| From: Jacob Wegelin <jawegelin at ucdavis.edu>
| Subject: [R] lme unequal random-effects variances varIdent pdMat
| Pinheiro Bates nlme
| To: r-help at stat.math.ethz.ch
| Message-ID: <Pine.OSX.4.53.0407101928480.2644 at biostat5.ucdavis.edu>
| Content-Type: TEXT/PLAIN; charset=US-ASCII
|
|
| How does one implement a likelihood-ratio test, to test whether the
| variances of the random effects differ between two groups of subjects?
|
| Suppose your data consist of repeated measures on subjects belonging
to
| two groups, say boys and girls, and you are fitting a linear
mixed-effects
| model for the response as a function of time.  The within-subject
errors
| (residuals) have the same variance in both groups. But the dispersion
of
| the random effects differs between the groups.  The boys' random
effects
| -- say, the intercepts -- have greater variance than the girls'.  One
can
| see this by partitioning the data by sex and fitting two separate
models.
|
| The model for the girls,
|
| library("nlme")
| mylmeF0 <- lme( y ~ time, data=DAT, random=~time | id,
subset=sex=="F")
|
| yields a variance of about one for the random intercepts:
|
|             StdDev    Corr
| (Intercept) 0.9765052 (Intr)
| time        0.1121913 -0.254
| Residual    0.1806528
|
| whereas in the model for the boys, the corresponding variance is ten
times
| that amount:
|
| mylmeM0 <- lme( y ~ time, data=DAT, random=~time | id,
subset=sex=="M")
|
|             StdDev     Corr
| (Intercept) 10.1537946 (Intr)
| time         0.1230063 -0.744
| Residual     0.1298910
|
| I would like to use a likelihood ratio to test this difference.  The
| smaller ("null") model would be
|
| mylme0 <- lme( y ~ time, data=DAT, random=~time | id )  .
|
| This model forces the random intercepts for both boys and girls to
come
| from a single normal distribution.
|
| The larger model would allow the boys' and girls' random intercepts
(or
| more generally their random effects) to come from separate normal
| distributions with possibly unequal variances.
|
| There must be some straightforward obvious way to fit the larger
model,
| but I do not see it.
|
| Pinheiro and Bates, chapter 5.2, show how to model unequal *residual*
| ("within-group") variances for the two groups using varIdent.  They
also
| tantalizingly say, "The single-level variance function model (5.10)
can be
| generalized to multilevel models" (page 206), which seems to suggest
that
| a solution to the current problem might exist.
|
| The pdMat classes provide a way to *constrain* the dispersion matrix
of
| the random effects, not make it more general.
|
| Of course, one way to test for unequal variances is to apply an F-test
for
| equal variances to the random intercepts. If the data are as shown at
the
| bottom of this email, the test can be implemented as follows:
|
| stuff<-as.data.frame(summary(mylme0)$coefficients$random$id)
| stuff$sex<-factor(substring(row.names(stuff), 1,1))
| mysplit<-split(stuff[,"(Intercept)"], stuff[,"sex"])
| ns<-sapply(mysplit, length)
| vars<-sapply(mysplit, var)
| p<- 1-pf( vars["M"]/vars["F"], ns["M"]-1, ns["F"]-1)
|
| Alternatively, one could implement a permutation test for the ratio of
the
| variances of the random intercepts--these variances derived from the
two
| halves of the partitioned data.
|
| But surely there's a direct, model-based way to do this?
|
| Thanks for any suggestions
|
| Jake
|
| P.S. Here is the code by which the "data" were generated.
|
| nb<-1
| ntimepts<-3
| girls<-data.frame(
| y= rep(-nb:nb , each=ntimepts)
| ,
| id=rep( paste("F", 1:(2*nb+1), sep=""), each=ntimepts)
| ,
| time=rep(1:(2*nb+1), length=ntimepts)
| )
| boys <-data.frame(
| y= rep(10*(-nb:nb) , each=ntimepts)
| ,
| id=rep( paste("M", 1:(2*nb+1), sep=""), each=ntimepts)
| ,
| time=rep(1:(2*nb+1), length=ntimepts)
| )
| DAT<-rbind(girls,boys)
| DAT$y<-DAT$y + rnorm(nrow(DAT))/5
| DAT$sex<-factor(substring( as.character(DAT[,"id"]), 1,1))
| row.names(DAT)<-paste( DAT[,"id"], DAT[,"time"], sep=".")
|
| Jacob A. Wegelin
| Assistant Professor
| Division of Biostatistics, School of Medicine
| University of California, Davis
| One Shields Ave, TB-168
| Davis CA 95616-8638 USA
| http://wegelin.ucdavis.edu/
| jawegelin at ucdavis.edu
|
|
|
| ------------------------------
|
| Message: 33
| Date: Mon, 12 Jul 2004 20:52:03 +1200
| From: Murray Jorgensen <maj at stats.waikato.ac.nz>
| Subject: Re: [R] Association between discrete and continuous variable
| To: "Richard A. O'Keefe" <ok at cs.otago.ac.nz>
| Cc: r-help at stat.math.ethz.ch
| Message-ID: <40F25133.6030207 at stats.waikato.ac.nz>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| I'm wondering if mutual information al la Cover & Thomas (1991, Ch 2)
is
| not the killer association measure for all types of random variables?
|
| Murray Jorgensen
|
| PS  Yes, this is probably OT!
|
| Richard A. O'Keefe wrote:
| > What's the reommended way, in R, to determine the strength of
| > association between a discrete variable and a continuous variable?
| >
| > Yes, I have read the manuals, trawled the archives, &c.
| >
| > ______________________________________________
| > R-help at stat.math.ethz.ch mailing list
| > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| > PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
| >
| >
|
| -- 
| Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
| Department of Statistics, University of Waikato, Hamilton, New Zealand
| Email: maj at waikato.ac.nz                                Fax 7 838 4155
| Phone  +64 7 838 4773 wk    +64 7 849 6486 home    Mobile 021 1395 862
|
|
|
| ------------------------------
|
| Message: 34
| Date: Mon, 12 Jul 2004 21:00:44 +1200
| From: Murray Jorgensen <maj at stats.waikato.ac.nz>
| Subject: [R] Nested source()s
| To: R-help <r-help at stat.math.ethz.ch>
| Message-ID: <40F2533C.9080709 at stats.waikato.ac.nz>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| I had an error message while running a macro from Yudi Pawitan's web
site:
|
|  > source("ex2-13.r")
| Error in parse(file, n, text, prompt) : syntax error on line 2
|
| Inspecting ex2-13.r I found that the error was generated by another
| source() command.
|
| Clearly R does not like nested source()s, which is fair enough when
you
| think about it. Still it's something that you might want to do. Does
| anyone know how to get achieve the substance of what nested source()
| commands would give you?
|
| Murray Jorgensen
|
| -- 
| Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
| Department of Statistics, University of Waikato, Hamilton, New Zealand
| Email: maj at waikato.ac.nz                                Fax 7 838 4155
| Phone  +64 7 838 4773 wk    +64 7 849 6486 home    Mobile 021 1395 862
|
|
|
| ------------------------------
|
| Message: 35
| Date: Mon, 12 Jul 2004 11:25:37 +0200
| From: Christoph Lehmann <christoph.lehmann at gmx.ch>
| Subject: [R] pixmapIndexed color question
| To: r-help at stat.math.ethz.ch
| Message-ID: <40F25911.3070607 at gmx.ch>
| Content-Type: text/plain; charset=us-ascii; format=flowed
|
| Hi
|
| I use pixmapIndexed
|
| tmp.vimp <- array(0,c(x.dim,y.dim))
| tmp.vimp <- pixmapIndexed(tmp.vimp, col=rainbow)
|
| to plot values of a 2D matrix. I 'fill' the pixmapIndexed like:
|
|      for (x in 1:x.dim) {
|          for (y in 1:y.dim) {
|                      tmp.vimp at index[x,y] <- my.matrix[x,y]
|      }}
|
|
| how can I define, that the colors are painted e.g. according the
rainbow
| palette?
|
| plot(tmp.vimp) paints all 'pixels' in red even though I specified it
| with col=rainbow (see above)
|
| many thanks
|
| cheers
|
| christoph
|
| p.s. is there an easier method for 'painting' the values of a 2d
matrix?
|
|
|
| ------------------------------
|
| _______________________________________________
| R-help at stat.math.ethz.ch mailing list
| https://www.stat.math.ethz.ch/mailman/listinfo/r-help
| PLEASE read the posting guide!
http://www.R-project.org/posting-guide.html
|
|
| End of R-help Digest, Vol 17, Issue 11
| **************************************
|




More information about the R-help mailing list