Re: [R] Help with lme Random Factor

2005-03-09 Thread Andrew Robinson
Hello Andrew,

I strongly suggest that you obtain a copy of the book that documents the use of 
the package, and read it.  

Mixed Effects Models in S and S-Plus
by Jose C. Pinheiro and Douglas M. Bates  Springer Verlag 2000.

I hope that this helps,

Andrew


- Original Message -
From: Andrew James Amacher <[EMAIL PROTECTED]>
Date: Wednesday, March 9, 2005 4:19 pm
Subject: [R] Help with lme Random Factor

> Hi,
> 
> I need help creating a code for a multiple BACI design (Before-After
> Control-Impact) ANOVA.  I'm new to R and basically need to run a 
> complexmixed model ANOVA that treats location as a random factor.
> 
> Data are from a fire experiment, run 2001-2004 (2 years pre, 2 years
> post).  Response is bird abundance.  4 Treatments had 3 replicates 
> each(forest stands): 1. Control, 2. Prescribed fire only, 3. 
> Timber harvesting
> only, and 4. Fire and harvesting.
> 
> Basically, I'm having trouble figuring out the code that makes the
> variable "LOC" a random factor.
> 
> Also, I'm having trouble figuring out how to script contrasts 
> comparingthe treatments to the control (multiple comparisons w/ a 
> control). 
> Treatment group is not a part of the lme script.  Do I need to run 
> themeach individually, i.e. C vs. T1, C vs. T2, C vs T3? or can I 
> code in
> treatment contrasts?
> 
> Script (used S-plus GUI to build it):
> 
> GCKI~.+C+B+LOC%in%C+T%in%B+C:B+C:T%in%B+LOC%in%C:B+LOC%in%C:T%in%B
> **unsure what goes here to make LOC random
> 
> Terms:
> 
> GCKI: Golden-crowned kinglet abundance.
> 
> C:  Control-Impact (2 levels, either control (no treatment), or impact
> (received treatment after 2 years)
> 
> B: Before-After (2 levels, 2001-2002 = Before, 2003-2004 = After)
> 
> T: Time, 4 levels, years 2001, 2002, 2003, 2004
> 
> LOC: location, 3 replicates in among the 4 treatments (RANDOM FACTOR)
> 
> 
> Sorry to write so much, but any help would be appreciated.  The ANOVA
> model comes from a book: Monitoring Ecological Impacts: Downes et al.
> 2002.
> 
> I am used to running GUIs, but it appears I need to script this 
> ANOVA.  I
> am unfamiliar with random factor scripts or scripts for multiple 
> contrastswith controls.
> 
> Cheers,
> 
> Andrew
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-
> guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] urgent request

2005-03-09 Thread h0394018
Hi guys,
I want to do weighted conditional logistic regression, but clogit do not accept
weights. Would you tell me whether there are any ways to do this?
Thanks a lot in advance,
Spring

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] about kpss.test()

2005-03-09 Thread Weiguang Shi

 --- Achim Zeileis <[EMAIL PROTECTED]>
wrote: 
> > First of all, could you tell me what the "KPSS
> Level" 
> > in the output of the test means?
Thanks. But I meant to also ask about the number after

that, e.g., 
KPSS Level = 0.0027

> 
> Please check the references of kpss.test or any book
> on economectric
> time series analysis for which alternatives the KPSS
> test was designed.
Will soon do.

> Hint: it's not designed for detecting cyclical
> variations.
OK. I guess there must be some pre-requisite on the 
data before kpss-ing it.

Thanks
Weiguang

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RMySQL installed but not availalable

2005-03-09 Thread Adriano von Sydow
Thanks Arne,
that was spot on.
Cheers,
Popolito
Arne Henningsen wrote:
Did you _load_ the package?
R> library( RMySQL )
On Thursday 10 March 2005 10:12, Adriano von Sydow wrote:
 

Hi
I run Linux SuSE 9.1, with MSQL 4.0.18
I installed R 2.0.1 and it is working fine
I installed RM 0.5-5 package and verified all installed.packages (see
below) but when I tried to use any RMySQL specific comand is gives me
the same error messages
> dbConnect
Error: Object "dbConnect" not found
It looks like the  packages is not installed
Any ideas or help would be welcome
Thanks,
Popolito
*** INSTALL *
ginossauro:/home/avonsydow/Download/Stats # R CMD INSTALL
RMySQL_0.5-5.tar.gz
* Installing *source* package 'RMySQL' ...
creating cache ./config.cache
checking how to run the C preprocessor... cc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... yes
checking for mysql.h... no
checking for /usr/local/include/mysql/mysql.h... no
checking for /usr/include/mysql/mysql.h... yes
updating cache ./config.cache
creating ./config.status
creating src/Makevars
** libs
gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include
-I/opt/gnome/
include   -fPIC   -c RS-DBI.c -o RS-DBI.o
gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include
-I/opt/gnome/
include   -fPIC   -c RS-MySQL.c -o RS-MySQL.o
gcc -shared -L/usr/local/lib -L/opt/gnome/lib -o RMySQL.so RS-DBI.o
RS-MySQL.o -
lmysqlclient -lz  -L/usr/lib/R/lib -lR
** R
** inst
** save image
Loading required package: DBI
[1] "dbObjectId"
[1] "format"
[1] "show"
[1] "print"
[1] "MySQLObject"
[1] "MySQLDriver"
[1] "dbUnloadDriver"
[1] "dbGetInfo"
[1] "dbListConnections"
[1] "summary"
[1] "MySQLConnection"
[1] "dbConnect"
[1] "dbConnect"
[1] "dbConnect"
[1] "dbDisconnect"
[1] "dbSendQuery"
[1] "dbGetQuery"
[1] "dbGetException"
[1] "dbGetInfo"
[1] "dbListResults"
[1] "summary"
[1] "dbListTables"
[1] "dbReadTable"
[1] "dbWriteTable"
[1] "dbExistsTable"
[1] "dbRemoveTable"
[1] "dbListFields"
[1] "dbCommit"
[1] "dbRollback"
[1] "dbCallProc"
[1] "MySQLResult"
[1] "dbClearResult"
[1] "fetch"
[1] "fetch"
[1] "dbGetInfo"
[1] "dbGetStatement"
[1] "dbListFields"
[1] "dbColumnInfo"
[1] "dbGetRowsAffected"
[1] "dbGetRowCount"
[1] "dbHasCompleted"
[1] "dbGetException"
[1] "summary"
[1] "dbDataType"
[1] "make.db.names"
[1] "SQLKeywords"
[1] "isSQLKeyword"
[1] "dbApply"
[1] "dbApply"
** help
>>> Building/Updating help pages for package 'RMySQL'
Formats: text html latex example
 MySQL texthtmllatex   example
 MySQLConnection-class texthtmllatex   example
 MySQLDriver-class texthtmllatex   example
 MySQLObject-class texthtmllatex   example
 MySQLResult-class texthtmllatex   example
 S4R   texthtmllatex
 dbApply-methods   texthtmllatex   example
 dbApply   texthtmllatex   example
 dbCallProc-methodstexthtmllatex
 dbCommit-methods  texthtmllatex   example
 dbConnect-methods texthtmllatex   example
 dbDataType-methodstexthtmllatex   example
 dbDriver-methods  texthtmllatex   example
 dbGetInfo-methods texthtmllatex   example
 dbListTables-methods  texthtmllatex   example
 dbObjectId-class  texthtmllatex   example
 dbReadTable-methods   texthtmllatex   example
 dbSendQuery-methods   texthtmllatex   example
 dbSetDataMappings-methods texthtmllatex   example
 fetch-methods texthtmllatex   example
 isIdCurrent   texthtmllatex   example
 make.db.names-methods texthtmllatex   example
 mysqlDBApply  texthtmllatex   example
 mysqlSupport  texthtmllatex
 safe.writetexthtmllatex   example
 summary-methods   texthtmllatex
* DONE (RMySQL)

*INSTALLED.PACKAGES ***
> installed.packages()
  Package  LibPath  Version   Priority  Bundle
base   "base"   "/usr/lib/R/library" "2.0.1"   "base"NA
boot   "boot"   "/usr/lib/R/library" "1.2-20"  "recommended" NA
class  "class"  "/usr/lib/R/library" "7.2-10"  "recommended" "VR"
cluster"cluster""/usr/lib/R/library" "1.9.6"   "recommended" NA
datasets   "datasets"   "/usr/lib/R/library" "2.0.1"   "base"NA
DBI"DBI""/usr/lib/R/library" "0.1-8"   NANA
foreign"foreign""/usr/lib/R/library" "0.8-0"   "recommended" NA
graphics   "graphics"   "/usr/lib/R/library" "2.0.1"   "base"NA
grDevices  "grDevices"  "/usr/lib/R/library" "2.0.1"   "ba

Re: [R] Multidimensional Scaling (MDS) in R

2005-03-09 Thread Jari Oksanen
This nmds seems to be the wrapper function in the labdsv package. 
Please check the documentation in that package. If I remember 
correctly, labdsv is geared for cases with large number of points, and 
then you don't want to get labels because they would be too congested 
to be seen anyway. The recommended procedure is to identify interesting 
points using 'plotid' function in labdsv.

Function nmds is a very simple wrapper: it uses isoMDS in the MASS 
package, and adds class and some class methods. You may use isoMDS 
directly instead:

dis <- dsvdis(x) # Assuming you use labdsv
ord <- isoMDS(dis)
plot(ord$points, asp = 1, type="n")
text(ord$points, rownames(ord$points)
The posting guide tells  you to make package specific questions to the 
package author directly. In this case, the package author does not read 
R-News.

cheers, jari oksanen
On 8 Mar 2005, at 19:43, Isaac Waisberg wrote:
Hi;
I am working with the similarity matrix below and I would like to plot
a two-dimensional MDS solution such as each point in the plot has a
label.
This is what I did:
data <- read.table('c:/multivariate/mds/colour.txt',header=FALSE)
similarity <- as.dist(data)
distance <- 1-similarity
result.nmds <- nmds(distance)
plot(result.nmds)
(nmds and plot.nmds as defined at
labdsv.nr.usu.edu/splus_R/lab8/lab8.html; nmds simply calls isoMDS)
Colour.txt, containing the similaity matrix, reads as follows:
 1.0 .86 .42 .42 .18 .06 .07 .04 .02 .07 .09 .12 .13 .16
 .86 1.0 .50 .44 .22 .09 .07 .07 .02 .04 .07 .11 .13 .14
 .42 .50 1.0 .81 .47 .17 .10 .08 .02 .01 .02 .01 .05 .03
 .42 .44 .81 1.0 .54 .25 .10 .09 .02 .01 .01 .01 .02 .04
 .18 .22 .47 .54 1.0 .61 .31 .26 .07 .02 .02 .01 .02 .01
 .06 .09 .17 .25 .61 1.0 .62 .45 .14 .08 .02 .02 .02 .01
 .07 .07 .10 .10 .31 .62 1.0 .73 .22 .14 .05 .02 .02 .01
 .04 .07 .08 .09 .26 .45 .73 1.0 .33 .19 .04 .03 .02 .02
 .02 .02 .02 .02 .07 .14 .22 .33 1.0 .58 .37 .27 .20 .23
 .07 .04 .01 .01 .02 .08 .14 .19 .58 1.0 .74 .50 .41 .28
 .09 .07 .02 .01 .02 .02 .05 .04 .37 .74 1.0 .76 .62 .55
 .12 .11 .01 .01 .01 .02 .02 .03 .27 .50 .76 1.0 .85 .68
 .13 .13 .05 .02 .02 .02 .02 .02 .20 .41 .62 .85 1.0 .76
 .16 .14 .03 .04 .01 .01 .01 .02 .23 .28 .55 .68 .76 1.0
The first row corresponds to colour 1 (C1), the second to colour 2
(C2), and so on.
First, I'm not sure if this is correct or not. Second, obviously the
points in the plot are not labeled. I suppose I must add a labels
column and then print the labels together with the results. But, how
should I do it?
Many thanks,
Isaac
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

--
Jari Oksanen, Oulu, Finland
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How could I catch the R data-output stream and presented by other software func

2005-03-09 Thread Michael shen
Dear All R-helper,
I wonder to know that could I do the computation  staff in R environment and 
get the R data output stream ,then presented by other software functions in 
their GUI.(for example: get the R data output streamand present the data 
using SPSS function in SPSS output GUI). Is there some R -packages in CRAN 
already do this kind of function? and what kind of document should I read?

Thanks in advance
Michael
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] two-dimensional integration?

2005-03-09 Thread Nils-at-Duke Lid Hjort
I find the one-dimensional "integrate" very helpful,
but often enough I stumble into problems that require
two (or more)-dimensional integrals. I suppose there
are no R functions that can do this for me, "directly"?
The ideal thing would be to be able to define say
f <- function(x)
{
x1 <- x[1]
x2 <- x[2]
sin(x1*x2)*exp(x1-x2)
}
and then write say
integrate(f, xlim=c(0,1), ylim=c(0,1))  .
(a) No such thing exists, as of today, right?
(b) There *are* general numerical routines "out there"
for doing such things, right? (Importance sampling
or adaptive important sampling would often do the
job, but it would be difficult to find something that
"always" works -- at least in higher dimension?
Also, iterated one-dimensional integrations could
be attempted, but I find that messy, also because
things lose the g(many) = many(g) property, and
then R refuses to integrate g.)
(c) Will a thing like the above exist in R before
the Tromsoe Olympics in 2014? For which dimensions? 

Nils Lid Hjort
[Professor of statistics at Oslo, but currently at Duke]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Help :plotting 3d images

2005-03-09 Thread Lakshmi Dhevi Baskar
Hai All,
 
I am very new to R software.
I would like to get some help in plotting 3d images in surfaces. 
What packages can be used to generate these smooth surface of 3d images? 

 thanks 
lakshmi 



-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] from long/lat to UTM

2005-03-09 Thread Sander Oom
Hi Yyan,
The proj4R package by Roger Bivand will allow you to project data in 
many ways and directions.

http://spatial.nhh.no/R/Devel/proj4R-pkg.pdf
It uses the proj libraries from:
http://www.remotesensing.org/proj/
Not sure where you would derive the time zone!
Good luck,
Sander.
yyan liu wrote:
Hi:
  Is there any function in R which can convert the
long/lat to UTM(Universal Transverse Mercator)?
  There are quite a few converters on Internet.
However, the interface is designed as input->output
which I can not convert lots of locations at the same
time.
  Another question is whether there is a function in R
which can tell the time zone from the location's
lat/long?
  Thank you!
liu
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--

Dr. Sander P. Oom
Animal, Plant and Environmental Sciences,
University of the Witwatersrand
Private Bag 3, Wits 2050, South Africa
Tel (work)  +27 (0)11 717 64 04
Tel (home)  +27 (0)18 297 44 51
Fax +27 (0)18 299 24 64
Email   [EMAIL PROTECTED]
Web www.oomvanlieshout.net/sander
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to use a R package with C code

2005-03-09 Thread Duncan Murdoch
On Wed,  9 Mar 2005 18:54:36 -0500, [EMAIL PROTECTED] wrote :

>
>Hello, everybody,
>
>I created a R package which includes C code. But I load this package, and carry
>out the R function in it. It shows C function is not in load table as follows.
>Would you tell me what is the problem? Where do I make mistake?

You aren't giving enough information for anyone to know that.  You
need to tell us exactly what you did to create your package, and what
operating system you're on.

Duncan Murdoch
>
>Maggie
>
>
>
>[Previously saved workspace restored]
>
>> library(var)
>
>Attaching package 'var':
>
>
>The following object(s) are masked _by_ .GlobalEnv :
>
> b
>
>> wxt0124()
>Error in .C("wxt1221") : C function name not in load table
>
>__
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Help with lme Random Factor

2005-03-09 Thread Andrew James Amacher
Hi,

I need help creating a code for a multiple BACI design (Before-After
Control-Impact) ANOVA.  I'm new to R and basically need to run a complex
mixed model ANOVA that treats location as a random factor.

Data are from a fire experiment, run 2001-2004 (2 years pre, 2 years
post).  Response is bird abundance.  4 Treatments had 3 replicates each
(forest stands): 1. Control, 2. Prescribed fire only, 3. Timber harvesting
only, and 4. Fire and harvesting.

Basically, I'm having trouble figuring out the code that makes the
variable "LOC" a random factor.

Also, I'm having trouble figuring out how to script contrasts comparing
the treatments to the control (multiple comparisons w/ a control). 
Treatment group is not a part of the lme script.  Do I need to run them
each individually, i.e. C vs. T1, C vs. T2, C vs T3? or can I code in
treatment contrasts?

Script (used S-plus GUI to build it):

GCKI~.+C+B+LOC%in%C+T%in%B+C:B+C:T%in%B+LOC%in%C:B+LOC%in%C:T%in%B
**unsure what goes here to make LOC random

Terms:

GCKI: Golden-crowned kinglet abundance.

C:  Control-Impact (2 levels, either control (no treatment), or impact
(received treatment after 2 years)

B: Before-After (2 levels, 2001-2002 = Before, 2003-2004 = After)

T: Time, 4 levels, years 2001, 2002, 2003, 2004

LOC: location, 3 replicates in among the 4 treatments (RANDOM FACTOR)


Sorry to write so much, but any help would be appreciated.  The ANOVA
model comes from a book: Monitoring Ecological Impacts: Downes et al.
2002.

I am used to running GUIs, but it appears I need to script this ANOVA.  I
am unfamiliar with random factor scripts or scripts for multiple contrasts
with controls.

Cheers,

Andrew

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] install R redhat rpm as a normal user

2005-03-09 Thread Eric Hu
Hi, I wonder if anyone has done this before. I have rpm-build
installed in my workstation. Thanks.

Eric

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] contrast matrix for aov

2005-03-09 Thread Darren Weber
How do we specify a contrast interaction matrix for an ANOVA model?
We have a two-factor, repeated measures design, with
Cue Direction (2) x  Brain Hemisphere(2)
Each of these has 2 levels, 'left' and 'right', so it's a simple 2x2 design 
matrix.  We have 8 subjects in each cell (a balanced design) and we want to 
specify the interaction contrast so that:

CueLeft>CueRght for the Right Hemisphere
CueRght>CueLeft for the Left Hemisphere.
Here is a copy of the relevant commands for R:

lh_cueL <- rowMeans( LHroi.cueL[,t1:t2] )
lh_cueR <- rowMeans( LHroi.cueR[,t1:t2] )
rh_cueL <- rowMeans( RHroi.cueL[,t1:t2] )
rh_cueR <- rowMeans( RHroi.cueR[,t1:t2] )
roiValues <- c( lh_cueL, lh_cueR, rh_cueL, rh_cueR )
cuelabels <- c("CueLeft", "CueRight")
hemlabels <- c("LH", "RH")
roiDataframe <- data.frame( roi=roiValues, Subject=gl(8,1,32,subjectlabels), 
Hemisphere=gl(2,16,32,hemlabels), Cue=gl(2,8,32,cuelabels) )

roi.aov <- aov(roi ~ (Cue*Hemisphere) + Error(Subject/(Cue*Hemisphere)), 
data=roiDataframe)
print(summary(roi.aov))


I've tried to create a contrast matrix like this:
cm <- contrasts(roiDataframe$Cue)
which gives the main effect contrasts for the Cue factor.  I really want to 
specify the interaction contrasts, so I tried this:


# c( lh_cueL, lh_cueR, rh_cueL, rh_cueR )
# CueRight>CueLeft for the Left Hemisphere.
# CueLeft>CueRight for the Right Hemisphere
cm <- c(-1, 1, 1, -1)
dim(cm) <- c(2,2)
roi.aov <- aov( roi ~ (Cue*Hemisphere) + Error(Subject/(Cue*Hemisphere)),
contrasts=cm, data=roiDataframe)
print(summary(roi.aov))

but the results of these two aov commands are identical.  Is it the case that 
the 2x2 design matrix is always going to give the same F values for the 
interaction regardless of the contrast direction?  OR, is there some way to get 
a summary output for the contrasts that is not available from the print method?

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How to use a R package with C code

2005-03-09 Thread xt_wang

Hello, everybody,

I created a R package which includes C code. But I load this package, and carry
out the R function in it. It shows C function is not in load table as follows.
Would you tell me what is the problem? Where do I make mistake?

Maggie



[Previously saved workspace restored]

> library(var)

Attaching package 'var':


The following object(s) are masked _by_ .GlobalEnv :

 b

> wxt0124()
Error in .C("wxt1221") : C function name not in load table

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RSPYTHON install failed on Mac

2005-03-09 Thread Zhesi He
Dear Prof Brian Ripley,
I downloaded RSPython install tar file from other sites and get the 
same results.
After extract the file and configuer, I still get the same error.
Here I attached the config.log file. And there's not much information I 
can get from basic config info. Please advise on this.

Thanks,
Zhesi.

On 9 Mar 2005, at 13:02, Prof Brian Ripley wrote:
Without seeing config.log, we have no more idea than you do.
This is an Omegahat package, and either its list or the R-sig-mac list 
would be far more appropriate than this one.  But I suspect the answer 
is clear from config.log -- unpack the package before installing to 
see it.

On Wed, 9 Mar 2005, Zhesi He wrote:
Dear all,
I was trying to install RSPYTHON on my Mac OS X 10.3 into R, and got 
the following errors, is it because of my C compiler or the python I 
installed?

R CMD INSTALL -c Desktop/RSPython_0.5-4.tar.gz
* Installing *source* package 'RSPython' ...
checking for python... /usr/bin/python
Python version 2.3
Using threads
checking for gcc... gcc
checking for C compiler default output... configure: error: C 
compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package 'RSPython'
** Removing 
'/Applications/StartR.app/RAqua.app/Contents/library/RSPython'
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] R-2.0.1 Gentoo g77 problem

2005-03-09 Thread Charles C. Berry
Dimakos said:
As I pointed out in a private message to the original poster, g77 is not
found in the gentoo system.  However, the system does provide f2c which
 [ Dimakos' full text below]
It IS found on my gentoo system:
bash-2.05b$ g77 -fversion
GNU Fortran (GCC) 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
Copyright (C) 2002 Free Software Foundation, Inc.
[snip]
This is where portage puts it:

bash-2.05b$ locate g77
[stuff deleted]
/usr/share/gcc-data/sparc-unknown-linux-gnu/3.3.5/man/man1/g77.1.gz
/usr/sparc-unknown-linux-gnu/gcc-bin/3.3.5/g77
/usr/sparc-unknown-linux-gnu/gcc-bin/3.3.5/sparc-unknown-linux-gnu-g77
[more stuff deleted]
bash-2.05b$ locate f771
/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5/f771

As someone else noted you have to set the USE flags to 
include 'f77' or 'g77' and emerge gcc.

But setting USE = f77 did not leave a link or copy of g77 in /usr/bin. 
Hence, the symlink referred to in my message below.

Apparently, Gabriel and I are not the only ones to come up against this. 
There are a number of discussions like this one:

http://forums.gentoo.org/viewtopic.php?t=266985
where the solution was to copy or symlink /usr/bin/gcc to /usr/bin/g77.
Chuck
On Thu, 10 Mar 2005, Dimakos Ioannis wrote:
On Wed, 9 Mar 2005, Gabriel Rossetti wrote:
Hello,
I use Gentoo and I can't get R 2.0.1 to compile. I used the portage
system, Gentoo's source package sytem, and after it uncompresses the
source to R, it says that I don't have a fortran compiler. It told me to
use f77 flag and re-emerge gcc, which I did with the f77 and fortran
flags, but it still won't compile. Does anyone have any ideas? I suspect
that gcc has changed it's interworkings, because if I do a gcc -v it
says that I can compile fortran(f77) programs, but I don't have g77. If
anyone has any ideas or workarounds, it would be great. I really need it
for a P&S class. Thanks!

After experiencing similar problems and noticing that g77 was nowhere to
be found, I symlinked /usr/bin/g77 --> /usr/bin/gcc.
R then built and passed 'make check'.
As I pointed out in a private message to the original poster, g77 is not
found in the gentoo system.  However, the system does provide f2c which
will translate fortran to C code and then R-2.0.1 passes configure, and
make and make check and make install and everything
HTH,
ICD
--
Ioannis C. Dimakos
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/
--
Ioannis C. Dimakos
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/
Charles C. Berry(858) 534-2098
 Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://hacuna.ucsd.edu/members/ccb.html  La Jolla, San Diego 92093-0717
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to get standard deviation of rows in a matrix

2005-03-09 Thread Duncan Murdoch
On Wed, 9 Mar 2005 13:49:44 -0600, "Jagarlamudi, Choudary"
<[EMAIL PROTECTED]> wrote :

>Hi all,
> 
>   I am trying to find sd of my rows in a matrix and i get column sd inspite 
> of extracting rows.
>I tried to do the sqrt(var(x)) but that did'nt work as well,
> 
>Here is my data
> 
>genes
>15 24 63 40
>25 42 46 35
>23 53 37 45
>30 37 50 55
>40 51 30 48
> 
>x<-sd(genes[1:5,])

This doesn't extract the rows, it just returns the same matrix.  As
the man page for sd says, when applied to a matrix it calculates the
standard deviation of each column.

What you want to do is to use the apply function.  Rows are the first
dimension, so you would use

apply(genes, 1, sd)

Duncan Murdoch

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] need help getting started writing a new varFunc class for lme()

2005-03-09 Thread Sarah Holte
Hello - I've been using R for years, but have always been able to find 
what I need already available.  Now I find that I would like to write a 
new varFunc class for the lme() or nlme() packages.  There is some 
guidance for this in Problem 4 Chapter 5 of Bates and Pinheiro Mixed 
Effects Models in S and S-Plus.  However, I find that I am unable to 
even get started and so have just purchased John Chambers Book - 
Programming with Data, A Guide to the S Language.

Any specific tips about how to write a new varFunc class (I want one 
that models the variance of longitudinal correlated data as a logistic 
function of a covariate) or general tips or references to sections in 
Chambers book about the steps mentioned in Problem 4, Chapter 5 of Bates 
and Pinheiro (eg. write a constructor, constructor arguements (value and 
form), write an initialize method, etc) would be much appreciated.   I 
did find a few threads in the archives discussing this problem, but they 
were already way beyond my understanding of how to execute writing this 
new new varFunc class.

Thanks so much - Sarah Holte
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R-2.0.1 Gentoo g77 problem

2005-03-09 Thread Dimakos Ioannis
> On Wed, 9 Mar 2005, Gabriel Rossetti wrote:
>
>> Hello,
>>
>> I use Gentoo and I can't get R 2.0.1 to compile. I used the portage
>> system, Gentoo's source package sytem, and after it uncompresses the
>> source to R, it says that I don't have a fortran compiler. It told me to
>> use f77 flag and re-emerge gcc, which I did with the f77 and fortran
>> flags, but it still won't compile. Does anyone have any ideas? I suspect
>> that gcc has changed it's interworkings, because if I do a gcc -v it
>> says that I can compile fortran(f77) programs, but I don't have g77. If
>> anyone has any ideas or workarounds, it would be great. I really need it
>> for a P&S class. Thanks!
>
>
> After experiencing similar problems and noticing that g77 was nowhere to
> be found, I symlinked /usr/bin/g77 --> /usr/bin/gcc.
>
> R then built and passed 'make check'.

As I pointed out in a private message to the original poster, g77 is not
found in the gentoo system.  However, the system does provide f2c which
will translate fortran to C code and then R-2.0.1 passes configure, and
make and make check and make install and everything

HTH,

ICD

-- 
Ioannis C. Dimakos
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/

-- 
Ioannis C. Dimakos
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lattice device page options-margins

2005-03-09 Thread Deepayan Sarkar
On Wednesday 09 March 2005 13:54, Paul Murrell wrote:
> Hi
>
> Sundar Dorai-Raj wrote:
> > Bock, Michael wrote on 3/9/2005 1:19 PM:
> >> I am using lattice to make figures as pdfs:
> >> trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
> >>
> >> I need to specify some blank space on the left-hand margins (the
> >> pages will be bound so we need about 0.5 inch)). I have tried a
> >> number of solutions but none seems to work (e.g. par.set). Can
> >> this be done when initiating the plotting device? Or is the some
> >> other way that does not require me to manually move everything
> >> over?
> >
> > Michael,
> >
> > I believe you can do this using print.trellis and setting the
> > position argument. E.g.
> >
> > trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
> > xy <- xyplot(...)
> > print(xy, pos = c(0.10, 0, 1, 1))
> > dev.off()
>
> Or if you want exactly 0.5 inches, something like ...
>
> # may need
> # library(grid)
> trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
> xy <- xyplot(1:10 ~ 1:10)
> pushViewport(viewport(x=1,
>width=unit(1, "npc") - unit(0.5, "inches"),
>just="right"))
> # to show region you're plotting in
> # grid.rect(gp=gpar(col="grey"))
> print(xy, newpage=FALSE)
> popViewport()
> dev.off()

Yet another option, especially if you want this for multiple plots 
without having to handle each one separately, is to say (after loading 
lattice):

lattice.options(layout.widths = list(left.padding = 
list(x = 0.5, units = "inches")))

Unlike par settings though, this would stay in effect across devices.

Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lattice device page options-margins

2005-03-09 Thread Paul Murrell
Hi
Sundar Dorai-Raj wrote:

Bock, Michael wrote on 3/9/2005 1:19 PM:
I am using lattice to make figures as pdfs:
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
I need to specify some blank space on the left-hand margins (the pages
will be bound so we need about 0.5 inch)). I have tried a number of
solutions but none seems to work (e.g. par.set). Can this be done when
initiating the plotting device? Or is the some other way that does not
require me to manually move everything over?


Michael,
I believe you can do this using print.trellis and setting the position 
argument. E.g.

trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
xy <- xyplot(...)
print(xy, pos = c(0.10, 0, 1, 1))
dev.off()

Or if you want exactly 0.5 inches, something like ...
# may need
# library(grid)
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
xy <- xyplot(1:10 ~ 1:10)
pushViewport(viewport(x=1,
  width=unit(1, "npc") - unit(0.5, "inches"),
  just="right"))
# to show region you're plotting in
# grid.rect(gp=gpar(col="grey"))
print(xy, newpage=FALSE)
popViewport()
dev.off()
Paul
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[EMAIL PROTECTED]
http://www.stat.auckland.ac.nz/~paul/
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How to get standard deviation of rows in a matrix

2005-03-09 Thread Jagarlamudi, Choudary
Hi all,
 
   I am trying to find sd of my rows in a matrix and i get column sd inspite of 
extracting rows.
I tried to do the sqrt(var(x)) but that did'nt work as well,
 
Here is my data
 
genes
15 24 63 40
25 42 46 35
23 53 37 45
30 37 50 55
40 51 30 48
 
x<-sd(genes[1:5,])
 
y<-sqrt(var(genes[1:5,]))
 
I get 4 sds for the 4 columns instead of 5 sds for my 5 rows.
Thanks you in advance.
 
Choudary Jagarlamudi
Instructor
Southwestern Oklahoma State University
STF 254
100 campus Drive
Weatherford OK 73096
Tel 580-774-7136



__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

RE: [R] how modify object in parent.env

2005-03-09 Thread Vadim Ogranovich
Thank you to Gabor and Mark Schwartz for the answers. Both of them
solved the problem I posted, but my actual problem, as I now see, is a
little bit more involved. Let me try again.

I have a vector 'x'. I want to compute its entries in a loop (yes, I
know...). Say

x = seq(3)

for (i in seq(length(x)) {
x0 = someValue
x[i] = x0
} 

There are two problems with the above code:
1. x0 pollutes the global envirnoment (not to mention possible
over-write of an existing x0). Therefore I thought I'd wrap it with
local().
2. x0 is not a good name from a readability perspective. I'd rather call
it x to emphasize it's an entry in an outer vector 'x'. (In this small
example it doesn't really matter, but I have much more involved scripts
where consistent naming is important)

Gabor's solution solves 1 but not 2. Maybe there is a simple way around
this restriction?

Thanks,
Vadim



> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Gabor 
> Grothendieck
> Sent: Tuesday, March 08, 2005 4:06 PM
> To: r-help@stat.math.ethz.ch
> Subject: Re: [R] how modify object in parent.env
> 
> 
> You can use "<<-" like this:
> 
> x <- 1:3
> local(x[1] <<- x[1]+1)
> 
> Vadim Ogranovich  evafunds.com> writes:
> 
> : 
> : Assign() re-binds the value, not modifies it (the latter is what I
> : needed)
> : 
> : > -Original Message-
> : > From: McGehee, Robert [mailto:Robert.McGehee  
> geodecapital.com]
> : > Sent: Tuesday, March 08, 2005 3:48 PM
> : > To: Vadim Ogranovich; r-help  stat.math.ethz.ch
> : > Subject: RE: [R] how modify object in parent.env
> : >
> : > This isn't an environment problem. Assigning something to a
> : > get call doesn't make any sense. Use assign.
> : >
> : > > a <- 5
> : > > get("a") <- 10
> : > Error: couldn't find function "get<-"
> : >
> : > And from the ?assign help page, you can pick what environment
> : > you want to make the assignment. Just pick the parent environment.
> : >
> : >
> : > -Original Message-
> : > From: Vadim Ogranovich [mailto:vograno  evafunds.com]
> : > Sent: Tuesday, March 08, 2005 6:36 PM
> : > To: r-help  stat.math.ethz.ch
> : > Subject: [R] how modify object in parent.env
> : >
> : >
> : > Hi,
> : >
> : > Is it possible to modify an object in the parent.env (as 
> opposed to
> : > re-bind)? Here is what I tried:
> : >
> : > > x = 1:3
> : > # try to modify the first element of x from within a new 
> environment
> : > > local(get("x", parent.env(environment()))[1] <- NA)
> : > Error in eval(expr, envir, enclos) : Target of assignment 
> expands to
> : > non-language object
> : >
> : > # On the other hand retrieval works just fine
> : > > local(get("x", parent.env(environment()))[1])
> : > [1] 1
> : >
> : > Thanks,
> : > Vadim
> : >
> : > __
> : > R-help  stat.math.ethz.ch mailing list
> : > https://stat.ethz.ch/mailman/listinfo/r-help
> : > PLEASE do read the posting guide!
> : > http://www.R-project.org/posting-guide.html
> : >
> : 
> : __
> : R-help  stat.math.ethz.ch mailing list
> : https://stat.ethz.ch/mailman/listinfo/r-help
> : PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> : 
> :
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] matrix program

2005-03-09 Thread Achim Zeileis
On Wed,  9 Mar 2005 15:24:45 -0400 Owen Buchner wrote:

> I'm attempting to produce a program in which i can multiply a 4x4
> matrix by a vector.  I would like to have this occur 30 times with the
> product of the matrix and vector replace the original vector, kind of
> like population growth. I'm having difficulties with the programing
> aspect and continuously get errors from R.  I would appreciate any
> help.

Are you looking for something like this toy example?

Generate a matrix mm and a vector xx:

R> mm <- matrix(rep(1, 4), ncol = 2)
R> xx <- rep(1, 2)
R> mm
 [,1] [,2]
[1,]11
[2,]11
R> xx
[1] 1 1

And then pre-multiply 10 times by mm:

R> for(i in 1:10) xx <- mm %*% xx
R> xx
 [,1]
[1,] 1024
[2,] 1024

which in this case is of course just 2^10.

hth,
Z


> Owen Buchner
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lattice device page options-margins

2005-03-09 Thread Sundar Dorai-Raj

Bock, Michael wrote on 3/9/2005 1:19 PM:
I am using lattice to make figures as pdfs:
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
I need to specify some blank space on the left-hand margins (the pages
will be bound so we need about 0.5 inch)). I have tried a number of
solutions but none seems to work (e.g. par.set). Can this be done when
initiating the plotting device? Or is the some other way that does not
require me to manually move everything over?


Michael,
I believe you can do this using print.trellis and setting the position 
argument. E.g.

trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
xy <- xyplot(...)
print(xy, pos = c(0.10, 0, 1, 1))
dev.off()
--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] matrix program

2005-03-09 Thread Owen Buchner
I'm attempting to produce a program in which i can multiply a 4x4 matrix by a
vector.  I would like to have this occur 30 times with the product of the
matrix and vector replace the original vector, kind of like population growth.
I'm having difficulties with the programing aspect and continuously get errors
from R.  I would appreciate any help.

Owen Buchner
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Aid with 3-D scatterplots

2005-03-09 Thread Deepayan Sarkar
On Wednesday 09 March 2005 13:17, Jim and Chana Milks wrote:
> I am attempting to classify pixels from a Landsat image by using their
> associated numbers in bands 2, 3, and 4 (It's from an assignment on
> classification).  To aid me, I want to create a 3-D scatterplot using
> the "cloud" command.  Due to my ignorance of the finer plotting
> functions, I am unable to display the scale on the three axes or to
> display the grid.
>
> My dataframe (RS) contains four columns: Class, band2, band3, band4.
> Class is the classification variable (vegetation, water, soil, etc.)
>
> The basic code I used was:
> cloud(band4~band2*band3,RS,xlab="TM Band 2",ylab="TM Band 3",zlab="TM
> Band 4",group=RS$Class).

Just 'groups = Class' should work.

>
> Unfortunately, I'm unsure which arguments to use and how to write them
> in.  I've tried adding arguments using "scale", but have not been
> successful, mostly because I'm unsure which arguments apply.  The scale
> I want for all three axes is 0-100.

You want 

cloud(..., xlim = c(0, 100), ylim = c(0, 100), zlim = c(0, 100))

and perhaps 
 
cloud(..., xlim = c(0, 100), ylim = c(0, 100), zlim = c(0, 100), 
  scales = list(arrows = FALSE))

-Deepayan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Lattice device page options-margins

2005-03-09 Thread Bock, Michael
I am using lattice to make figures as pdfs:
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)

I need to specify some blank space on the left-hand margins (the pages
will be bound so we need about 0.5 inch)). I have tried a number of
solutions but none seems to work (e.g. par.set). Can this be done when
initiating the plotting device? Or is the some other way that does not
require me to manually move everything over?




Michael J. Bock, PhD.
ARCADIS
24 Preble St. Suite 100
Portland, ME 04101
207.828.0046
fax 207.828.0062




[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Aid with 3-D scatterplots

2005-03-09 Thread Jim and Chana Milks
I am attempting to classify pixels from a Landsat image by using their 
associated numbers in bands 2, 3, and 4 (It's from an assignment on 
classification).  To aid me, I want to create a 3-D scatterplot using 
the "cloud" command.  Due to my ignorance of the finer plotting 
functions, I am unable to display the scale on the three axes or to 
display the grid.

My dataframe (RS) contains four columns: Class, band2, band3, band4.  
Class is the classification variable (vegetation, water, soil, etc.)

The basic code I used was:
cloud(band4~band2*band3,RS,xlab="TM Band 2",ylab="TM Band 3",zlab="TM 
Band 4",group=RS$Class).

Unfortunately, I'm unsure which arguments to use and how to write them 
in.  I've tried adding arguments using "scale", but have not been 
successful, mostly because I'm unsure which arguments apply.  The scale 
I want for all three axes is 0-100.

Thank you for any help.
Jim Milks
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] about kpss.test()

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 13:31:16 -0500 (EST) Weiguang Shi wrote:

> Hi All,
> 
> First of all, could you tell me what the "KPSS Level" 
> in the output of the test means?

It means that you tested for level stationarity and gives you the test
statistic.

> I have a series, x, of periodic data and tried 
> kpss.test() on it to verify its stationarity. The

Note that stationarity is the null hypothesis and not the alternative of
the KPSS test.

> tests
> gave me the p-value above 0.1. Since the null 
> hypothesis N0 is that the series _is_ stationary, this
> means that I cannot reject N0. But the series does
> look
> periodic!
> 
> So does all this say stationarity and periodicity can 
> co-exist?

Please check the references of kpss.test or any book on economectric
time series analysis for which alternatives the KPSS test was designed.
Hint: it's not designed for detecting cyclical variations.
Z
 
> Thanks,
> Weiguang
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Trouble with mixreg

2005-03-09 Thread Rolf Turner

Just read your email about mixreg.  The problem is the assignment

y <- as.matrix(LRINTER)

The y argument has to be a ***vector***, not a matrix.  Deep in the
bowels of mixreg, yhat is formed as a matrix of fitted values for all
of the models in the mixture.  (The first column of yhat consists of
the fitted values from model 1, the second of the fitted values from
model 2, und so weiter.)

If y is a vector then y - yhat is the matrix whose columns are
y - (the respective columns of yhat).  This is standard R syntax.  If
y is a matrix, R won't touch the subtraction with a sterilized
barge-pole, and rightly so.

Remember that in R there is a big difference between a vector and
1-dimensional array, much as the two may seem to resemble each other.

cheers,

Rolf Turner
[EMAIL PROTECTED]

P. S.  The usual protocol for asking questions about
***contributed*** packages is to attempt firstly to contact the
author of the package.  (In this case me.)  Only if the author is a
recalcitrant guttersnipe, and fails to respond, should you bug the
r-help list about the problem.

R. T.

===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===

Massimiliano Marinucci wrote:

> I am trying to estimate a mixture of regression and get the
> following error using the mixreg package:
> 
> Error in y - yhat : non-conformable arrays
> 
> The instruction I used were:
> x <- as.matrix(LRHUN)
> y <- as.matrix(LRINTER)
> 
> TS  <- list(list(beta=c(3.0,1.0),sigsq=1,lambda=0.4),
> list(beta=c(0.0,1.0),sigsq=1,lambda=0.6))
> 
> prova <- mixreg(x,y, ncomp=2, theta.start=TS)
> 
> The data set has about 1200 observations.
> I checked out that x and y have the same number of obs.
> Also examples work fine.
> 
> Any hints on what is going on? Thanks
> best regards
> M
> 
> **
> Massimiliano Marinucci
> http://personales.ya.com/max_mar/
> Ph.D Candidate in Economics
> Fundamentos del Analisis Económico II
> (Economía Cuantitativa)
> Facultad de CC.EE.
> Universidad Complutense Madrid
> Campus de Somosaguas
> Madrid - Spain
> **

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 18:21:41 +0100 Ronny Klein wrote:

> > > The myplot is something like this:
> > >
> > > plot(x)
> > > text(foo)
> >
> > Aha, I was surprised that this worked for one of the two plots.
> > You could pass myplot as an expression, e.g. myplot =
> > expression(plot(x)), and then eval() that in the body of
> > plot.both().
> 
> I've followed your advice

Not quite...

> and changed my function to something like this:
> 
> plot.both <- function{myplot, filename}{
>  MYPLOT <- expression(myplot)
>  pdf(file=paste(filename, ".pdf", sep=""))
>  eval(myplot)
>  dev.off()
>  postscript(file=paste(filename, ".eps", sep=""))
>  eval(myplot)
> dev.off()
>  }

I guess you would want eval(MYPLOT) there?

But the function above works if you say
  plot.both(myplot = expression(plot(x)), filename = "foo")
and that is what I said above: set myplot = expression(plot(x)).
Z

> However the result is the same: the first one is actually printed but
> the second plot is empty. 
> 
> Ronny
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] about kpss.test()

2005-03-09 Thread Weiguang Shi
Hi All,

First of all, could you tell me what the "KPSS Level" 
in the output of the test means?

I have a series, x, of periodic data and tried 
kpss.test() on it to verify its stationarity. The
tests
gave me the p-value above 0.1. Since the null 
hypothesis N0 is that the series _is_ stationary, this

means that I cannot reject N0. But the series does
look
periodic!

So does all this say stationarity and periodicity can 
co-exist?

Thanks,
Weiguang

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] plotting

2005-03-09 Thread Owen Buchner
I have two questions for you.  Firstly I'm having troubles trying to plot more
then 1 graph.  I'm attempting to make a plot with 9 panels, but i have no clue
what type of code to use.
Secondly i was wondering if there was some code to generate random numbers
between two defined intervals and then have R chose one randomly in a program. 
If you could answer either of these questions for me I would appreciate it.

Owen Buchner

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R-2.0.1 Gentoo g77 problem

2005-03-09 Thread Charles C. Berry
On Wed, 9 Mar 2005, Gabriel Rossetti wrote:
Hello,
I use Gentoo and I can't get R 2.0.1 to compile. I used the portage 
system, Gentoo's source package sytem, and after it uncompresses the 
source to R, it says that I don't have a fortran compiler. It told me to 
use f77 flag and re-emerge gcc, which I did with the f77 and fortran 
flags, but it still won't compile. Does anyone have any ideas? I suspect 
that gcc has changed it's interworkings, because if I do a gcc -v it 
says that I can compile fortran(f77) programs, but I don't have g77. If 
anyone has any ideas or workarounds, it would be great. I really need it 
for a P&S class. Thanks!

After experiencing similar problems and noticing that g77 was nowhere to 
be found, I symlinked /usr/bin/g77 --> /usr/bin/gcc.

R then built and passed 'make check'.
Surely there is something wrong with my approach that this hack is needed, 
but figuring out what is wrong is not high on my list...

BTW, I build R outside of portage and install R into /usr/local to avoid 
the lag between Gentoo ebuilds and the current R-release.

Chuck
Gabriel
My gcc version is :
gcc version 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
--

Charles C. Berry(858) 534-2098
 Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://hacuna.ucsd.edu/members/ccb.html  La Jolla, San Diego 92093-0717
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread McGehee, Robert
Use substitute() instead of expression(); choose to use either MYPLOT or
myplot because they are different variables; and use parentheses around
your function arguments instead of braces.

-Original Message-
From: Ronny Klein [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 09, 2005 12:22 PM
To: Achim Zeileis
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] function in order to plot the same graph to postscript
and pdf


> > The myplot is something like this:
> >
> > plot(x)
> > text(foo)
>
> Aha, I was surprised that this worked for one of the two plots.
> You could pass myplot as an expression, e.g. myplot =
> expression(plot(x)), and then eval() that in the body of plot.both().

I've followed your advice and changed my function to something like
this:

plot.both <- function{myplot, filename}{
 MYPLOT <- expression(myplot)
 pdf(file=paste(filename, ".pdf", sep=""))
 eval(myplot)
 dev.off()
 postscript(file=paste(filename, ".eps", sep=""))
 eval(myplot)
dev.off()
 }

However the result is the same: the first one is actually printed but
the 
second plot is empty. 

Ronny

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problem using uniroot with integrate

2005-03-09 Thread Tony Plate
At Wednesday 09:27 AM 3/9/2005, Ken Knoblauch wrote:
Hi,
I'm trying to calculate the value of the variable, dp, below, in the
argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1).  This
corresponds to the estimate of the sensitivity of an observer in an
m-alternative forced choice experiment, given the probability of
a correct response, Pc, a Gaussian assumption for the noise and
no bias.  The function that I wrote below gives me an error:
Error in f(x, ...) : recursive default argument reference
The problem seems to be at the statement using uniroot,
because the furntion est.dp works fine outside of the main function.
I've been using R for awhile but there are still many nuances
about the scoping and the use of environments that I'm weak on
and would like to understand better.  I would appreciate any
suggestions or solutions that anyone might offer for fixing
my error.  Thank you.
dprime.mAFC <- function(Pc, m) {
est.dp <- function(dp, Pc = Pc, m = m) {
  pr <- function(x, dpt = dp, m0 = m) {
dnorm(x - dpt) * pnorm(x)^(m0 - 1)
}
  Pc - integrate(pr, lower = -Inf, upper = Inf,
  dpt = dp, m0 = m)$value
}
dp.res <- uniroot(est.dp, interval = c(0,5), Pc = Pc, m = m)
dp.res$root
}
You've got several problems here
* recursive argument defaults: these are unnecessary but result in the 
particular error message you are seeing (e.g., in the def of est.dp, the 
default value for the argument 'm' is the value of the argument 'm' itself 
-- default values for arguments are interpreted in the frame of the 
function itself)
* the argument m=m you supply to uniroot() is being interpreted as 
specifying the 'maxiter' argument to uniroot()

I think you can fix it by changing the 'm' argument of function est.dp to 
be named 'm0', and specifying 'm0' in the call to uniroot.  (but I can't 
tell for sure because you didn't supply a working example -- when I just 
guess at values to pass in I get numerical errors.)
Also, it would be best to remove the incorrect recursive default arguments 
for the functions est.dp and pr.

-- Tony Plate
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] problem using uniroot with integrate

2005-03-09 Thread Sundar Dorai-Raj

Ken Knoblauch wrote on 3/9/2005 10:27 AM:
Hi, 

I'm trying to calculate the value of the variable, dp, below, in the
argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1).  This
corresponds to the estimate of the sensitivity of an observer in an
m-alternative forced choice experiment, given the probability of
a correct response, Pc, a Gaussian assumption for the noise and
no bias.  The function that I wrote below gives me an error:
Error in f(x, ...) : recursive default argument reference
The problem seems to be at the statement using uniroot,
because the furntion est.dp works fine outside of the main function.
I've been using R for awhile but there are still many nuances
about the scoping and the use of environments that I'm weak on
and would like to understand better.  I would appreciate any
suggestions or solutions that anyone might offer for fixing
my error.  Thank you.
dprime.mAFC <- function(Pc, m) {
		est.dp <- function(dp, Pc = Pc, m = m) {
		
		  pr <- function(x, dpt = dp, m0 = m) {
			dnorm(x - dpt) * pnorm(x)^(m0 - 1)
			}
		
		  Pc - integrate(pr, lower = -Inf, upper = Inf, 
		  dpt = dp, m0 = m)$value
		}
		
	dp.res <- uniroot(est.dp, interval = c(0,5), Pc = Pc, m = m)
	dp.res$root	
	}

Ken,
Look at the argument list for ?uniroot and think "partial matching". 
You're "m" is being interpretted for "maxiter". Simply change to

dp.res <- uniroot(est.dp, interval = c(0,5), Pc = Pc, m0 = m)
and in other places for consistency and the error goes away. Of course, 
since you gave no working example, I'm not sure if other errors are 
present that I'm missing.

--sundar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] about create a R package

2005-03-09 Thread xt_wang

Hello, everyone,

I would like to create a package which includes C code. My input data comes from
a text file and I will output my solution into a text file too. My question is
that I put the input file in src directory or data directory or somewhere else?

On the other hand, I want to call this C function from R. Is he R code put in
the R directory or I carry out this code in R environment directly?

maggie

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R CMD check errors

2005-03-09 Thread Chris Jackson
In my experience these are usually signs of an error in your NAMESPACE
file, such as a function name in the NAMESPACE which does not match the
function name in the package.
Chris
Ollivier TARAMASCO wrote:
> I wrote a library which seems to work on my PC, and on different Unix
> systems.
>
> As it is written in the "Writing R Extensions" manual, I execute a R CMD
> check on my library.
>
>
> I have always the same errors messages:
>
> * checking S3 generic/method consistency ... WARNING
> Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
> character
> .only = TRUE, verbose = FALSE) :
> package/namespace load failed for 'TATA'
> Execution halted
>
> See section 'Generic functions and methods' of the 'Writing R Extensions'
> manual.
>
>
> * checking replacement functions ... WARNING
> Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
> character
> .only = TRUE, verbose = FALSE) :
> package/namespace load failed for 'TATA'
> Execution halted
>
> In R, the argument of a replacement function which corresponds to the 
right
> hand side must be named 'value'.
>
>
> * checking foreign function calls ... WARNING
> Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
> character
> .only = TRUE, verbose = FALSE) :
> package/namespace load failed for 'TATA'
> Execution halted
> See section 'System and foreign language interfaces' of the 'Writing R
> Extensions' manual.

--
Christopher Jackson <[EMAIL PROTECTED]>, Research Associate,
Department of Epidemiology and Public Health, Imperial College
School of Medicine, Norfolk Place, London W2 1PG, tel. 020 759 43371
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] function in order to plot the same graph to postscript an d pdf

2005-03-09 Thread Liaw, Andy
This works for me:

plot.both <- function(expr, filename) {
 pdf(file=paste(filename, ".pdf", sep=""))
 eval(expr)
 dev.off()
 postscript(file=paste(filename, ".eps", sep=""))
 eval(expr)
dev.off()
}

plot.both(expression(plot(1:10)), "testboth")


Andy

PS:  Please make sure you post correct code.  The code you posted has syntax
(and other) errors.

> From: Ronny Klein
> 
> > > The myplot is something like this:
> > >
> > > plot(x)
> > > text(foo)
> >
> > Aha, I was surprised that this worked for one of the two plots.
> > You could pass myplot as an expression, e.g. myplot =
> > expression(plot(x)), and then eval() that in the body of 
> plot.both().
> 
> I've followed your advice and changed my function to 
> something like this:
> 
> plot.both <- function{myplot, filename}{
>  MYPLOT <- expression(myplot)
>  pdf(file=paste(filename, ".pdf", sep=""))
>  eval(myplot)
>  dev.off()
>  postscript(file=paste(filename, ".eps", sep=""))
>  eval(myplot)
> dev.off()
>  }
> 
> However the result is the same: the first one is actually 
> printed but the 
> second plot is empty. 
> 
> Ronny
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] problem using uniroot with integrate

2005-03-09 Thread Ken Knoblauch
Hi, 

I'm trying to calculate the value of the variable, dp, below, in the
argument to the integral of dnorm(x-dp) * pnorm(x)^(m-1).  This
corresponds to the estimate of the sensitivity of an observer in an
m-alternative forced choice experiment, given the probability of
a correct response, Pc, a Gaussian assumption for the noise and
no bias.  The function that I wrote below gives me an error:

Error in f(x, ...) : recursive default argument reference

The problem seems to be at the statement using uniroot,
because the furntion est.dp works fine outside of the main function.
I've been using R for awhile but there are still many nuances
about the scoping and the use of environments that I'm weak on
and would like to understand better.  I would appreciate any
suggestions or solutions that anyone might offer for fixing
my error.  Thank you.

dprime.mAFC <- function(Pc, m) {
est.dp <- function(dp, Pc = Pc, m = m) {

  pr <- function(x, dpt = dp, m0 = m) {
dnorm(x - dpt) * pnorm(x)^(m0 - 1)
}

  Pc - integrate(pr, lower = -Inf, upper = Inf, 
  dpt = dp, m0 = m)$value
}

dp.res <- uniroot(est.dp, interval = c(0,5), Pc = Pc, m = m)
dp.res$root 
}

platform powerpc-apple-darwin6.8
arch powerpc
os   darwin6.8  
system   powerpc, darwin6.8 
status  
major2  
minor0.1
year 2004   
month11 
day  15 
language R 

ken


Ken Knoblauch
Inserm U 371
Cerveau et Vision
18 avenue du Doyen Lepine
69675 Bron cedex
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: 06 84 10 64 10

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Ronny Klein
> > The myplot is something like this:
> >
> > plot(x)
> > text(foo)
>
> Aha, I was surprised that this worked for one of the two plots.
> You could pass myplot as an expression, e.g. myplot =
> expression(plot(x)), and then eval() that in the body of plot.both().

I've followed your advice and changed my function to something like this:

plot.both <- function{myplot, filename}{
 MYPLOT <- expression(myplot)
 pdf(file=paste(filename, ".pdf", sep=""))
 eval(myplot)
 dev.off()
 postscript(file=paste(filename, ".eps", sep=""))
 eval(myplot)
dev.off()
 }

However the result is the same: the first one is actually printed but the 
second plot is empty. 

Ronny

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Encodebuf? yet another memory question

2005-03-09 Thread Prof Brian Ripley
On Wed, 9 Mar 2005, Tim Howard wrote:
Hi all,
  I was surprised to see this memory error:
Error in scan(Cn.minex13, nlines = 2, quiet = TRUE) :
   Could not allocate memory for Encodebuf
memory.size(max=TRUE)
[1] 256843776
memory.size(FALSE)
[1] 180144528
memory.limit()
[1] 2147483648
I don't have any objects named 'Encodebuf' and help and the R site
search turn up no matches for this word.
Try the source code, specifically that for R_AllocStringBuffer.
As memory.size and memory.limit indicate, I'm way below my limit (but,
I grant that maybe windows won't give R any more memory...).   In my
next run, I'll ask to scan fewer lines, but I thought it worth asking
the group if this 'Encodebuf' error meant anything different than the
standard "can't allocate x bytes" message. (btw, if you are confused
that scanning only 2 lines would max out my memory... I'm scanning two
long lines from 36 different connections so it does add up).
Yes, in that it is a direct call to malloc so no gc() takes place.
In any case, you have run out of memory and this is perfectly possible if 
they are long lines since scan reads a line at a time into memory.

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Christophe Declercq


> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] la part de
> Peter Dalgaard
> Envoye : mercredi 9 mars 2005 15:19
>
>
> Ronny Klein <[EMAIL PROTECTED]> writes:

[...]
> > I would like to have a "comma" instead of a "point" as
> the decimal point in my
> > graphics, i.e. postscript and pdf files, for I write my
> thesis in German. My
[...]
>
> We don't have a way of formatting numbers according to
> LC_NUMERIC, as
> far as I know. This leaves it to you to set up axes etc. to your
> liking, e.g.
>
>  x <- rnorm(100,,.2)
>  p <- pretty(x)
>  hist(x,xaxt="n")
>  axis(1, at=p, labels=sub("\\.", ",", p))
>
> (and possibly throw in xlim=range(p) on the hist() call. Or use
> axTicks(), which is probably a better idea.)

When I need that, I use something like Peter but with the 'format'
function, for example:

  x <- rnorm(100,,.2)
  p <- pretty(x)
  hist(x,xaxt="n")
  axis(1, at=p, labels=format(pretty(x), decimal.mark=","))

Hope it helps.

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]


>
> > Ronny
> >
> >
> > PS: The problem of displaying the German umlauts, I have
> already solved: I
> > have to use the WinAnsi.enc as the default encoding file.
> Which is odd in my
> > opinion.
>
> This should improve in 2.1.0 (or at least be broken in new and
> interesting ways) due to support for UTF-8 encodings.
>
> --
>O__   Peter Dalgaard Blegdamsvej 3
>   c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
>  (*) \(*) -- University of Copenhagen   Denmark  Ph:
> (+45) 35327918
> ~~ - ([EMAIL PROTECTED]) FAX:
> (+45) 35327907
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Greg Snow
 Peter Dalgaard <[EMAIL PROTECTED]> 03/09/05 07:18AM >>>
>Ronny Klein <[EMAIL PROTECTED]> writes:
>
>> Hi,
>> 
>> after a lengthy but unsuccessfull search I couldn't come up with a
solution to 
>> the following problem:
>> 
>> I would like to have a "comma" instead of a "point" as the decimal
point in my 
>> graphics, i.e. postscript and pdf files, for I write my thesis in
German. My 
>> system is:
>> 
>> OS: Debian Unstable
>> R-Version:  2.0.1
>> System locale: [EMAIL PROTECTED]
>> 
>> Could someone, please, help me out or at least point me to the right

>> documentation. I'm just lost at the moment.
>
>
>We don't have a way of formatting numbers according to LC_NUMERIC, as
>far as I know. This leaves it to you to set up axes etc. to your
>liking, e.g.
>
> x <- rnorm(100,,.2)
> p <- pretty(x)
> hist(x,xaxt="n")
> axis(1, at=p, labels=sub("\\.", ",", p))

or for the last line:

axis(1, at=p, labels=format(p, decimal.mark=','))


>
>(and possibly throw in xlim=range(p) on the hist() call. Or use
>axTicks(), which is probably a better idea.)
>
>> Ronny
>> 
>> 
>> PS: The problem of displaying the German umlauts, I have already
solved: I 
>> have to use the WinAnsi.enc as the default encoding file. Which is
odd in my 
>> opinion.
>
>This should improve in 2.1.0 (or at least be broken in new and
>interesting ways) due to support for UTF-8 encodings.



Greg Snow, Ph.D.
Statistical Data Center
[EMAIL PROTECTED]
(801) 408-8111

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R CMD check errors

2005-03-09 Thread Ollivier TARAMASCO
Hello,

 

I wrote a library which seems to work on my PC, and on different Unix
systems. 

As it is written in the "Writing R Extensions" manual, I execute a R CMD
check on my library.

 

I have always the same errors messages:

 

* checking S3 generic/method consistency ... WARNING

Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
character

.only = TRUE, verbose = FALSE) :

package/namespace load failed for 'TATA'

Execution halted

See section 'Generic functions and methods' of the 'Writing R Extensions'

manual.

 

* checking replacement functions ... WARNING

Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
character

.only = TRUE, verbose = FALSE) :

package/namespace load failed for 'TATA'

Execution halted

In R, the argument of a replacement function which corresponds to the right

hand side must be named 'value'.

 

* checking foreign function calls ... WARNING

Error in .try_quietly({ : Error in library(package, lib.loc = lib.loc,
character

.only = TRUE, verbose = FALSE) :

package/namespace load failed for 'TATA'

Execution halted

See section 'System and foreign language interfaces' of the 'Writing R

Extensions' manual.

 

I read and read again my manual and found no information about what theses
messages mean. I search with Google and found nothing very helpful.

Then I create a library with the 'foo' example in the manual, and surprise,
I have exactly the same error messages when I make the R CMD check.

 

I use the last version of R. Thank you for your help.

 

Ollivier TARAMASCO

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Encodebuf? yet another memory question

2005-03-09 Thread Tim Howard
Hi all,
   I was surprised to see this memory error:

Error in scan(Cn.minex13, nlines = 2, quiet = TRUE) : 
Could not allocate memory for Encodebuf
> memory.size(max=TRUE)
[1] 256843776
> memory.size(FALSE)
[1] 180144528
> memory.limit()
[1] 2147483648


I don't have any objects named 'Encodebuf' and help and the R site
search turn up no matches for this word.  

As memory.size and memory.limit indicate, I'm way below my limit (but,
I grant that maybe windows won't give R any more memory...).   In my
next run, I'll ask to scan fewer lines, but I thought it worth asking
the group if this 'Encodebuf' error meant anything different than the
standard "can't allocate x bytes" message. (btw, if you are confused
that scanning only 2 lines would max out my memory... I'm scanning two
long lines from 36 different connections so it does add up).

> version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major2  
minor0.1
year 2004   
month11 
day  15 
language R  

Thanks.

Tim Howard

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Gabor Grothendieck
Ronny Klein  wiwi.uni-halle.de> writes:

: 
: Hi,
: 
: I've written a function in order to plot the same graph in a postcript and 
in 
: a pdf file. Unfortunately, the second graph is always empty, i.e.:
: 
: plot.both <- function{myplot, filename}{
:   pdf(file=paste(filename, ".pdf", sep=""))
:myplot
:   dev.off()
:   postscript(file=paste(filename, ".eps", sep=""))
:myplot
:   dev.off()
: }
: 
: yields in a correct pdf but an empty eps file. However something like this:
: 
: plot.both <- function{myplot1, myplot2, filename}{
:   pdf(file=paste(filename, ".pdf", sep=""))
:myplot1
:   dev.off()
:   postscript(file=paste(filename, ".eps", sep=""))
:myplot2
:   dev.off()
: }
: 
: yields the expected results even if myplot1 and myplot2 are identical.
: 
: Does somebody know, how I can implement the desired (first) function?
: 
: Ronny
: 
: PS: My system is: Linux Debian Unstable and R-Version:  2.0.1.
: 

The following works on Windows R 2.1.0.  Don't know about Linux:

dev.control(displaylist="enable") # enable display list
plot(1:10)
myplot <- recordPlot() # load displaylist into variable
savePlot("myplot", type = "pdf")
savePlot("myplot", type = "ps")

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Structural equation models with R

2005-03-09 Thread John Fox
Dear Andre,

Is one of the observed variables named "ridos" or "riqdos"?

I hope this helps,
 John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of André 
> TavaresCorrêa Dias
> Sent: Wednesday, March 09, 2005 9:53 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Structural equation models with R
> 
> Hello useRs,
> I`m running structural equation models with R, but for one of 
> my models the below error message apears. I`m trying to 
> change startvalues but without success. The manual for sem 
> package did not help me. Does anyone knows how to change 
> startvalues for iteration in sem package? Or it can be 
> another problem with the model?
> 
> Error in startvalues(S, ram, debug = debug, tol = start.tol) : 
> subscript out of bounds
> 
> The model (with three latent variables: 'reg','folha','solo'))
> 
> model.com=matrix(c(
> 'ridos>dendos',   'a1',   NA,
> 'ridos>reg',  'a2',   NA,
> 'ridos>folha','a3',   NA,
> 'ridos>solo', 'a4',   NA,
> 'ridos>raiz', 'a5',   NA,
> 'dendos>litter',  'a6',   NA,
> 'dendos>reg', 'a7',   NA,
> 'litter>reg', 'a8',   NA,
> 'folha>reg',  'a9',   NA,
> 'solo>reg',   'a10',  NA,
> 'raiz>reg',   'a11',  NA,
> 'raiz>solo',  'a12',  NA,
> 'folha>solo', 'a13',  NA,
> 'reg>denjov', 'l1',   NA,
> 'reg>riqjov', 'l2',   NA,
> 'folha>nfolha',   'l3',   NA,
> 'folha>pfolha',   'l4',   NA,
> 'solo>nsolo', 'l5',   NA,
> 'solo>psolo', 'l6',   NA,
> 'riqjov<>riqjov', 'e1',   NA,
> 'denjov<>denjov', 'e2',   NA,
> 'litter<>litter', 'e3',   NA,
> 'riqdos<>riqdos', 'e4',   NA,
> 'dendos<>dendos', 'e5',   NA,
> 'raiz<>raiz', 'e6',   NA,
> 'nsolo<>nsolo',   'e7',   NA,
> 'psolo<>psolo',   'e8',   NA,
> 'nfolha<>nfolha', 'e9', NA,
> 'pfolha<>pfolha', 'e10',  NA,
> 'reg<>reg',   NA, 1,
> 'solo<>solo', NA, 1,
> 'folha<>folha',   NA, 1),
> ncol=3, byrow=TRUE)
> 
> obs.vars.com=c('riqjov','denjov','litter','riqdos','dendos','raiz',
> 'nsolo','psolo','nfolha','pfolha')
> 
> sem.com=sem(model.com,S.com,30,obs.vars.com)
> 
> ---
> André Tavares Corrêa Dias
> Laboratório de Ecologia Vegetal
> Departamento de Ecologia - IB
> Universidade Federal do Rio de Janeiro
> Ilha do Fundão, CCS
> Rio de Janeiro, RJ. Brasil
> CEP 21941-590CP 68020
> Tel. (21)2562-6377
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Prof Brian Ripley
On Wed, 9 Mar 2005, Ronny Klein wrote:
Hi,
after a lengthy but unsuccessfull search I couldn't come up with a 
solution to the following problem:

I would like to have a "comma" instead of a "point" as the decimal point in my
graphics, i.e. postscript and pdf files, for I write my thesis in German. My
system is:
OS: Debian Unstable
R-Version:  2.0.1
System locale: [EMAIL PROTECTED]
Could someone, please, help me out or at least point me to the right
documentation. I'm just lost at the moment.
You need to label your axes with comma: R does not support , as a decimal 
point.  Use explicit calls to axis(), or edit the postscript after 
production.

No one has ever requested this before.  Since the grammar would not allow 
, to be used as a decimal point for console input, it is awkward to allow 
it for output (but a few functions such as write.table do).


PS: The problem of displaying the German umlauts, I have already solved: I
have to use the WinAnsi.enc as the default encoding file. Which is odd in my
opinion.
It's not true!  There is a problem with some PDF viewers, worked around a 
long time ago in R-patched:

o   Some PDF readers do not define PDFDocEncoding, so pdf()'s
ISOLatin1 encoding is now derived from WinAnsi rather than
PDFDocEncoding.
It seems Adobe changed the standard since the version that the pdf() 
device was written to support, and some viewers are not backwards 
compatible.

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nnet abstol

2005-03-09 Thread Prof Brian Ripley
From the help page:
  abstol: Stop if the fit criterion falls below 'abstol', indicating an
  essentially perfect fit.
Now, what the `fit criterion' is depends on the other options that you 
have not told us, but I don't see MSE mentioned anywhere on that help 
page, and I do see `least-squares'.

On Wed, 9 Mar 2005, Kemp S E (Comp) wrote:
Hi,
I am using nnet to learn transfer functions. For each transfer function 
I can estimate the best possible Mean Squared Error (MSE). So, rather 
than trying to grind the MSE to 0, I would like to use abstol to stop 
training once the best MSE is reached.

Can anyone confirm that the abstol parameter in the nnet function is the 
MSE, or is it the Sum-of-Squares (SSE)?
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Structural equation models with R

2005-03-09 Thread André TavaresCorrêa Dias
Hello useRs,
I`m running structural equation models with R, but for one of my models the 
below error message apears. I`m trying to change startvalues but without 
success. The manual for sem package did not help me. Does anyone knows how to 
change startvalues for iteration in sem package? Or it can be another problem 
with the model?

Error in startvalues(S, ram, debug = debug, tol = start.tol) : 
subscript out of bounds

The model (with three latent variables: 'reg','folha','solo'))

model.com=matrix(c(
'ridos>dendos', 'a1',   NA,
'ridos>reg','a2',   NA,
'ridos>folha',  'a3',   NA,
'ridos>solo',   'a4',   NA,
'ridos>raiz',   'a5',   NA,
'dendos>litter','a6',   NA,
'dendos>reg',   'a7',   NA,
'litter>reg',   'a8',   NA,
'folha>reg','a9',   NA,
'solo>reg', 'a10',  NA,
'raiz>reg', 'a11',  NA,
'raiz>solo','a12',  NA,
'folha>solo',   'a13',  NA,
'reg>denjov',   'l1',   NA,
'reg>riqjov',   'l2',   NA,
'folha>nfolha', 'l3',   NA,
'folha>pfolha', 'l4',   NA,
'solo>nsolo',   'l5',   NA,
'solo>psolo',   'l6',   NA,
'riqjov<>riqjov',   'e1',   NA,
'denjov<>denjov',   'e2',   NA,
'litter<>litter',   'e3',   NA,
'riqdos<>riqdos',   'e4',   NA,
'dendos<>dendos',   'e5',   NA,
'raiz<>raiz',   'e6',   NA,
'nsolo<>nsolo', 'e7',   NA,
'psolo<>psolo', 'e8',   NA,
'nfolha<>nfolha',   'e9', NA,
'pfolha<>pfolha',   'e10',  NA,
'reg<>reg', NA, 1,
'solo<>solo',   NA, 1,
'folha<>folha', NA, 1),
ncol=3, byrow=TRUE)

obs.vars.com=c('riqjov','denjov','litter','riqdos','dendos','raiz',
'nsolo','psolo','nfolha','pfolha')

sem.com=sem(model.com,S.com,30,obs.vars.com)

---
André Tavares Corrêa Dias
Laboratório de Ecologia Vegetal
Departamento de Ecologia - IB
Universidade Federal do Rio de Janeiro
Ilha do Fundão, CCS
Rio de Janeiro, RJ. Brasil
CEP 21941-590CP 68020
Tel. (21)2562-6377

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 15:24:48 +0100 Ronny Klein wrote:

> > What are the myplot objects? Expressions or graphical objects that
> > are printed?
> 
> The myplot is something like this:
> 
> plot(x)
> text(foo)

Aha, I was surprised that this worked for one of the two plots.
You could pass myplot as an expression, e.g. myplot =
expression(plot(x)), and then eval() that in the body of plot.both(). 

But personally, I wouldn't do that :-) and use Sweave instead.
Z

> etc.
> 
> > In any case, a good recommendation for this kind of stuff is to look
> > at Sweave() in the utils package. I guess you're writing your thesis
> > in LaTeX...and Sweave is a great possibility to mix LaTeX code and R
> > code which for example generates both pdf and eps graphics.
> 
> Thanks, I will have a look on it.
> 
> Ronny
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Plotting several series on one set of axes

2005-03-09 Thread Gabor Grothendieck
  blueyonder.co.uk> writes:

: I am rather rusty with my R, but I recall being able to do something like
: plot(x1,...);plot(x2,add=TRUE,...)
: to plot two series on the same axes.
: 

You can use ts.plot to plot multiple ts time series on one set of
axes in one command (even if they have different time bases though
they must have the same frequency). See ?ts.plot

zoo can represent series as irregular so that even ones with 
different frequencies can be simultaneously plotted on the same
axes in one command. See library(zoo)l; help(plot.zoo)

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Peter Dalgaard
Ronny Klein <[EMAIL PROTECTED]> writes:

> Hi,
> 
> after a lengthy but unsuccessfull search I couldn't come up with a solution 
> to 
> the following problem:
> 
> I would like to have a "comma" instead of a "point" as the decimal point in 
> my 
> graphics, i.e. postscript and pdf files, for I write my thesis in German. My 
> system is:
> 
> OS: Debian Unstable
> R-Version:  2.0.1
> System locale: [EMAIL PROTECTED]
> 
> Could someone, please, help me out or at least point me to the right 
> documentation. I'm just lost at the moment.


We don't have a way of formatting numbers according to LC_NUMERIC, as
far as I know. This leaves it to you to set up axes etc. to your
liking, e.g.

 x <- rnorm(100,,.2)
 p <- pretty(x)
 hist(x,xaxt="n")
 axis(1, at=p, labels=sub("\\.", ",", p))

(and possibly throw in xlim=range(p) on the hist() call. Or use
axTicks(), which is probably a better idea.)

> Ronny
> 
> 
> PS: The problem of displaying the German umlauts, I have already solved: I 
> have to use the WinAnsi.enc as the default encoding file. Which is odd in my 
> opinion.

This should improve in 2.1.0 (or at least be broken in new and
interesting ways) due to support for UTF-8 encodings.

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Ronny Klein
> What are the myplot objects? Expressions or graphical objects that are
> printed?

The myplot is something like this:

plot(x)
text(foo)

etc.

> In any case, a good recommendation for this kind of stuff is to look at
> Sweave() in the utils package. I guess you're writing your thesis in
> LaTeX...and Sweave is a great possibility to mix LaTeX code and R code
> which for example generates both pdf and eps graphics.

Thanks, I will have a look on it.

Ronny

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R-2.0.1 Gentoo g77 problem

2005-03-09 Thread Jin Shusong
On Wed, Mar 09, 2005 at 04:09:50PM +0800, Gabriel Rossetti wrote:
> Hello,
> 
> I use Gentoo and I can't get R 2.0.1 to compile. I used the portage system, 
> Gentoo's source package sytem, and after it uncompresses the source to R, it 
> says that I don't have a fortran compiler. It told me to use f77 flag and 
> re-emerge gcc, which I did with the f77 and fortran flags, but it still won't 
> compile. Does anyone have any ideas? I suspect that gcc has changed it's 
> interworkings, because if I do a gcc -v it says that I can compile 
> fortran(f77) programs, but I don't have g77. If anyone has any ideas or 
> workarounds, it would be great. I really need it for a P&S class. Thanks!
> 
> Gabriel
> 
> My gcc version is : 
> gcc version 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
> --
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Dear Gabriel,
Gentoo does not install g77 with gcc as a default
component.  You should emerge your gcc again.
Just follow the steps below
1. modify your configure file /etc/make.conf.  There is a
line beginning with USE, add f77 in that line.
2. emerge gcc.  This may take a long time.
3. emerge R.  Remember that you should not set the FFLAGS
with aggressive flags.

Good luck. 
-- 


   Yours  Sincerely

   Shusong Jin


===
Add: Meng Wah Complex, RM518 Email: [EMAIL PROTECTED]
 Dept. of Statistics Tel:   (+852)28597942
  and Actuarial Science  fax:   (+852)28589041
 The Univ. of Hong Kong
 Pokfulam Road, Hong Kong

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about biasing in sd()???

2005-03-09 Thread Peter Dalgaard
"Roy Werkman" <[EMAIL PROTECTED]> writes:

> Hi,
>  
> Can anyone help me with the following. I have been using R for Monte
> Carlo simulations and got some results I couldn't explain. Therefor I
> performed following short test:
>  
> --
> mean.sds <- NULL
> sample.sizes <- 3:30
>  
>  for(N in sample.sizes){
>  dum <- NULL
>  for(I in 1:5000){
>   x <- rnorm(N,0,1)
>   dum <- c(dum,sd(x))
>  }
>  mean.sds<- c(mean.sds,mean(dum))
> }
> plot(sample.sizes,mean.sds)
> --
>  
> My question is why don't I get 1 as a result from my sd() for small
> sample sizes? According to the help, sd() is unbiased, which anyway
> would not explain the small offset... Is it something in rnorm()?

According to *what* help? In ?sd, it isn't there and it wouldn't be
true if it was there. Please don't spread rumors like that.

The _variance_, var(x) is unbiased, and sd(x) is the square root of
that. It is not possible for a concave function of an unbiased
estimator to be unbiased (unless you're talking median unbiasedness
which is clearly not the case). This is first-year math-stat theory. 

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 14:57:27 +0100 Ronny Klein wrote:

> Hi,
> 
> I've written a function in order to plot the same graph in a postcript
> and in a pdf file. Unfortunately, the second graph is always empty,
> i.e.:
> 
> plot.both <- function{myplot, filename}{
>   pdf(file=paste(filename, ".pdf", sep=""))
>myplot
>   dev.off()
>   postscript(file=paste(filename, ".eps", sep=""))
>myplot
>   dev.off()
> }
> 
> yields in a correct pdf but an empty eps file. However something like
> this:
> 
> plot.both <- function{myplot1, myplot2, filename}{
>   pdf(file=paste(filename, ".pdf", sep=""))
>myplot1
>   dev.off()
>   postscript(file=paste(filename, ".eps", sep=""))
>myplot2
>   dev.off()
> }
> 
> yields the expected results even if myplot1 and myplot2 are identical.

What are the myplot objects? Expressions or graphical objects that are
printed?

In any case, a good recommendation for this kind of stuff is to look at
Sweave() in the utils package. I guess you're writing your thesis in
LaTeX...and Sweave is a great possibility to mix LaTeX code and R code
which for example generates both pdf and eps graphics.
Z

> Does somebody know, how I can implement the desired (first) function?
> 
> Ronny
> 
> PS: My system is: Linux Debian Unstable and R-Version:  2.0.1.
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Ronny Klein
Hi,

I've written a function in order to plot the same graph in a postcript and in 
a pdf file. Unfortunately, the second graph is always empty, i.e.:

plot.both <- function{myplot, filename}{
  pdf(file=paste(filename, ".pdf", sep=""))
   myplot
  dev.off()
  postscript(file=paste(filename, ".eps", sep=""))
   myplot
  dev.off()
}

yields in a correct pdf but an empty eps file. However something like this:

plot.both <- function{myplot1, myplot2, filename}{
  pdf(file=paste(filename, ".pdf", sep=""))
   myplot1
  dev.off()
  postscript(file=paste(filename, ".eps", sep=""))
   myplot2
  dev.off()
}

yields the expected results even if myplot1 and myplot2 are identical.

Does somebody know, how I can implement the desired (first) function?

Ronny

PS: My system is: Linux Debian Unstable and R-Version:  2.0.1.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Question about biasing in sd()???

2005-03-09 Thread Liaw, Andy
Where in the help file of sd() do you see the claim that it produces
unbiased estimate?  Try the following:

sample.sizes <- 3:30
reps <- 5000
set.seed(1)
mean.vars <- sapply(sample.sizes, 
function(n) mean(sd(matrix(rnorm(n*reps), nc=reps))^2))
plot(sample.sizes,mean.vars)

I.e., the sample variance, or sd()^2, is unbiased for the true variance.  If
U is an unbiased estimator of a parameter theta, f(U) is _not_ necessarily
unbiased for f(theta).  It would be if f() is linear.

Andy


> From: Roy Werkman
> 
> Hi,
>  
> Can anyone help me with the following. I have been using R for Monte
> Carlo simulations and got some results I couldn't explain. Therefor I
> performed following short test:
>  
> --
> mean.sds <- NULL
> sample.sizes <- 3:30
>  
>  for(N in sample.sizes){
>  dum <- NULL
>  for(I in 1:5000){
>   x <- rnorm(N,0,1)
>   dum <- c(dum,sd(x))
>  }
>  mean.sds<- c(mean.sds,mean(dum))
> }
> plot(sample.sizes,mean.sds)
> --
>  
> My question is why don't I get 1 as a result from my sd() for small
> sample sizes? According to the help, sd() is unbiased, which anyway
> would not explain the small offset... Is it something in rnorm()?
>  
> Thanx,
> Roy
> 
> 
> -- 
> The information contained in this communication and any\ >...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Ronny Klein
Hi,

after a lengthy but unsuccessfull search I couldn't come up with a solution to 
the following problem:

I would like to have a "comma" instead of a "point" as the decimal point in my 
graphics, i.e. postscript and pdf files, for I write my thesis in German. My 
system is:

OS: Debian Unstable
R-Version:  2.0.1
System locale: [EMAIL PROTECTED]

Could someone, please, help me out or at least point me to the right 
documentation. I'm just lost at the moment.

Ronny


PS: The problem of displaying the German umlauts, I have already solved: I 
have to use the WinAnsi.enc as the default encoding file. Which is odd in my 
opinion.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Plotting several series on one set of axes

2005-03-09 Thread Marc Schwartz
On Wed, 2005-03-09 at 11:21 +, [EMAIL PROTECTED] wrote:
> Dear All,
> 
> I am rather rusty with my R, but I recall being able to do something like
> plot(x1,...);plot(x2,add=TRUE,...)
> to plot two series on the same axes.
> 
> Any suggestions how this may be done will be appreciated.

If you have several series with common axes, you can use matplot() and
do it with a single function call.

See ?matplot for more information.

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Question about biasing in sd()???

2005-03-09 Thread Roy Werkman
Hi,
 
Can anyone help me with the following. I have been using R for Monte
Carlo simulations and got some results I couldn't explain. Therefor I
performed following short test:
 
--
mean.sds <- NULL
sample.sizes <- 3:30
 
 for(N in sample.sizes){
 dum <- NULL
 for(I in 1:5000){
  x <- rnorm(N,0,1)
  dum <- c(dum,sd(x))
 }
 mean.sds<- c(mean.sds,mean(dum))
}
plot(sample.sizes,mean.sds)
--
 
My question is why don't I get 1 as a result from my sd() for small
sample sizes? According to the help, sd() is unbiased, which anyway
would not explain the small offset... Is it something in rnorm()?
 
Thanx,
Roy


-- 
The information contained in this communication and any atta...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] multiple comparisons for lme using multcomp

2005-03-09 Thread Michaël Coeurdassier
Dear R-help list,

I would like to perform multiple comparisons for lme.  Can you report to me 
if my way to is correct or not?  Please, note that I am not nor a 
statistician nor a mathematician, so, some understandings are sometimes 
quite hard for me.   According to the previous helps on the topic in R-help 
list May 2003 (please, see Torsten Hothorn advices) and books such as 
Venables & Ripley or Pinheiro & Bates. I need multcomp library. I followed 
the different examples and get these results :

In this example, response is the mass of earthworms after one month of 
exposure to different concentrations of pollutants (treatment). The 
experimental design was three containers per treatment with five animals in 
each container (or less if mortality occurred). Containers were referred as 
box and considered as the random variable.

 > tab<-read.delim("example1.txt")
 > tab
treatment box response
1control   a  1.8
2control   a  2.3
3control   a  1.3
4control   a  0.8
5control   a  2.0
6control   b  1.1
7control   b  2.2
8control   b  1.3
9control   b  2.0
10   control   b  1.3
11   control   c  1.5
12   control   c  1.4
13   control   c  2.1
14   control   c  1.7
15   control   c  1.3
16 Al100   d  1.6
17 Al100   d  2.1
18 Al100   d  0.7
19 Al100   d  1.8
20 Al100   d  1.2
21 Al100   e  1.5
22 Al100   e  1.5
23 Al100   e  2.0
24 Al100   e  1.0
25 Al100   e  1.6
26 Al100   f  0.9
27 Al100   f  2.0
28 Al100   f  1.9
29 Al100   f  1.7
30 Al100   f  1.7
…
68 Al800   q  1.0
69 Al800   r  0.8
70 Al800   r  0.9
71 Al800   r  0.9
72 Al800   r  0.6
73 Al800   s  0.9
74 Al800   s  1.0
75 Al800   s  0.8
76 Al800   s  0.8
77 Al800   s  0.7

 > attach(tab)
 > library(nlme)
 > lm1<-lme(response~treatment,random=~1|box)
 > library(multcomp)
