The example works fine for me. I am using the same version of R (2.9.2) from
the Ubuntu 9.10 AMD-64 repositories and plm version 1.2-3 downloaded from
CRAN.

One point. The plm help example loads the "Produc" dataset from the package
"plm" and not the package "Ecdat". Though I can get the example to run with
Ecdat 0.1-5 as well.

Jyotirmoy Bhattacharya

On Thu, Mar 11, 2010 at 4:30 AM, Stephen J. Barr <stephenjbarr@gmail.com>wrote:

> Hello,
>
> Apologies in advance if this is a stupid question. I am running R on Ubuntu
> 9.
>
> R version 2.9.2 (2009-08-24)
>
> I am trying to work with plm. I think the library is installed, as I can do
>
> > library(plm)
> Loading required package: kinship
> Loading required package: survival
> Loading required package: splines
> Loading required package: nlme
> Loading required package: lattice
> [1] "kinship is loaded"
> Loading required package: Formula
> Loading required package: MASS
> Loading required package: sandwich
> Loading required package: zoo
>
> Attaching package: 'zoo'
>
>
> The following object(s) are masked from package:base :
>
>  as.Date.numeric
>
> >
>
> which seems reasonable. However, it fails running the included example in
> the help.
>
> >     data("Produc", package="Ecdat")
> >      zz <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc,
> index=c("state","year"))
> Error in do.call("~", list(firstpart, as.name(i))) :
>  object 'firstpart' not found
> In addition: Warning messages:
> 1: In if (length(formula) == 2) formula <- expand.formula(formula) :
>  the condition has length > 1 and only the first element will be used
> 2: In if (length(formula) == 1) part = "first" :
>  the condition has length > 1 and only the first element will be used
> 3: In if (length(formula) == 2) part = "both" :
>  the condition has length > 1 and only the first element will be used
> 4: In if (length(x) == 1) { :
>  the condition has length > 1 and only the first element will be used
> 5: In if (length(x) == 2) { :
>  the condition has length > 1 and only the first element will be used
>
> At first I thought it was my code that was causing the error, but if it is
> failing on the example from the ?plm page, then I figured I should start
> there. Any suggestions?
>
> Thank you,
> -stephen
>
>        [[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.
>

	[[alternative HTML version deleted]]

