Hi,
Here are a couple of suggestions:
-- Start R without loading startup scripts etc. (R --vanilla) and see
if it works. If yes, there is something loading in your startup file
or restored environment that is causing problems.
-- Upgrade to the latest version of R
HTH,
Ista
On Wed, Nov 10, 2010 at 2:51 PM, zhenjiang xu <zhenjiang.xu at gmail.com>
wrote:> Hi all,
>
> When running R interactively, I have the problem as following:
>
>> library(ggplot2)
> Loading required package: reshape
> Loading required package: plyr
>
> Attaching package: 'reshape'
>
> The following object(s) are masked from 'package:plyr':
>
> ? ?round_any
>
> Loading required package: grid
> Loading required package: proto
>
>> data(VADeaths)
>> pg <- ggplot(melt(VADeaths), aes(value, X1)) + geom_point() +
> + facet_wrap(~X2) + ylab("")
>> print(pg)
> Error in get("transform", env = ., inherits = TRUE)(., ...) :
> ?attempt to apply non-function
>
> My R package information is :
>> library(plyr)
>> sessionInfo()
> R version 2.11.1 (2010-05-31)
> x86_64-pc-linux-gnu
>
> locale:
> ?[1] LC_CTYPE=zh_CN.UTF-8 ? ? ? LC_NUMERIC=C
> ?[3] LC_TIME=en_US.UTF-8 ? ? ? ?LC_COLLATE=en_US.UTF-8
> ?[5] LC_MONETARY=C ? ? ? ? ? ? ?LC_MESSAGES=en_US.UTF-8
> ?[7] LC_PAPER=en_US.UTF-8 ? ? ? LC_NAME=C
> ?[9] LC_ADDRESS=C ? ? ? ? ? ? ? LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] grid ? ? ?stats ? ? graphics ?grDevices utils ? ? datasets ?methods
> [8] base
>
> other attached packages:
> [1] lattice_0.18-8 ggplot2_0.8.8 ?proto_0.3-8 ? ?reshape_0.8.3 ?plyr_1.2.1
>
>
> loaded via a namespace (and not attached):
> [1] tools_2.11.1
>
>
> The interesting thing is that when I put the codes into an R script, and
run
> with command "R CMD BATCH XX.R", it works alright. Does anyone
have any idea
> what the problem is? Thanks~
> --
> Best,
> Zhenjiang
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.
>
--
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org