Loading required package: mvtnorm

 > # first way to do (seem uncorrect)
 > summary(csimtest(coef(lm1),vcov(lm1),cmatrix=contrMat(table(treatment),
type="Tukey"),df=59))
Error in csimtest(coef(lm1), vcov(lm1), cmatrix = 
contrMat(table(treatment), : estpar not a vector

 > #indeed
 > coef(lm1)
   (Intercept) treatmentAl200 treatmentAl400 treatmentAl600 treatmentAl800
a1.546679 -0.1648540 -0.4895219 -0.6383375 -0.7066632
b1.546657 -0.1648540 -0.4895219 -0.6383375 -0.7066632
c1.546664 -0.1648540 -0.4895219 -0.6383375 -0.7066632
d1.546643 -0.1648540 -0.4895219 -0.6383375 -0.7066632
…
s1.546667 -0.1648540 -0.4895219 -0.6383375 -0.7066632
   treatmentcontrol
a 0.06
b 0.06
c 0.06
d 0.06
…
s 0.06

 > # second way to do could be to get a vector for lm1 coefficient removing 
intercept(is it correct?)
 > vect<-as.numeric(coef(lm1)[1,])
 > vect
[1]  1.5466787 -0.1648540 -0.4895219 -0.6383375 -0.7066632  0.060
 > 
summary(csimtest(vect,vcov(lm1),cmatrix=contrMat(table(treatment),type="Tukey"),df=59))

  Simultaneous tests: user-defined contrasts

  user-defined contrasts for factor

Contrast matrix:
   Al100 Al200 Al400 Al600 Al800 control
Al200-Al100  -1 1 0 0 0   0
Al400-Al100  -1 0 1 0 0   0
Al600-Al100  -1 0 0 1 0   0
Al800-Al100  -1 0 0 0 1   0
control-Al100-1 0 0 0 0   1
Al400-Al200   0-1 1 0 0   0
Al600-Al200   0-1 0 1 0   0
Al800-Al200   0-1 0 0 1   0
control-Al200 0-1 0 0 0   1
Al600-Al400   0 0-1 1 0   0
Al800-Al400   0 0-1 0 1   0
control-Al400 0 0-1 0 0   1
Al800-Al600   0 0 0-1 1   0
control-Al600 0 0 0-1 0   1
control-Al800 0 0 0 0-1   1


Absolute Error Tolerance:  0.001

Coefficients:
   Estimate t value Std.Err. p raw p Bonf p adj
Al800-Al100 -2.253 -10.4670.213 0.000  0.000 0.000
Al600-Al100 -2.185 -10.3890.207 0.000  0.000 0.000
Al400-Al100 -2.036  -9.8500.210 0.000  0.000 0.000
Al200-Al100 -1.712  -8.0510.215 0.000  0.000 0.000
control-Al100   -1.487  -7.2430.205 0.000  0.000 0.000
control-Al8000.767  -5.2820.143 0.000  0.000 0.000
control-Al6000.698  -5.0720.148 0.000  0.000 0.000
control-Al4000.550  -4.1600.155 0.000  0.001 0.001
Al800-Al200 -0.542  -3.4880.141 0.001  0.006 0.006
Al600-Al200 -0.473  -3.1910.140 0.002  0.014 0.012
Al400-Al200 -0.325  -2.2670.147 0.027  0.135 0.110
control-Al2000.225  -1.5930.132 0.116  0.466 0.341
Al800

Re: [R] RSPYTHON install failed on Mac

2005-03-09 Thread Prof Brian Ripley
Without seeing config.log, we have no more idea than you do.
This is an Omegahat package, and either its list or the R-sig-mac list 
would be far more appropriate than this one.  But I suspect the answer is 
clear from config.log -- unpack the package before installing to see it.

On Wed, 9 Mar 2005, Zhesi He wrote:
Dear all,
I was trying to install RSPYTHON on my Mac OS X 10.3 into R, and got the 
following errors, is it because of my C compiler or the python I installed?

R CMD INSTALL -c Desktop/RSPython_0.5-4.tar.gz
* Installing *source* package 'RSPython' ...
checking for python... /usr/bin/python
Python version 2.3
Using threads
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot 
create executables
See `config.log' for more details.
ERROR: configuration failed for package 'RSPython'
** Removing '/Applications/StartR.app/RAqua.app/Contents/library/RSPython'
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] nnet abstol

2005-03-09 Thread Kemp S E \(Comp\)
Hi,

I am using nnet to learn transfer functions. For each transfer function I can 
estimate the best possible Mean Squared Error (MSE). So, rather than trying to 
grind the MSE to 0, I would like to use abstol to stop training once the best 
MSE is reached.

Can anyone confirm that the abstol parameter in the nnet function is the MSE, 
or is it the Sum-of-Squares (SSE)?

Best regards,

Sam.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Trouble with mixreg

2005-03-09 Thread max.marinucci
Dear All
I am trying to estimate a mixture of regression and get the
following error using the mixreg package:

Error in y - yhat : non-conformable arrays

The instruction I used were:
x <- as.matrix(LRHUN)
y <- as.matrix(LRINTER)

TS  <- list(list(beta=c(3.0,1.0),sigsq=1,lambda=0.4),
list(beta=c(0.0,1.0),sigsq=1,lambda=0.6))

prova <- mixreg(x,y, ncomp=2, theta.start=TS)

The data set has about 1200 observations.
I checked out that x and y have the same number of obs.
Also examples work fine.

Any hints on what is going on? Thanks
best regards
M

**
Massimiliano Marinucci
http://personales.ya.com/max_mar/
Ph.D Candidate in Economics
Fundamentos del Analisis Económico II
(Economía Cuantitativa)
Facultad de CC.EE.
Universidad Complutense Madrid
Campus de Somosaguas
Madrid - Spain
**


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RMySQL installed but not availalable

2005-03-09 Thread Arne Henningsen
Did you _load_ the package?
R> library( RMySQL )

On Thursday 10 March 2005 10:12, Adriano von Sydow wrote:
> Hi
> I run Linux SuSE 9.1, with MSQL 4.0.18
> I installed R 2.0.1 and it is working fine
> I installed RM 0.5-5 package and verified all installed.packages (see
> below) but when I tried to use any RMySQL specific comand is gives me
> the same error messages
>
>  > dbConnect
>
> Error: Object "dbConnect" not found
>
> It looks like the  packages is not installed
>
> Any ideas or help would be welcome
> Thanks,
> Popolito
>
> *** INSTALL *
> ginossauro:/home/avonsydow/Download/Stats # R CMD INSTALL
> RMySQL_0.5-5.tar.gz
> * Installing *source* package 'RMySQL' ...
> creating cache ./config.cache
> checking how to run the C preprocessor... cc -E
> checking for compress in -lz... yes
> checking for getopt_long in -lc... yes
> checking for mysql_init in -lmysqlclient... yes
> checking for mysql.h... no
> checking for /usr/local/include/mysql/mysql.h... no
> checking for /usr/include/mysql/mysql.h... yes
> updating cache ./config.cache
> creating ./config.status
> creating src/Makevars
> ** libs
> gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include
> -I/opt/gnome/
> include   -fPIC   -c RS-DBI.c -o RS-DBI.o
> gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include
> -I/opt/gnome/
> include   -fPIC   -c RS-MySQL.c -o RS-MySQL.o
> gcc -shared -L/usr/local/lib -L/opt/gnome/lib -o RMySQL.so RS-DBI.o
> RS-MySQL.o -
> lmysqlclient -lz  -L/usr/lib/R/lib -lR
> ** R
> ** inst
> ** save image
> Loading required package: DBI
> [1] "dbObjectId"
> [1] "format"
> [1] "show"
> [1] "print"
> [1] "MySQLObject"
> [1] "MySQLDriver"
> [1] "dbUnloadDriver"
> [1] "dbGetInfo"
> [1] "dbListConnections"
> [1] "summary"
> [1] "MySQLConnection"
> [1] "dbConnect"
> [1] "dbConnect"
> [1] "dbConnect"
> [1] "dbDisconnect"
> [1] "dbSendQuery"
> [1] "dbGetQuery"
> [1] "dbGetException"
> [1] "dbGetInfo"
> [1] "dbListResults"
> [1] "summary"
> [1] "dbListTables"
> [1] "dbReadTable"
> [1] "dbWriteTable"
> [1] "dbExistsTable"
> [1] "dbRemoveTable"
> [1] "dbListFields"
> [1] "dbCommit"
> [1] "dbRollback"
> [1] "dbCallProc"
> [1] "MySQLResult"
> [1] "dbClearResult"
> [1] "fetch"
> [1] "fetch"
> [1] "dbGetInfo"
> [1] "dbGetStatement"
> [1] "dbListFields"
> [1] "dbColumnInfo"
> [1] "dbGetRowsAffected"
> [1] "dbGetRowCount"
> [1] "dbHasCompleted"
> [1] "dbGetException"
> [1] "summary"
> [1] "dbDataType"
> [1] "make.db.names"
> [1] "SQLKeywords"
> [1] "isSQLKeyword"
> [1] "dbApply"
> [1] "dbApply"
>
> ** help
>
>  >>> Building/Updating help pages for package 'RMySQL'
>
>  Formats: text html latex example
>   MySQL texthtmllatex   example
>   MySQLConnection-class texthtmllatex   example
>   MySQLDriver-class texthtmllatex   example
>   MySQLObject-class texthtmllatex   example
>   MySQLResult-class texthtmllatex   example
>   S4R   texthtmllatex
>   dbApply-methods   texthtmllatex   example
>   dbApply   texthtmllatex   example
>   dbCallProc-methodstexthtmllatex
>   dbCommit-methods  texthtmllatex   example
>   dbConnect-methods texthtmllatex   example
>   dbDataType-methodstexthtmllatex   example
>   dbDriver-methods  texthtmllatex   example
>   dbGetInfo-methods texthtmllatex   example
>   dbListTables-methods  texthtmllatex   example
>   dbObjectId-class  texthtmllatex   example
>   dbReadTable-methods   texthtmllatex   example
>   dbSendQuery-methods   texthtmllatex   example
>   dbSetDataMappings-methods texthtmllatex   example
>   fetch-methods texthtmllatex   example
>   isIdCurrent   texthtmllatex   example
>   make.db.names-methods texthtmllatex   example
>   mysqlDBApply  texthtmllatex   example
>   mysqlSupport  texthtmllatex
>   safe.writetexthtmllatex   example
>   summary-methods   texthtmllatex
> * DONE (RMySQL)
>
>
>
> *INSTALLED.PACKAGES ***
>
>  > installed.packages()
>
>Package  LibPath  Version   Priority  Bundle
> base   "base"   "/usr/lib/R/library" "2.0.1"   "base"NA
> boot   "boot"   "/usr/lib/R/library" "1.2-20"  "recommended" NA
> class  "class"  "/usr/lib/R/library" "7.2-10"  "recommended" "VR"
> cluster"cluster""/usr/lib/R/library" "1.9.6"   "recommended" NA
> datasets   "datasets"   "/usr/lib/R/library" "2.0.1"   "base"NA
> DBI"DBI""/usr/lib

Re: [R] Plotting several series on one set of axes

2005-03-09 Thread Witold Eryk Wolski
[EMAIL PROTECTED] wrote:
Dear All,
I am rather rusty with my R, but I recall being able to do something like
plot(x1,...);plot(x2,add=TRUE,...)
to plot two series on the same axes.
Any suggestions how this may be done will be appreciated.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

?lines
?points
par(new=TRUE)
cheers
Eryk
--
Witold Eryk Wolski
__("<  School of Mathematics and Statistics _
\__/   University of Newcastle 'v'
||Newcastle upon Tyne, NE1 7RU, ENGLAND  /   \
^^mail: [EMAIL PROTECTED] m m
  Phone : 044 (0)191 222 5376
  FAX   : 044 (0)191 222 8020
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] RSPYTHON install failed on Mac

2005-03-09 Thread Zhesi He
Dear all,
I was trying to install RSPYTHON on my Mac OS X 10.3 into R, and got 
the following errors, is it because of my C compiler or the python I 
installed?

R CMD INSTALL -c Desktop/RSPython_0.5-4.tar.gz
* Installing *source* package 'RSPython' ...
checking for python... /usr/bin/python
Python version 2.3
Using threads
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler 
cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package 'RSPython'
** Removing 
'/Applications/StartR.app/RAqua.app/Contents/library/RSPython'

Thanks in advance.
___
Zhesi He
Computational Biology Laboratory, University of York
York YO10 5YW, U.K.
Phone:  +44-(0)1904-328279
Email:  [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Plotting several series on one set of axes

2005-03-09 Thread midnightsun
Dear All,

I am rather rusty with my R, but I recall being able to do something like
plot(x1,...);plot(x2,add=TRUE,...)
to plot two series on the same axes.

Any suggestions how this may be done will be appreciated.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] msm version 0.5 released

2005-03-09 Thread Chris Jackson
A major update of the "msm" package for continuous-time Markov and
hidden Markov multi-state models is now available from CRAN.
Hidden Markov models with general, continuous response distributions are
now supported.  These models are used for Markov processes which can
only be observed through the value of some noisy marker.
Censored states are now supported at any observation time.  The
observation scheme is also allowed to be different for each observation,
for example, process snapshot / fully-observed histories /
partially-observed histories such as death times.
Users upgrading from previous versions of msm should note that
some of the syntax for specifying models has changed.  In particular,
initial values are now specified in the "qmatrix" and "covinits"
arguments instead of the inits argument, so that "qmatrix" is no longer
a matrix of 0/1 indicators.
As always, refer to the user guide "msm-manual.pdf" in the "doc"
subdirectory for a full description of the methodology, and worked
examples in the use of the package.  See the appendix for a full
list of the syntax changes, and the NEWS file in the top-level
installation directory for a full list of the changes in this release.
--
Christopher Jackson <[EMAIL PROTECTED]>, Research Associate,
Department of Epidemiology and Public Health, Imperial College
School of Medicine, Norfolk Place, London W2 1PG, tel. 020 759 43371
___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] plot(bclust) what is the 2nd plot?

2005-03-09 Thread Friedrich . Leisch
> On Wed, 9 Mar 2005 10:36:49 -,
> Jacqueline Hall (JH) wrote:

  > Hi everyone,
  > Currently i'm trying to understand the bagged clustering algorithm, bclust
  > {e1071}. 
 
  > When I run the given example in the help file (as below)
  >   data(iris)
  >  bc1 <- bclust(iris[,1:4], 3, base.centers=5)
  >  plot(bc1)

  > and plot the bclust object, 2 graphs are produced. 
  > The first is a dendrogram, but what is the second plot? The axes are not
  > labelled and what do the two lines represent?

 
The monotonic decreasing line gives the relative height of the split
of tyhe tree into 2, 3, etc. branches, the second line is the first
differences of the first. A peak in the differencescan be used as a
crude estimation for the number of clusters.

  > I tried looking in the URL
  > given in the references but that didn't help.

Look at Section IV.A of the working paper.

HTH,

-- 
---
Friedrich Leisch 
Institut für Statistik Tel: (+43 1) 58801 10715
Technische Universität WienFax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] plot(bclust) what is the 2nd plot?

2005-03-09 Thread Jacqueline Hall
Hi everyone,
 
Currently i'm trying to understand the bagged clustering algorithm, bclust
{e1071}. 
 
When I run the given example in the help file (as below)
  data(iris)
 bc1 <- bclust(iris[,1:4], 3, base.centers=5)
 plot(bc1)

and plot the bclust object, 2 graphs are produced. 
The first is a dendrogram, but what is the second plot? The axes are not
labelled and what do the two lines represent? I tried looking in the URL
given in the references but that didn't help.
 
Thanks for your help!
 
Jacqui Hall
 
 



[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] To convert an adjacency list model into a nested set model

2005-03-09 Thread Martin Maechler
> "Gabor" == Gabor Grothendieck <[EMAIL PROTECTED]>
> on Tue, 8 Mar 2005 17:19:12 + (UTC) writes:

<..>

Gabor> This is not a direct answer to getting a nesting from
Gabor> an adjacency but the following is easy to do and
Gabor> gives all the same info.


Gabor> Note that if A is the adjacency matrix of children
Gabor> (rows) and ] parents (columns) then A^n is the matrix
Gabor> defining ancestors n generations away and exp(A) is a
Gabor> weighted version of that with A^i weighted by i!
Gabor> (These expressions are mathematics, not R.)  Thus:

Gabor> empf <- factor(emp, level = union(emp, boss))  # emp as factor
Gabor> bossf <- factor(boss, level = union(emp, boss)) # ditto for boss

Gabor> adj <- table(empf, bossf)  # i,j is 1 if j is boss of i

Gabor> library(rmutil)  # http://popgen.unimaas.nl/~jlindsey/rcode.html
Gabor> mexp(adj, type = "series") - diag(length(empf))

just a note on the matrix exponential:

The Matrix package (from CRAN) now also has the matrix
exponential,  expm(.) , 
using the ''least dubious '' algorithm of

  Moler, C. and Van Loan C. (2003)
  "Ninteen dubious ways to compute the exponential of a
   matrix, twenty-five years later".
  SIAM review 45, 3--49

namely the one also in use by Matlab and Octave

So the above would be something like

library(Matrix)
expm( as(adj, "dgeMatrix") ) - as(diag(length(empf)), "dgeMatrix")


Gabor> giving a matrix whose i,j-th entry is 1/n! if j is
Gabor> n-generations above i.

Gabor> From that you can get the info you need.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] RMySQL installed but not availalable

2005-03-09 Thread Mulholland, Tom
I don't use MySQL but I have seen messages like this before. They often have 
replies which indicate that you need to follow the instructions more closely. I 
suggest you search the list for these previous posts as I'm sure there is help 
there, somewhere!

Tom

> -Original Message-
> From: Adriano von Sydow [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 10 March 2005 5:13 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] RMySQL installed but not availalable
> 
> 
> Hi
> I run Linux SuSE 9.1, with MSQL 4.0.18
> I installed R 2.0.1 and it is working fine
> I installed RM 0.5-5 package and verified all installed.packages (see 
> below) but when I tried to use any RMySQL specific comand is gives me 
> the same error messages
> 
>  > dbConnect
> Error: Object "dbConnect" not found
> 
> It looks like the  packages is not installed
> 
> Any ideas or help would be welcome
> Thanks,
> Popolito
> 
> *** INSTALL *
> ginossauro:/home/avonsydow/Download/Stats # R CMD INSTALL 
> RMySQL_0.5-5.tar.gz
> * Installing *source* package 'RMySQL' ...
> creating cache ./config.cache
> checking how to run the C preprocessor... cc -E
> checking for compress in -lz... yes
> checking for getopt_long in -lc... yes
> checking for mysql_init in -lmysqlclient... yes
> checking for mysql.h... no
> checking for /usr/local/include/mysql/mysql.h... no
> checking for /usr/include/mysql/mysql.h... yes
> updating cache ./config.cache
> creating ./config.status
> creating src/Makevars
> ** libs
> gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include 
> -I/opt/gnome/
> include   -fPIC   -c RS-DBI.c -o RS-DBI.o
> gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include 
> -I/opt/gnome/
> include   -fPIC   -c RS-MySQL.c -o RS-MySQL.o
> gcc -shared -L/usr/local/lib -L/opt/gnome/lib -o RMySQL.so RS-DBI.o 
> RS-MySQL.o -
> lmysqlclient -lz  -L/usr/lib/R/lib -lR
> ** R
> ** inst
> ** save image
> Loading required package: DBI
> [1] "dbObjectId"
> [1] "format"
> [1] "show"
> [1] "print"
> [1] "MySQLObject"
> [1] "MySQLDriver"
> [1] "dbUnloadDriver"
> [1] "dbGetInfo"
> [1] "dbListConnections"
> [1] "summary"
> [1] "MySQLConnection"
> [1] "dbConnect"
> [1] "dbConnect"
> [1] "dbConnect"
> [1] "dbDisconnect"
> [1] "dbSendQuery"
> [1] "dbGetQuery"
> [1] "dbGetException"
> [1] "dbGetInfo"
> [1] "dbListResults"
> [1] "summary"
> [1] "dbListTables"
> [1] "dbReadTable"
> [1] "dbWriteTable"
> [1] "dbExistsTable"
> [1] "dbRemoveTable"
> [1] "dbListFields"
> [1] "dbCommit"
> [1] "dbRollback"
> [1] "dbCallProc"
> [1] "MySQLResult"
> [1] "dbClearResult"
> [1] "fetch"
> [1] "fetch"
> [1] "dbGetInfo"
> [1] "dbGetStatement"
> [1] "dbListFields"
> [1] "dbColumnInfo"
> [1] "dbGetRowsAffected"
> [1] "dbGetRowCount"
> [1] "dbHasCompleted"
> [1] "dbGetException"
> [1] "summary"
> [1] "dbDataType"
> [1] "make.db.names"
> [1] "SQLKeywords"
> [1] "isSQLKeyword"
> [1] "dbApply"
> [1] "dbApply"
> 
> ** help
>  >>> Building/Updating help pages for package 'RMySQL'
>  Formats: text html latex example
>   MySQL texthtmllatex   example
>   MySQLConnection-class texthtmllatex   example
>   MySQLDriver-class texthtmllatex   example
>   MySQLObject-class texthtmllatex   example
>   MySQLResult-class texthtmllatex   example
>   S4R   texthtmllatex
>   dbApply-methods   texthtmllatex   example
>   dbApply   texthtmllatex   example
>   dbCallProc-methodstexthtmllatex
>   dbCommit-methods  texthtmllatex   example
>   dbConnect-methods texthtmllatex   example
>   dbDataType-methodstexthtmllatex   example
>   dbDriver-methods  texthtmllatex   example
>   dbGetInfo-methods texthtmllatex   example
>   dbListTables-methods  texthtmllatex   example
>   dbObjectId-class  texthtmllatex   example
>   dbReadTable-methods   texthtmllatex   example
>   dbSendQuery-methods   texthtmllatex   example
>   dbSetDataMappings-methods texthtmllatex   example
>   fetch-methods texthtmllatex   example
>   isIdCurrent   texthtmllatex   example
>   make.db.names-methods texthtmllatex   example
>   mysqlDBApply  texthtmllatex   example
>   mysqlSupport  texthtmllatex
>   safe.writetexthtmllatex   example
>   summary-methods   texthtmllatex
> * DONE (RMySQL)
> 
> 
> 
> *INSTALLED.PACKAGES ***
> 
>  > installed.packages()
>Package  LibPath  Version   
> Priority  Bundle
> base   "base"   "/usr/

RE: [R] from long/lat to UTM

2005-03-09 Thread Mulholland, Tom
I think I recall seeing a limited capability in the PBSmapping package.

Tom

> -Original Message-
> From: yyan liu [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 9 March 2005 1:20 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] from long/lat to UTM
> 
> 
> Hi:
>   Is there any function in R which can convert the
> long/lat to UTM(Universal Transverse Mercator)?
>   There are quite a few converters on Internet.
> However, the interface is designed as input->output
> which I can not convert lots of locations at the same
> time.
>   Another question is whether there is a function in R
> which can tell the time zone from the location's
> lat/long?
>   Thank you!
> 
> liu
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Using RCC (R to C Compiler)

2005-03-09 Thread Aleš Žiberna
Hello!
I would like to know if anyone has any experience in using RCC (R to C
Compiler) [http://hipersoft.cs.rice.edu/rcc/index.html].
I thing I have successfully compiled both RCC and R 1.9.0 following the 
instructions on the RCC web site. However, I have no idea how to actually 
use it.


I found no instructions either on the web page or the authors master's 
thesis. I have also tried to contact the author, however, I got no reply.


Therefore I would be very grateful for any information on how to actually 
use RCC.

Thank you in advance!
Ales Ziberna
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] RMySQL installed but not availalable

2005-03-09 Thread Adriano von Sydow
Hi
I run Linux SuSE 9.1, with MSQL 4.0.18
I installed R 2.0.1 and it is working fine
I installed RM 0.5-5 package and verified all installed.packages (see 
below) but when I tried to use any RMySQL specific comand is gives me 
the same error messages

> dbConnect
Error: Object "dbConnect" not found
It looks like the  packages is not installed
Any ideas or help would be welcome
Thanks,
Popolito
*** INSTALL *
ginossauro:/home/avonsydow/Download/Stats # R CMD INSTALL 
RMySQL_0.5-5.tar.gz
* Installing *source* package 'RMySQL' ...
creating cache ./config.cache
checking how to run the C preprocessor... cc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... yes
checking for mysql.h... no
checking for /usr/local/include/mysql/mysql.h... no
checking for /usr/include/mysql/mysql.h... yes
updating cache ./config.cache
creating ./config.status
creating src/Makevars
** libs
gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include 
-I/opt/gnome/
include   -fPIC   -c RS-DBI.c -o RS-DBI.o
gcc -I/usr/lib/R/include -I/usr/include/mysql -I/usr/local/include 
-I/opt/gnome/
include   -fPIC   -c RS-MySQL.c -o RS-MySQL.o
gcc -shared -L/usr/local/lib -L/opt/gnome/lib -o RMySQL.so RS-DBI.o 
RS-MySQL.o -
lmysqlclient -lz  -L/usr/lib/R/lib -lR
** R
** inst
** save image
Loading required package: DBI
[1] "dbObjectId"
[1] "format"
[1] "show"
[1] "print"
[1] "MySQLObject"
[1] "MySQLDriver"
[1] "dbUnloadDriver"
[1] "dbGetInfo"
[1] "dbListConnections"
[1] "summary"
[1] "MySQLConnection"
[1] "dbConnect"
[1] "dbConnect"
[1] "dbConnect"
[1] "dbDisconnect"
[1] "dbSendQuery"
[1] "dbGetQuery"
[1] "dbGetException"
[1] "dbGetInfo"
[1] "dbListResults"
[1] "summary"
[1] "dbListTables"
[1] "dbReadTable"
[1] "dbWriteTable"
[1] "dbExistsTable"
[1] "dbRemoveTable"
[1] "dbListFields"
[1] "dbCommit"
[1] "dbRollback"
[1] "dbCallProc"
[1] "MySQLResult"
[1] "dbClearResult"
[1] "fetch"
[1] "fetch"
[1] "dbGetInfo"
[1] "dbGetStatement"
[1] "dbListFields"
[1] "dbColumnInfo"
[1] "dbGetRowsAffected"
[1] "dbGetRowCount"
[1] "dbHasCompleted"
[1] "dbGetException"
[1] "summary"
[1] "dbDataType"
[1] "make.db.names"
[1] "SQLKeywords"
[1] "isSQLKeyword"
[1] "dbApply"
[1] "dbApply"

** help
>>> Building/Updating help pages for package 'RMySQL'
Formats: text html latex example
 MySQL texthtmllatex   example
 MySQLConnection-class texthtmllatex   example
 MySQLDriver-class texthtmllatex   example
 MySQLObject-class texthtmllatex   example
 MySQLResult-class texthtmllatex   example
 S4R   texthtmllatex
 dbApply-methods   texthtmllatex   example
 dbApply   texthtmllatex   example
 dbCallProc-methodstexthtmllatex
 dbCommit-methods  texthtmllatex   example
 dbConnect-methods texthtmllatex   example
 dbDataType-methodstexthtmllatex   example
 dbDriver-methods  texthtmllatex   example
 dbGetInfo-methods texthtmllatex   example
 dbListTables-methods  texthtmllatex   example
 dbObjectId-class  texthtmllatex   example
 dbReadTable-methods   texthtmllatex   example
 dbSendQuery-methods   texthtmllatex   example
 dbSetDataMappings-methods texthtmllatex   example
 fetch-methods texthtmllatex   example
 isIdCurrent   texthtmllatex   example
 make.db.names-methods texthtmllatex   example
 mysqlDBApply  texthtmllatex   example
 mysqlSupport  texthtmllatex
 safe.writetexthtmllatex   example
 summary-methods   texthtmllatex
* DONE (RMySQL)

*INSTALLED.PACKAGES ***
> installed.packages()
  Package  LibPath  Version   Priority  Bundle
base   "base"   "/usr/lib/R/library" "2.0.1"   "base"NA
boot   "boot"   "/usr/lib/R/library" "1.2-20"  "recommended" NA
class  "class"  "/usr/lib/R/library" "7.2-10"  "recommended" "VR"
cluster"cluster""/usr/lib/R/library" "1.9.6"   "recommended" NA
datasets   "datasets"   "/usr/lib/R/library" "2.0.1"   "base"NA
DBI"DBI""/usr/lib/R/library" "0.1-8"   NANA
foreign"foreign""/usr/lib/R/library" "0.8-0"   "recommended" NA
graphics   "graphics"   "/usr/lib/R/library" "2.0.1"   "base"NA
grDevices  "grDevices"  "/usr/lib/R/library" "2.0.1"   "base"NA
grid   "grid"   "/usr/lib/R/library" "2.0.1"   "base"NA
KernSmooth "KernSmooth" "/usr/lib/R/library" "2.22-14" "recommended" NA
lattice"lat

[R] R-2.0.1 Gentoo g77 problem

2005-03-09 Thread Gabriel Rossetti
Hello,

I use Gentoo and I can't get R 2.0.1 to compile. I used the portage system, 
Gentoo's source package sytem, and after it uncompresses the source to R, it 
says that I don't have a fortran compiler. It told me to use f77 flag and 
re-emerge gcc, which I did with the f77 and fortran flags, but it still won't 
compile. Does anyone have any ideas? I suspect that gcc has changed it's 
interworkings, because if I do a gcc -v it says that I can compile fortran(f77) 
programs, but I don't have g77. If anyone has any ideas or workarounds, it 
would be great. I really need it for a P&S class. Thanks!

Gabriel

My gcc version is : 
gcc version 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
--

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html