Re: [Rd] paths for install and libraries?

2016-04-29 Thread Martin Maechler
> Dalthorp, Daniel 
> on Thu, 28 Apr 2016 16:41:28 -0700 writes:

> I've written a fairly elaborate package (called "eoa")
> that relies on functions from several other packages. I've
> built the package into a zip file on Windows using
> Hadley's devtools::build(binary = T) and have sent the zip
> to a couple dozen people for testing. My package installs
> fine, but some people are having trouble loading it. After
> library(eoa), they get something like:

> Error: could not load package tcltk2

> In DESCRIPTION file, I use

> Depends: tcltk, tcltk2, tkrplot 
> Imports: actuar, graphics, gsl, MASS, Matrix, tensorA

> If, after getting the "could not load" message, the user
> installs the required packages by hand, everything works
> fine.

> My understanding was that both the "Depends: " and the
> "Imports: " lines in DESCRIPTION file direct R to
> automatically install required packages that haven't been
> previously installed.


All package installation happens via  install.packages(),
at least eventually.

If you look at the help page for that, it has always said that it
does not (as it cannot easily, in general!!) look at
dependencies when you do not install from a repository.

This question would clearly have belonged to R-help, not R-devel.
I'm CC ing to the help list and am asking all follow-ups to go
*only* to R-help, please.

Martin

> It doesn't appear to be working that way for me. There
> must be a simple solution that I am obviously missing

> Any help would be greatly appreciated!



> -Dan

> -- 
> Dan Dalthorp, PhD USGS Forest and Rangeland Ecosystem
> Science Center Forest Sciences Lab, Rm 189 3200 SW
> Jefferson Way Corvallis, OR 97331 ph: 541-750-0953
> ddalth...@usgs.gov

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] boxplot with formula involving two-factor levels

2016-04-29 Thread diy
Hi,

I noticed two seemingly equivalent call to boxplot will give different plots 
(in the way how the combined factor levels are arranged on the x-axis): 

x = factor(rep(c("a", "b", "c"), each=2));
y = rep(factor(c("one", "two")), each=3);
r = 3;
n = r * 6;
x = rep(x, 3);
y = rep(y, 3);
z = rnorm(n);

par(mfrow=c(2,1));

## The following two seeming equivalent calls to boxplot give different results
boxplot(z~x:y);

f = x:y;
boxplot(z~f);

This is puzzling to me. Is this normal? 

Thanks!

Best,
Yanming
[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] paths for install and libraries?

2016-04-29 Thread Dirk Eddelbuettel

On 28 April 2016 at 16:41, Dalthorp, Daniel wrote:
| I've written a fairly elaborate package (called "eoa") that relies on
| functions from several other packages. I've built the package into a zip
| file on Windows using Hadley's devtools::build(binary = T) and have sent
| the zip to a couple dozen people for testing. My package installs fine, but
| some people are having trouble loading it. After library(eoa), they get
| something like:
| 
| Error: could not load package tcltk2
| 
| In DESCRIPTION file, I use
| 
| Depends: tcltk, tcltk2, tkrplot
| Imports: actuar,
| graphics,
| gsl,
| MASS,
| Matrix,
| tensorA
| 
| If, after getting the "could not load" message, the user installs the
| required packages by hand, everything works fine.
| 
| My understanding was that both the "Depends: " and the "Imports: " lines in
| DESCRIPTION file direct R to automatically install required packages that
| haven't been previously installed.
| 
| It doesn't appear to be working that way for me. There must be a simple
| solution that I am obviously missing

I think this would work if you users installed from a _repository_ rather
than a single zip file. So in a sense I feat it is a flaw in the setup you
provided.

You can build repositories, both local / private and visible / public, using
the drat package:  http://dirk.eddelbuettel.com/code/drat.html, also on CRAN.

Else, just have them execute a helper script you devise

Dirk
 
| Any help would  be greatly appreciated!
| 
| -Dan
| 
| -- 
| Dan Dalthorp, PhD
| USGS Forest and Rangeland Ecosystem Science Center
| Forest Sciences Lab, Rm 189
| 3200 SW Jefferson Way
| Corvallis, OR 97331
| ph: 541-750-0953
| ddalth...@usgs.gov
| 
|   [[alternative HTML version deleted]]
| 
| __
| R-devel@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] boxplot with formula involving two-factor levels

2016-04-29 Thread peter dalgaard

> On 29 Apr 2016, at 23:54 , d...@stat.oregonstate.edu wrote:
> 
> Hi,
> 
> I noticed two seemingly equivalent call to boxplot will give different plots 
> (in the way how the combined factor levels are arranged on the x-axis): 
> 
> x = factor(rep(c("a", "b", "c"), each=2));
> y = rep(factor(c("one", "two")), each=3);
> r = 3;
> n = r * 6;
> x = rep(x, 3);
> y = rep(y, 3);
> z = rnorm(n);
> 
> par(mfrow=c(2,1));
> 
> ## The following two seeming equivalent calls to boxplot give different 
> results
> boxplot(z~x:y);
> 
> f = x:y;
> boxplot(z~f);
> 
> This is puzzling to me. Is this normal? 

Normal, but a little odd. The root cause is the difference between x:y and 
interaction(x,y), documented on the help page for the latter.

-pd


> Thanks!
> 
> Best,
> Yanming
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel