Re: [R] Problem installing packages in R 2.4.1

2007-03-21 Thread Uwe Ligges


Paul Gottemoller wrote:
> I am attempting to install a anchoring vingettes package for R and I seem to
> have a problem with unzipping the files in R.  I use the command that can be
> found here .
> 
> Here is the dialog I get after entering the command:
> 
>> install.packages("anchors", dependencies = TRUE,
> + repos=c("http://wand.stanford.edu/R/CRAN","http://cran.r-project.org
> "))
> dependency ''snow'' is not available
> 
> also installing the dependency 'rgenoud'
> 
> trying URL '
> http://cran.r-project.org/bin/windows/contrib/2.4/rgenoud_5.0-5.zip'
> Content type 'application/zip' length 113709 bytes
> opened URL
> downloaded 111Kb
> 
> trying URL '
> http://wand.stanford.edu/R/CRAN/bin/windows/contrib/2.4/anchors_2.0.zip'
> Content type 'application/zip' length 592348 bytes
> opened URL
> downloaded 578Kb
> 
> Error in zip.unpack(pkg, tmpDir) : cannot open file 'C:/Program Files/R/R-
> 2.4.1/library/file20a84af3/rgenoud/chtml/rgenoud.chm'
>
> Any help would be greatly appreciated.  Thank you in advance.
> 


Which version of Windows? If Vista, you might need to overcome some 
security issues and remember to install a package into a library within 
c:\Program Files with Administrator privileges.
If another version of Windows, please retry to install rgenoud and 
remove any prior versions manually, the binary package on CRAN is fine.

Uwe Ligges

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem with RCurl install on Unix

2007-03-21 Thread Prof Brian Ripley

What is 'Unix' here?  It seems you mean ppc64 Linux (which is not Unix).

On Wed, 21 Mar 2007, Mark W Kimpel wrote:


I am having trouble getting an install of RCurl to work properly on a
Unix server. The steps I have taken are:

1. installed cUrl from source without difficulty
2. installed RCurl from source using the command
~/R_HOME/R-devel/bin/R CMD INSTALL -l ~/R_HOME/R-devel/library
~/RCurl_0.8-0.tar.gz I received no errors during this install
3. when I go back to R and require(RCurl), I get

> require(RCurl)
Loading required package: RCurl
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
'/N/u/mkimpel/BigRed/R_HOME/R-devel/library/RCurl/libs/RCurl.so':
  libcurl.so.4: cannot open shared object file: No such file or directory
°1§ FALSE

Outside of R I get

mkimpelàBigRed:¨/R_HOME/R-devel/library/RCurl/libs> ls
RCurl.so

I can cat into RCurl and I have even done chmod a+x RCurl.so in case
there was a problem with permission for R to open the file.


Please do read the message it gave, which is not about opening RCurl.so. 
It is saying that libcurl.so.4 is not found by the run-time linker. 
Probably you installed it into a directory that is not cached by ldconfig, 
so where did you install it?  (One possible issue is lib64 vs lib.)




Below is my sessionInfo. Thanks, Mark

> sessionInfo()
R version 2.5.0 Under development (unstable) (2007-03-11 r40824)
powerpc64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
°1§ "stats" "graphics"  "grDevices" "datasets"  "utils" "tools"
°7§ "methods"   "base"

other attached packages:
limma  affyaffyio   Biobase
 "2.9.13" "1.13.14"   "1.3.3" "1.13.39"
>






--
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] dynamic linear models in R

2007-03-21 Thread Gavin Simpson
On Wed, 2007-03-21 at 23:58 -0400, Johann Hibschman wrote:
> Hi all,
> 
> I've just started working my way through Mike West and Jeff Harrison's
> _Bayesian Forecasting and Dynamic Models_, and I was wondering if
> there were any publically-available packages to handle dynamic linear
> models, as they describe.

Johann,

The one I'm most familiar with is package dlm by Giovanni Petris. There
is also package sspir by Claus Dethlefsen and Søren Lundbye-Christensen.
Both packages are on CRAN.

I have been using dlm for some recent DLM analysis I was doing and have
found it reasonably easy to use and the maintainer, Giovanni Petris, has
been extremely patient and helpful with the odd question I have had
about how to specify the models I wanted in dlm.

sspir has a formula interface so it may be easier to specify models in
it than dlm, but I have no experience of sspir in use.

HTH

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [t] +44 (0)20 7679 0522
ECRC  [f] +44 (0)20 7679 0565
UCL Department of Geography
Pearson Building  [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street
London, UK[w] http://www.ucl.ac.uk/~ucfagls/
WC1E 6BT  [w] http://www.freshwaters.org.uk/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Arrellano Bond and Blundell and Bond estimators in R

2007-03-21 Thread justin bem
Hi all,

Is there a package to estimate Arrellano Bond
estimator and blundelll and bond system estimator for
dynamic panel in R ?

Best regards.

Justin BEM
Elève Ingénieur Statisticien Economiste
BP 294 Yaoundé.
Tél (00237)9597295.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R difftime function: How can we fix the difftime unit?

2007-03-21 Thread Marc Schwartz
On Thu, 2007-03-22 at 11:33 +0530, d. sarthi maheshwari wrote:
> Hi,
> 
> I am trying to take difference of two time objects. I want to fix the
> result's unit to minutes. How can I do that?
> 
> Here is an example:
> 
> > difftime(x, y)
> Time difference of 2.030720 hours
> > difftime(x, z)
> Time difference of 30.34672 mins
> 
> where x = '2007-03-05 08:32:58'
>   y = '2007-03-05 06:31:07'
> andz = '2007-03-05 08:02:37'
> 
> How can I get answer something like
> 
> for (x-y)
> Time difference of 121.8432 mins
> 
> and for (x-z)
> Time difference of 30.34672 mins
> 
> Kindly help.


See ?difftime and take note of the 'units' argument:

> difftime(x, y, units = "mins")
Time difference of 121.85 mins

> difftime(x, z, units = "mins")
Time difference of 30.35 mins

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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R difftime function: How can we fix the difftime unit?

2007-03-21 Thread Frede Aakmann Tøgersen
That's easy:
 
difftime(x, y, units = "min")
 
Best regards
 
Frede



Fra: [EMAIL PROTECTED] på vegne af d. sarthi maheshwari
Sendt: to 22-03-2007 07:03
Til: r-help@stat.math.ethz.ch
Emne: [R] R difftime function: How can we fix the difftime unit?



Hi,

I am trying to take difference of two time objects. I want to fix the
result's unit to minutes. How can I do that?

Here is an example:

> difftime(x, y)
Time difference of 2.030720 hours
> difftime(x, z)
Time difference of 30.34672 mins

where x = '2007-03-05 08:32:58'
  y = '2007-03-05 06:31:07'
andz = '2007-03-05 08:02:37'

How can I get answer something like

for (x-y)
Time difference of 121.8432 mins

and for (x-z)
Time difference of 30.34672 mins

Kindly help.

--
Thanks & Regards
Sarthi M.

[[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
and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] R difftime function: How can we fix the difftime unit?

2007-03-21 Thread d. sarthi maheshwari
Hi,

I am trying to take difference of two time objects. I want to fix the
result's unit to minutes. How can I do that?

Here is an example:

> difftime(x, y)
Time difference of 2.030720 hours
> difftime(x, z)
Time difference of 30.34672 mins

where x = '2007-03-05 08:32:58'
  y = '2007-03-05 06:31:07'
andz = '2007-03-05 08:02:37'

How can I get answer something like

for (x-y)
Time difference of 121.8432 mins

and for (x-z)
Time difference of 30.34672 mins

Kindly help.

-- 
Thanks & Regards
Sarthi M.

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] export table

2007-03-21 Thread Stephen Tucker
You can also use 

write.table(y,"D:/Desktop/export_table.txt", col.names=NA)

with this function call, the row names get printed but the column names are
offset so that they are aligned in the right column.



--- Chuck Cleland <[EMAIL PROTECTED]> wrote:

> Sergio Della Franca wrote:
> > Dear R-Helpers,
> > 
> > I have a problem.
> > 
> > I want to export from R to .txt my data set(y):
> > 
> > YEARS PRODUCTS
> > 1990 10
> > 1995 15
> > 1997 26
> > 1998 29
> > 2000 34
> > 
> > 
> > I used this code:
> > 
> > write.table(y,"D:/Desktop/export_table.txt").
> > 
> > This procedure run correctly, but i acquired this result:
> > 
> >  YEARS PRODUCTS
> > 1   1990 10
> > 2   1995 15
> > 3   1997 26
> > 4   1998 29
> > 5   2000 34
> > 
> > The prolem is that R add a column in the export procedure, but it doesn't
> > give a name at column then this new column get the name of the first
> column
> > of my data set.
> > 
> > There is a command that a must add to my export procedure to not export
> this
> > column or to give at this a name?
> 
> write.table(y,"D:/Desktop/export_table.txt", row.names=FALSE)
> 
>   The row.names and col.names arguments are described in the help page
> for write.table().
> 
> > Thank you in advance.
> > 
> > 
> > Sergio.
> > 
> > [[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
> > and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Chuck Cleland, Ph.D.
> NDRI, Inc.
> 71 West 23rd Street, 8th floor
> New York, NY 10010
> tel: (212) 845-4495 (Tu, Th)
> tel: (732) 512-0171 (M, W, F)
> fax: (917) 438-0894
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
> 



 

No need to miss a message. Get email on-the-go

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] export table

2007-03-21 Thread Stephen Tucker
You can also use 

write.table(y,"D:/Desktop/export_table.txt", col.names=NA)

with this function call, the row names get printed but the column names are
offset so that they are aligned in the right column.



--- Chuck Cleland <[EMAIL PROTECTED]> wrote:

> Sergio Della Franca wrote:
> > Dear R-Helpers,
> > 
> > I have a problem.
> > 
> > I want to export from R to .txt my data set(y):
> > 
> > YEARS PRODUCTS
> > 1990 10
> > 1995 15
> > 1997 26
> > 1998 29
> > 2000 34
> > 
> > 
> > I used this code:
> > 
> > write.table(y,"D:/Desktop/export_table.txt").
> > 
> > This procedure run correctly, but i acquired this result:
> > 
> >  YEARS PRODUCTS
> > 1   1990 10
> > 2   1995 15
> > 3   1997 26
> > 4   1998 29
> > 5   2000 34
> > 
> > The prolem is that R add a column in the export procedure, but it doesn't
> > give a name at column then this new column get the name of the first
> column
> > of my data set.
> > 
> > There is a command that a must add to my export procedure to not export
> this
> > column or to give at this a name?
> 
> write.table(y,"D:/Desktop/export_table.txt", row.names=FALSE)
> 
>   The row.names and col.names arguments are described in the help page
> for write.table().
> 
> > Thank you in advance.
> > 
> > 
> > Sergio.
> > 
> > [[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
> > and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Chuck Cleland, Ph.D.
> NDRI, Inc.
> 71 West 23rd Street, 8th floor
> New York, NY 10010
> tel: (212) 845-4495 (Tu, Th)
> tel: (732) 512-0171 (M, W, F)
> fax: (917) 438-0894
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
> 




 

Need Mail bonding?

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Ticks on barplots

2007-03-21 Thread Stephen Tucker
Hi Mike, you can try using axTicks as in this example (you can also use
pretty instead).

Below, instead of a barplot() I have used plot() but with type="h" and lend=3
(see ?par for details on lend) which I have found to be useful at times when
making barchart-like plots with time-series. In any case, barplot() or
plot(), I hope this illustration will be helpful:


# define function to convert numeric to POSIXct
# from http://tolstoy.newcastle.edu.au/R/help/04/05/0980.html
numToPOSIXct <- function(v) {
  now <- Sys.time()
  Epoch <- now - as.numeric(now)
  Epoch + v
}

# define example data
x <- seq(as.POSIXct("1950-01-01 00:00:00"),as.POSIXct("2000-01-01 
 00:00:00"),by="year")
y <- runif(length(x))

# plot and label axis with with axTicks()
plot(x,y,type="h",lwd=3,col=8,xaxt="n",lend=3)
axis(1,at=axTicks(1),lab=format(numToPOSIXct(axTicks(1)),"%Y"))



--- Mike Prager <[EMAIL PROTECTED]> wrote:

> Marc Schwartz <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, 2007-03-20 at 18:04 -0400, Michael H. Prager wrote:
> > > I am generating stacked barplots of age-composition of fish populations
> 
> > > (Y) over time (X).  As there are many years, not every bars is labeled.
>  
> > > When looking at the plot, it becomes difficult to associate labels with
> 
> > > their bars.
> > > 
> > > We have improved this a bit by using axis() to add a tickmark below
> each 
> > > bar.  Can anyone suggest a way to draw ticks ONLY at bars where a tick 
> > > label is drawn?  Or to make such ticks longer than those where there is
> 
> > > no label?
> > > 
> > > This is going into a function, so I'm hoping for a method that doesn't 
> > > require looking at the plot first.
> > >
> > > # sample code (simplified) #
> > > mp <- barplot(t(N.age), xlab = "Year", axisnames = FALSE)
> > > axis(side = 1, at = mp, labels = rownames(N.age), tcl = -0.75)
> > > 
> > > Thanks!
> > > 
> > > Mike Prager
> > > NOAA, Beaufort, NC
> > 
> > Mike,
> > 
> > How about something like this:
> > 
> >   mp <- barplot(1:50, axisnames = FALSE)
> > 
> >   # Create short tick marks at each bar
> >   axis(1, at = mp, labels = rep("", 50), tcl = -0.25)
> > 
> >   # Create longer tick marks every 5 years with labels
> >   axis(1, at = mp[seq(1, 50, 5)], 
> >labels = 1900 + seq(0, 45, 5), tcl = -0.75, las = 2, 
> >cex.axis = 0.75)
> > 
> > 
> > Just pick which labels you want to be shown (eg. every 5 years) and
> > synchronize the values of those with the 'at' argument in axis().
> > 
> > HTH,
> > 
> > Marc Schwartz
> > 
> 
> Thanks, Marc, for this solution and thanks equally to Jim Lemon
> for a similar idea.  This seems promising.  Since this is to go
> into a function (and should work without intervention), I'll
> need to devise an algorithm to decide at what interval the
> labels should be plotted.  Clearly "axis()" has such an
> algorithm.  Unfortunately, it reports its result only by placing
> the labels.
> 
> Mike
> 
> -- 
> Mike Prager, NOAA, Beaufort, NC
> * Opinions expressed are personal and not represented otherwise.
> * Any use of tradenames does not constitute a NOAA endorsement.
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
> 



 

Expecting? Get great news right away with email Auto-Check.

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] DBI + RSQLite or SQLiteDF?

2007-03-21 Thread Bing Ho
Hello,

I've finally reached the wall - my 2gb RAM machine simply can't handle
the datasets that I am working with. I've tried a 64-bit compile of R on
a 8gb RAM machine but that's not always available to use.

Now there are several proposed ways around this, but it seems the most
general solution is to leverage a SQL database to manage large datasets.

I thought I'd ask around to see what is the best approach before I went
off and expended a bunch of time being unable to get anything to work. I
have no experience with SQL or database administration.

My dataframes are in the 100,000 x 10,000 range (at the most) with a mix
of numerical, factor, and character data.

What works best right now - DBI + RSQLite, or would SQLiteDF be better,
for somebody with basically NO experience?

Thank you,
Bing

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] dynamic linear models in R

2007-03-21 Thread Johann Hibschman
Hi all,

I've just started working my way through Mike West and Jeff Harrison's
_Bayesian Forecasting and Dynamic Models_, and I was wondering if
there were any publically-available packages to handle dynamic linear
models, as they describe.

I found the "dynlm" package, but either I don't yet understand what's
going on or that package uses a different sense of the phrase "dynamic
linear model."  I would expect a fit of a dynamic linear model to
produce a time series of parameter estimates, not just single
coefficients as that function seems to generate.

Could anyone help me understand what's going on here?

Thanks,

Johann

P.S. What I really want to do is fit a linear regression of the form
dz_t ~ 0 + dx_t + dy_t, but where the coefficients of dx and dy are
allowed to slowly evolve over time.  DLMs seem appropriate to this,
but I'm open to any other suggestions, as I've not found much support
for DLMs in R.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem with RCurl install on Unix

2007-03-21 Thread Steven McKinney
I get the same problem, and haven't
figured it out yet.

Is it a 32bit/64bit clash?

(Similarly, I don't have RMySQL up and running cleanly.)




> library(RCurl)
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
unable to load shared library 
'/share/apps/R/R-2.4.1/library/RCurl/libs/RCurl.so':
  libcurl.so.4: cannot open shared object file: No such file or directory
Error: package/namespace load failed for 'RCurl'


> sessionInfo()
R version 2.4.1 (2006-12-18) 
x86_64-unknown-linux-gnu 

locale:
LC_CTYPE=en_US.iso885915;LC_NUMERIC=C;LC_TIME=en_US.iso885915;LC_COLLATE=en_US.iso885915;LC_MONETARY=en_US.iso885915;LC_MESSAGES=en_US.iso885915;LC_PAPER=en_US.iso885915;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.iso885915;LC_IDENTIFICATION=C

attached base packages:
[1] "stats" "graphics"  "grDevices" "utils" "datasets"  "methods"  
[7] "base" 

other attached packages:
 DBI 
"0.1-12" 
> 

Steven McKinney

Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre

email: [EMAIL PROTECTED]

tel: 604-675-8000 x7561

BCCRC
Molecular Oncology
675 West 10th Ave, Floor 4
Vancouver B.C. 
V5Z 1L3
Canada




-Original Message-
From: [EMAIL PROTECTED] on behalf of Mark W Kimpel
Sent: Wed 3/21/2007 3:09 PM
To: r-help@stat.math.ethz.ch
Subject: [R] problem with RCurl install on Unix
 
I am having trouble getting an install of RCurl to work properly on a 
Unix server. The steps I have taken are:

1. installed cUrl from source without difficulty
2. installed RCurl from source using the command
~/R_HOME/R-devel/bin/R CMD INSTALL -l ~/R_HOME/R-devel/library 
~/RCurl_0.8-0.tar.gz I received no errors during this install
3. when I go back to R and require(RCurl), I get

 > require(RCurl)
Loading required package: RCurl
Error in dyn.load(x, as.logical(local), as.logical(now)) :
 unable to load shared library 
'/N/u/mkimpel/BigRed/R_HOME/R-devel/library/RCurl/libs/RCurl.so':
   libcurl.so.4: cannot open shared object file: No such file or directory
°1§ FALSE

Outside of R I get

mkimpelàBigRed:¨/R_HOME/R-devel/library/RCurl/libs> ls
RCurl.so

I can cat into RCurl and I have even done chmod a+x RCurl.so in case 
there was a problem with permission for R to open the file.

Below is my sessionInfo. Thanks, Mark

 > sessionInfo()
R version 2.5.0 Under development (unstable) (2007-03-11 r40824)
powerpc64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
°1§ "stats" "graphics"  "grDevices" "datasets"  "utils" "tools"
°7§ "methods"   "base"

other attached packages:
 limma  affyaffyio   Biobase
  "2.9.13" "1.13.14"   "1.3.3" "1.13.39"
 >



-- 
Mark W. Kimpel MD
Neuroinformatics
Department of Psychiatry
Indiana University School of Medicine

__
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
and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Labelling a second y-axis

2007-03-21 Thread Marc Schwartz
On Wed, 2007-03-21 at 18:14 -0700, Jesse Sinclair wrote:
> Hi,
> I am using the following code as an example function to create  
> multiple y-axes on one plot. I have it working fine however, I can't  
> seem to add a label on the second (right) axis. I have tried adding  
> ylab="y2" in the axis call but, that didn't work; any ideas?
> 
> Thanks,
> 
> Jesse
> 
> Code:
> function() {
>   par(las=1,xaxs="r",mai=c(1,0.75,1,1))
>   x<-1:10
>   y1<-x
>   y2<-x^2
>   plot(x,y1,xlim=c(0,10),ylim=c(0,10),ylab="y1")
>   title(main="Multiple Y-Axes in R",ylab="y2")
>   par(new=TRUE)
>   plot(x,y2,xlim=c(0,10),xaxt="n",yaxt="n",ylab="",pch=16)
>   axis(4,at=c(0,20,40,60,80,100))
> }

Normally, you would use mtext() to place text outside the plot region.

The problem is that mtext() does not support rotated text. Thus, we need
to use text() and adjust the 'srt' argument to rotate the text and
adjust the x and y axis values for placement. We also set the 'xpd'
argument so that the text is not clipped at the plot region.

par(las=1,xaxs="r",mai=c(1,0.75,1,1))
x<-1:10
y1<-x
y2<-x^2
plot(x,y1,xlim=c(0,10),ylim=c(0,10), ylab="y1", las = 1)
title(main="Multiple Y-Axes in R")

par(new=TRUE)
plot(x,y2,xlim=c(0,10),xaxt="n",yaxt="n",ylab="",pch=16)
axis(4,at=c(0,20,40,60,80,100))

text(12, 50, "y2", srt = 270, xpd = TRUE)

See ?text, ?par and ?mtext 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
and provide commented, minimal, self-contained, reproducible code.


[R] Labelling a second y-axis

2007-03-21 Thread Jesse Sinclair
Hi,
I am using the following code as an example function to create  
multiple y-axes on one plot. I have it working fine however, I can't  
seem to add a label on the second (right) axis. I have tried adding  
ylab="y2" in the axis call but, that didn't work; any ideas?

Thanks,

Jesse

Code:
function() {
par(las=1,xaxs="r",mai=c(1,0.75,1,1))
x<-1:10
y1<-x
y2<-x^2
plot(x,y1,xlim=c(0,10),ylim=c(0,10),ylab="y1")
title(main="Multiple Y-Axes in R",ylab="y2")
par(new=TRUE)
plot(x,y2,xlim=c(0,10),xaxt="n",yaxt="n",ylab="",pch=16)
axis(4,at=c(0,20,40,60,80,100))
}

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] problem with RCurl install on Unix

2007-03-21 Thread Mark W Kimpel
I am having trouble getting an install of RCurl to work properly on a 
Unix server. The steps I have taken are:

1. installed cUrl from source without difficulty
2. installed RCurl from source using the command
~/R_HOME/R-devel/bin/R CMD INSTALL -l ~/R_HOME/R-devel/library 
~/RCurl_0.8-0.tar.gz I received no errors during this install
3. when I go back to R and require(RCurl), I get

 > require(RCurl)
Loading required package: RCurl
Error in dyn.load(x, as.logical(local), as.logical(now)) :
 unable to load shared library 
'/N/u/mkimpel/BigRed/R_HOME/R-devel/library/RCurl/libs/RCurl.so':
   libcurl.so.4: cannot open shared object file: No such file or directory
°1§ FALSE

Outside of R I get

mkimpelàBigRed:¨/R_HOME/R-devel/library/RCurl/libs> ls
RCurl.so

I can cat into RCurl and I have even done chmod a+x RCurl.so in case 
there was a problem with permission for R to open the file.

Below is my sessionInfo. Thanks, Mark

 > sessionInfo()
R version 2.5.0 Under development (unstable) (2007-03-11 r40824)
powerpc64-unknown-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
°1§ "stats" "graphics"  "grDevices" "datasets"  "utils" "tools"
°7§ "methods"   "base"

other attached packages:
 limma  affyaffyio   Biobase
  "2.9.13" "1.13.14"   "1.3.3" "1.13.39"
 >



-- 
Mark W. Kimpel MD
Neuroinformatics
Department of Psychiatry
Indiana University School of Medicine

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Clarification

2007-03-21 Thread Sender
Hello,

Could someone help me understand why one of these "structures" would be
preferred over the other?

x <- setClass( "patient", representation( data = "numeric", fname =
"character",
lname="character", disease = "character"
))

jd <- new("patient", data = rnorm(10), fname = "John", lname = "Doe",
disease = "CB4")


OR

x <- rnorm(10)
attr(x,"fname") <-  "Bill"
attr(x,"lname") <- "Carson"
attr(x,"disease") <- "CB4"

Is this a S3 vs S4 topic?  Anyone have suggested reading for this type of
stuff? I read "S4 classes in 15 pages"; are there other resources?

Thanks in advance !

[[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
and provide commented, minimal, self-contained, reproducible code.


[R] Snow Package and SPRNG: Will it solve my problem?

2007-03-21 Thread robert . robinson
Hello and thanks in advance for your time.  I currently have a  
simulation running on my cluster with the help of snow that relies on  
global variables being changes regularly  to random values.  It uses  
these values, lets call them x1 x2 and x3, in custom functions for  
logliklyhood and score that gets used in the standard optim function.   
To get set in the global table on the different nodes I'm generating  
the random value in a function on the node and then using the  
superassign operator ( <<- ) to set it to the global variable.
(eg:
temp = rand(n1)
x1 <<- sort(temp)
)

) I'm worried that this is creating a lot of avoidable message  
passing.  Here are my questions:

Does the superassign operator set the global variable on the head  
node, like I believe it does, or rather does it only set it on the  
local global table?

Does the SPRNG package offer a viable replacement for useless message  
passing of random values like this?

Thanks again for your continued help with my problems.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Stepwise Logistic Regression

2007-03-21 Thread Cody_Hamilton

Rich Ulrich has compiled some posts (I believe from the S list) on some of
the dangers of stepwise regression:
http://www.pitt.edu/~wpilib/statfaq/regrfaq.html

Regards,
-Cody



   
 "Sergio Della 
 Franca"   
 r-help@stat.math.ethz.ch
 Sent by:   cc 
 [EMAIL PROTECTED] 
 at.math.ethz.ch   Subject 
   [R] Stepwise Logistic Regression
   
 03/21/2007 11:42  
 AM
   
   
   




Dear R-Helpers,

I'd like to perform a Logistic Regression whit a Stepwise method.


Can you tell me how can i proceed to develop this procedure?


Thank you in advance.


Sergio Della Franca.

 [[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
and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Problem installing packages in R 2.4.1

2007-03-21 Thread Paul Gottemoller
I am attempting to install a anchoring vingettes package for R and I seem to
have a problem with unzipping the files in R.  I use the command that can be
found here .

Here is the dialog I get after entering the command:

> install.packages("anchors", dependencies = TRUE,
+ repos=c("http://wand.stanford.edu/R/CRAN","http://cran.r-project.org
"))
dependency ''snow'' is not available

also installing the dependency 'rgenoud'

trying URL '
http://cran.r-project.org/bin/windows/contrib/2.4/rgenoud_5.0-5.zip'
Content type 'application/zip' length 113709 bytes
opened URL
downloaded 111Kb

trying URL '
http://wand.stanford.edu/R/CRAN/bin/windows/contrib/2.4/anchors_2.0.zip'
Content type 'application/zip' length 592348 bytes
opened URL
downloaded 578Kb

Error in zip.unpack(pkg, tmpDir) : cannot open file 'C:/Program Files/R/R-
2.4.1/library/file20a84af3/rgenoud/chtml/rgenoud.chm'
>

Any help would be greatly appreciated.  Thank you in advance.

-- 
Paul Gottemoller
Graduate Assistant
Paul Simon Public Policy Institute
1231 Lincoln Drive
Southern Illinois University
Carbondale, Illinois 62901-4501

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Integer Optimization

2007-03-21 Thread apjaworski
Dimitri,

I am assuming you mean integer linear optimization problem.  Try lpSolve.
I think you will find it much easier to use.

Cheers,

Andy

__
Andy Jaworski
518-1-01
Process Laboratory
3M Corporate Research Laboratory
-
E-mail: [EMAIL PROTECTED]
Tel:  (651) 733-6092
Fax:  (651) 736-3122


   
 Mahieux Dimitri   
   r-help@stat.math.ethz.ch
 Sent by:   cc 
 [EMAIL PROTECTED] 
 at.math.ethz.ch   Subject 
   [R] Integer Optimization
   
 03/21/2007 06:42  
 AM
   
   
   




Hello everybody,

I am looking for a function (or package) which can solve a integer
optimization problem.  I have found the glpk package but I don't known
very well how to use it.
Someone has another solution ?

thx

__
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
and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Ticks on barplots

2007-03-21 Thread Marc Schwartz
On Wed, 2007-03-21 at 14:40 -0400, Mike Prager wrote:
> Marc Schwartz <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, 2007-03-20 at 18:04 -0400, Michael H. Prager wrote:
> > > I am generating stacked barplots of age-composition of fish populations 
> > > (Y) over time (X).  As there are many years, not every bars is labeled.  
> > > When looking at the plot, it becomes difficult to associate labels with 
> > > their bars.
> > > 
> > > We have improved this a bit by using axis() to add a tickmark below each 
> > > bar.  Can anyone suggest a way to draw ticks ONLY at bars where a tick 
> > > label is drawn?  Or to make such ticks longer than those where there is 
> > > no label?
> > > 
> > > This is going into a function, so I'm hoping for a method that doesn't 
> > > require looking at the plot first.
> > >
> > > # sample code (simplified) #
> > > mp <- barplot(t(N.age), xlab = "Year", axisnames = FALSE)
> > > axis(side = 1, at = mp, labels = rownames(N.age), tcl = -0.75)
> > > 
> > > Thanks!
> > > 
> > > Mike Prager
> > > NOAA, Beaufort, NC
> > 
> > Mike,
> > 
> > How about something like this:
> > 
> >   mp <- barplot(1:50, axisnames = FALSE)
> > 
> >   # Create short tick marks at each bar
> >   axis(1, at = mp, labels = rep("", 50), tcl = -0.25)
> > 
> >   # Create longer tick marks every 5 years with labels
> >   axis(1, at = mp[seq(1, 50, 5)], 
> >labels = 1900 + seq(0, 45, 5), tcl = -0.75, las = 2, 
> >cex.axis = 0.75)
> > 
> > 
> > Just pick which labels you want to be shown (eg. every 5 years) and
> > synchronize the values of those with the 'at' argument in axis().
> > 
> > HTH,
> > 
> > Marc Schwartz
> > 
> 
> Thanks, Marc, for this solution and thanks equally to Jim Lemon
> for a similar idea.  This seems promising.  Since this is to go
> into a function (and should work without intervention), I'll
> need to devise an algorithm to decide at what interval the
> labels should be plotted.  Clearly "axis()" has such an
> algorithm.  Unfortunately, it reports its result only by placing
> the labels.
> 
> Mike


Mike,

To get a feel for how axis() creates the default tick positions when
'at' is the default NULL, see ?axTicks, which provides functionality
similar to the internal C routine.

You could also look at ?pretty

HTH,

Marc

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RMySQL *was* working...

2007-03-21 Thread Seth Falcon
Pete Cap <[EMAIL PROTECTED]> writes:

> List,
>
> Last week with the help of Uwe and some other folks I was able to get
> RMySQL 0.5-7 compiled against R 2.4.1 and MySQL 5.0.27.  It was
> working fine--I was able to send select queries to the db, put the
> results in a data frame, and so forth.
>
> Today, dbDriver() threw an error:
>
>> dbDriver(MySQL) Error in function (classes, fdef, mtable) : unable
> to find an inherited method for function "dbDriver", for signature
> "function"

Do you mean dbDriver("MySQL")?

+ seth

-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Implementing trees in R

2007-03-21 Thread Bálint Czúcz
Dear Kevin,

for an example how this idea is implemented in a working package, have
a look at the help page of BinaryTree class in package party. The
@tree node of such an object is a recursive list of this kind.

HTH,
Bálint


On 3/16/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> Let me rephrase that.  Lists do not support references but they
> could be used to represent trees.
>
> list(a = list(a = 1, b = list(2, 3, d = list(4, 5)), c = list(4, 5))
>
> is a tree whose top nodes are a, b, c and b contains three nodes
> 2, 3 and d and d contains 2 nodes.
>
> However, if you want to do it via references as requested then lists
> are not appropriate.
>
> On 3/16/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> > Lists are not good for this.  There is an example in section 3.3 of
> > the proto vignette of using proto objects for this.  That section
> > also references an S4 example although its pretty messy with S4.
> >
> > You might want to look at the graph, RBGL and graphviz packages
> > in Bioconductor and the dynamicgraph, mathgraph and sna packages
> > on CRAN.
> >
> > On 3/16/07, Yuk Lap Yip (Kevin) <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > >I am rather new to R. Recently I have been trying to implement some
> > > tree algorithms in R. I used lists to model tree nodes. I thought
> > > something like this would work:
> > >
> > >parent <- list();
> > >child <- list();
> > >parent$child1 <- child;
> > >child$parent <- parent;
> > >
> > >When I tried to check whether a node is its parent's first child
> > > using "if (node$parent$child1 == node)", it always returned false. Then
> > > I realized that it does not really work because "parent$child1 <- child"
> > > actually makes a copy of child instead of referencing it. I think one
> > > possible fix is to keep a list of node objects, and make references
> > > using the positions in the list. For example, I think the following
> > > would work:
> > >
> > >parent <- list();
> > >child <- list();
> > >nodes <- list(parent, child);
> > >parent$child1 <- 2;
> > >child$parent <- 1;
> > >
> > >Then the "first child" test can be rewritten as "if
> > > (nodes[[nodes[[nodeId]]$parent]]$child1 == nodeId)". However, I would
> > > prefer not to implement trees in this way, as it requires the
> > > inconvenient and error-prone manipulations of node IDs.
> > >
> > >May I know if there is a way to make object references to lists? Or
> > > are there other ways to implement tree data structures in R?
> > >
> > >BTW, I checked how hclust was implemented, and noticed that it calls
> > > an external Fortran program. I would want a solution not involving any
> > > external programs.
> > >
> > >Thanks.
> > >
> > > --
> > >
> > >
> > >God bless.
> > >
> > >Kevin
> > >
> > > __
> > > 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
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> >
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Stepwise Logistic Regression

2007-03-21 Thread Frank E Harrell Jr
Sergio Della Franca wrote:
> Dear R-Helpers,
> 
> I'd like to perform a Logistic Regression whit a Stepwise method.
> 
> 
> Can you tell me how can i proceed to develop this procedure?
> 
> 
> Thank you in advance.
> 
> 
> Sergio Della Franca.

If the number of events is not incredibly large, you can get almost the 
same result with the following code :-)

candidates <- setdiff(names(mydataframe), 'y')
p <- length(candidates)
sample(candidates, sample(round(p/4):round(p/2), 1))

-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Stepwise Logistic Regression

2007-03-21 Thread David Farrar
Stella, 
  An obvious answer is 
   ?step
  However, I'm having a bit of a problem with it, lately.  I got it wording 
with backwards selection, then it didn't work when I changed the "direction" 
from "backward" to "both" (backwards and forwards).  I would like to know 
whatever you find that works.  Also, look at the procedures for logistic 
regression in the Design package.  
   
  regards,
  Farrar

Sergio Della Franca <[EMAIL PROTECTED]> wrote:
  Dear R-Helpers,

I'd like to perform a Logistic Regression whit a Stepwise method.


Can you tell me how can i proceed to develop this procedure?


Thank you in advance.


Sergio Della Franca.

[[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
and provide commented, minimal, self-contained, reproducible code.


[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Ticks on barplots

2007-03-21 Thread Mike Prager
Marc Schwartz <[EMAIL PROTECTED]> wrote:

> On Tue, 2007-03-20 at 18:04 -0400, Michael H. Prager wrote:
> > I am generating stacked barplots of age-composition of fish populations 
> > (Y) over time (X).  As there are many years, not every bars is labeled.  
> > When looking at the plot, it becomes difficult to associate labels with 
> > their bars.
> > 
> > We have improved this a bit by using axis() to add a tickmark below each 
> > bar.  Can anyone suggest a way to draw ticks ONLY at bars where a tick 
> > label is drawn?  Or to make such ticks longer than those where there is 
> > no label?
> > 
> > This is going into a function, so I'm hoping for a method that doesn't 
> > require looking at the plot first.
> >
> > # sample code (simplified) #
> > mp <- barplot(t(N.age), xlab = "Year", axisnames = FALSE)
> > axis(side = 1, at = mp, labels = rownames(N.age), tcl = -0.75)
> > 
> > Thanks!
> > 
> > Mike Prager
> > NOAA, Beaufort, NC
> 
> Mike,
> 
> How about something like this:
> 
>   mp <- barplot(1:50, axisnames = FALSE)
> 
>   # Create short tick marks at each bar
>   axis(1, at = mp, labels = rep("", 50), tcl = -0.25)
> 
>   # Create longer tick marks every 5 years with labels
>   axis(1, at = mp[seq(1, 50, 5)], 
>labels = 1900 + seq(0, 45, 5), tcl = -0.75, las = 2, 
>cex.axis = 0.75)
> 
> 
> Just pick which labels you want to be shown (eg. every 5 years) and
> synchronize the values of those with the 'at' argument in axis().
> 
> HTH,
> 
> Marc Schwartz
> 

Thanks, Marc, for this solution and thanks equally to Jim Lemon
for a similar idea.  This seems promising.  Since this is to go
into a function (and should work without intervention), I'll
need to devise an algorithm to decide at what interval the
labels should be plotted.  Clearly "axis()" has such an
algorithm.  Unfortunately, it reports its result only by placing
the labels.

Mike

-- 
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Stepwise Logistic Regression

2007-03-21 Thread Sergio Della Franca
Dear R-Helpers,

I'd like to perform a Logistic Regression whit a Stepwise method.


Can you tell me how can i proceed to develop this procedure?


Thank you in advance.


Sergio Della Franca.

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Gaussian Adaptive Quadrature

2007-03-21 Thread Earl F. Glynn
"Ravi Varadhan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> The terminology "Gaussian quadrature" is not restricted to Gauss-Hermite
> quadrature (where exp(-x^2) is the weight function), but applies more
> broadly to Gauss-Legendre, Gauss-Laguerre, etc., where the abscissa are
> chosen from Legendre, Laguerre polynomials.

Also, the functional form of the integrand and limits of integration vary a 
bit with the different Gaussian Quadrature methods.  With Gaussian 
Quadrature the integral from a to b of f(x) dx is approximated as the sum of 
certain weights multiplied by the function evaluated at certain points 
related to the roots of the orthogonal polynomials.

Gauss-Legendre is perhaps the most general, since it works well with most 
functions over a fixed, finite, interval, normally [-1,1].  The Legendre 
polynomials are orthogonal on the interval [-1,1] with respect to a 
weighting function w(x) = 1.  A simple transformation allows the integration 
interval to be any finite interval, [a,b].

Gauss-Laguerre assumes a weighting function w(x) = exp(-x) in the integrand, 
and an interval of integration from 0 to infinity.

Gauss-Hermite assumes a weighting function w(x) = exp(-x^2) in the 
integrand, and an interval of integration from -infinity to infinity.

Applied Numerical Methods by Carnahan et al provides good details and 
examples (but in FORTRAN).


One "adaptive" approach that can be used with Gaussian Quadrature is to use 
a different number of  terms to evaluate the integral.  To save computation 
time, you can use fewer terms.  This file gives the weights needed for 
various N-point Gauss-Legendre quadrature approximation:
http://www.math.ntnu.no/num/nnm/Program/Numlibc/gauss_co.c

Some years ago on a project we found that 2-point Gaussian Quadrature gave 
us an answer that was "good enough," and obviously was quite fast with so 
few function evaluations.  For your problem you might try 2-point to 
15-point quadrature to see if you get the desired accuracy.   I've always 
used pre-computed polynomial roots and weights for the various N-point 
formulas.  I'm not sure how gauss.quad in library(statmod) gets these 
values. It wasn't obvious to me from a quick look at the source code.

Another  "adaptive" Gaussian approach might break a single integral up into 
a number of other integrals.  One could even use different N-point formulas 
over different intervals, using lower N for "smoother" areas, and larger N 
if a function wasn't so well-behaved.

Some other good links:

Gauss-Legendre Quadrature
http://math.fullerton.edu/mathews/n2003/gaussianquad/GaussianQuadBib/Links/GaussianQuadBib_lnk_1.html
http://mathworld.wolfram.com/Legendre-GaussQuadrature.html

efg

Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] export table

2007-03-21 Thread Chuck Cleland
Sergio Della Franca wrote:
> Dear R-Helpers,
> 
> I have a problem.
> 
> I want to export from R to .txt my data set(y):
> 
> YEARS PRODUCTS
> 1990 10
> 1995 15
> 1997 26
> 1998 29
> 2000 34
> 
> 
> I used this code:
> 
> write.table(y,"D:/Desktop/export_table.txt").
> 
> This procedure run correctly, but i acquired this result:
> 
>  YEARS PRODUCTS
> 1   1990 10
> 2   1995 15
> 3   1997 26
> 4   1998 29
> 5   2000 34
> 
> The prolem is that R add a column in the export procedure, but it doesn't
> give a name at column then this new column get the name of the first column
> of my data set.
> 
> There is a command that a must add to my export procedure to not export this
> column or to give at this a name?

write.table(y,"D:/Desktop/export_table.txt", row.names=FALSE)

  The row.names and col.names arguments are described in the help page
for write.table().

> Thank you in advance.
> 
> 
> Sergio.
> 
>   [[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
> and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] export table

2007-03-21 Thread Sergio Della Franca
Dear R-Helpers,

I have a problem.

I want to export from R to .txt my data set(y):

YEARS PRODUCTS
1990 10
1995 15
1997 26
1998 29
2000 34


I used this code:

write.table(y,"D:/Desktop/export_table.txt").

This procedure run correctly, but i acquired this result:

 YEARS PRODUCTS
1   1990 10
2   1995 15
3   1997 26
4   1998 29
5   2000 34

The prolem is that R add a column in the export procedure, but it doesn't
give a name at column then this new column get the name of the first column
of my data set.

There is a command that a must add to my export procedure to not export this
column or to give at this a name?

Thank you in advance.


Sergio.

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] question on suppressing error messages with Rmath library

2007-03-21 Thread Ranjan Maitra
Hi Luke,

Thanks! Sorry, my error which I did not realize until after sending out the 
program. I think I will just extricate the pnt code and compile that separately 
and that should be fine.

Thanks very much again, to you and everybody else who replied.

Best wishes,
Ranjan


On Wed, 21 Mar 2007 10:04:05 -0500 (CDT) Luke Tierney <[EMAIL PROTECTED]> wrote:

> You might get less noise in the replies if you were explicit about
> using Rmath stand-alone and asked on r-devel.
> 
> As far as I can see you would need to compile a version of the
> stand-alone library that defines the macros for handling of warning
> messages differently -- the current one just calls printf in the
> stand-alone library.  (You might be able to trick the linker into using
> a version of printf for calls from within Rmath that does nothing, but
> I suspect recompiling the sourses is easier.)  We will probably be
> rethinking this soon in conjunction with some other changes to
> vectorized math in R.
> 
> 
> Best,
> 
> luke
> 
> On Wed, 21 Mar 2007, Ranjan Maitra wrote:
> 
> > Dear list,
> >
> > I have been using the Rmath library for quite a while: in the current 
> > instance, I am calling dnt (non-central t density function) repeatedly for 
> > several million. When the argument is small, I get the warning message:
> >
> > full precision was not achieved in 'pnt'
> >
> > which is nothing unexpected. (The density calls pnt, if you look at the 
> > function dnt.) However, to have this happen a huge number of times, when 
> > the optimizer is churning through the dataset is bothersome, but more 
> > importantly, a bottleneck in terms of speed. Is it possible to switch this 
> > off? Is there an setting somewhere that I am missing?
> >
> > Many thanks and best wishes,
> > Ranjan
> >
> > __
> > 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
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
> -- 
> Luke Tierney
> Chair, Statistics and Actuarial Science
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa  Phone: 319-335-3386
> Department of Statistics andFax:   319-335-3017
> Actuarial Science
> 241 Schaeffer Hall  email:  [EMAIL PROTECTED]
> Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RMySQL *was* working...

2007-03-21 Thread Pete Cap
List,

Please disregard.  I merely forgot the quotes:
> dbDriver("MySQL")


Thanks,
Pete

Pete Cap <[EMAIL PROTECTED]> wrote: List,

Last week with the help of Uwe and some other folks I was able to get RMySQL 
0.5-7 compiled against R 2.4.1 and MySQL 5.0.27.  It was working fine--I was 
able to send select queries to the db, put the results in a data frame, and so 
forth.

Today, dbDriver() threw an error:

> dbDriver(MySQL)
Error in function (classes, fdef, mtable)  : 
unable to find an inherited method for function "dbDriver", for 
signature "function"

There have been no system changes that should concern MySQL, R, or the 
installed package RMySQL (that is, nothing outside of unrelated software such 
as firefox auto-updating).

Any clues?  I would prefer not to have to reinstall anything if possible.

Thanks,

Pete

 
-
Be a PS3 game guru.

 [[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
and provide commented, minimal, self-contained, reproducible code.


 
-
8:00? 8:25? 8:40?  Find a flick in no time

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] any way to append a table in SQL server

2007-03-21 Thread Jim Porzak
see...
> library(RODBC)
> ?sqlSave

and rest of RODBC docs. You could also pass a SQL INSERT statement
through sqlQuery()

On 3/20/07, Wensui Liu <[EMAIL PROTECTED]> wrote:
> Dear Lister,
> Is there an interface in R with SQL server that allows me to append
> records to table in the DB? Might I do that using RODBC?
> Thanks a lot.
>
> --
> WenSui Liu
> A lousy statistician who happens to know a little programming
> (http://spaces.msn.com/statcompute/blog)
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
HTH/Best,
Jim Porzak
Loyalty Matrix Inc.
San Francisco, CA
http://www.linkedin.com/in/jimporzak

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] RMySQL *was* working...

2007-03-21 Thread Pete Cap
List,

Last week with the help of Uwe and some other folks I was able to get RMySQL 
0.5-7 compiled against R 2.4.1 and MySQL 5.0.27.  It was working fine--I was 
able to send select queries to the db, put the results in a data frame, and so 
forth.

Today, dbDriver() threw an error:

> dbDriver(MySQL)
Error in function (classes, fdef, mtable)  : 
unable to find an inherited method for function "dbDriver", for 
signature "function"

There have been no system changes that should concern MySQL, R, or the 
installed package RMySQL (that is, nothing outside of unrelated software such 
as firefox auto-updating).

Any clues?  I would prefer not to have to reinstall anything if possible.

Thanks,

Pete

 
-
Be a PS3 game guru.

[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to get "lsmeans"?

2007-03-21 Thread Frank E Harrell Jr
Chuck Cleland wrote:
> Liaw, Andy wrote:
>> I verified the result from the following with output from JMP 6 on the
>> same data (don't have SAS: don't need it):
>>
>> set.seed(631)
>> n <- 100
>> dat <- data.frame(y=rnorm(n), A=factor(sample(1:2, n, replace=TRUE)),
>>   B=factor(sample(1:2, n, replace=TRUE)),
>>   C=factor(sample(1:2, n, replace=TRUE)),
>>   d=rnorm(n))
>> fm <- lm(y ~ A + B + C + d, dat)
>> ## Form a data frame of points to predict: all combinations of the
>> ## three factors and the mean of the covariate.
>> p <- data.frame(expand.grid(A=1:2, B=1:2, C=1:2))
>> p[] <- lapply(p, factor)
>> p <- cbind(p, d=mean(dat$d))
>> p <- cbind(yhat=predict(fm, p), p)
>> ## lsmeans for the three factors:
>> with(p, tapply(yhat, A, mean))
>> with(p, tapply(yhat, B, mean))
>> with(p, tapply(yhat, C, mean))

And with the Design package you can do:

f <- ols(y ~ ...)
ds <- gendata(A=c('1','2'),B=c('1','2'),C=c('1','2'))
predict(f, ds)

But this sets the covariate to the median (nothing unreasonable about 
that, just will not agree with SAS).  To set to mean add d=mean(dat$d) 
in gendata.

Frank

> 
>   Using Andy's example data, these are the LSMEANS and intervals I get
> from SAS:
> 
> Ay LSMEAN  95% Confidence Limits
> 1   -0.071847   -0.387507 0.243813
> 2   -0.029621   -0.342358 0.283117
> 
> By LSMEAN  95% Confidence Limits
> 1   -0.104859   -0.397935 0.188216
> 20.003391   -0.333476 0.340258
> 
> Cy LSMEAN  95% Confidence Limits
> 1   -0.084679   -0.392343 0.222986
> 2   -0.016789   -0.336374 0.302795
> 
>   One way of reproducing the LSMEANS and intervals from SAS using
> predict() seems to be the following:
> 
>> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
>> newdat <- expand.grid(A=factor(c(1,2)),B=1.5,C=1.5,d=mean(dat$d))
>> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
>   A   B   C  d fitlwr   upr
> 1 1 1.5 1.5 0.09838595 -0.07184709 -0.3875070 0.2438128
> 2 2 1.5 1.5 0.09838595 -0.02962086 -0.3423582 0.2831165
> 
>   However, another possibility seems to be:
> 
>> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
>> newdat <-
> expand.grid(A=factor(c(1,2)),B=mean(as.numeric(dat$B)),C=mean(as.numeric(dat$C)),d=mean(dat$d))
>> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
>   ABC  d fitlwr   upr
> 1 1 1.43 1.48 0.09838595 -0.08078243 -0.3964661 0.2349012
> 2 2 1.43 1.48 0.09838595 -0.03855619 -0.3479589 0.2708465
> 
>   The predictions directly above match what effect() in the effects
> package by John Fox returns:
> 
> library(effects)
> 
>> effect("A", fm, xlevels=list(d = mean(dat$D)))
> 
>  A effect
> A
>   1   2
> -0.08078243 -0.03855619
> 
>   But for some reason the predict() and effect() intervals are a little
> different:
> 
>> effect("A", fm, xlevels=list(d = mean(dat$D)))$lower
>   [,1]
> 101 -0.3924451
> 102 -0.3440179
> 
>> effect("A", fm, xlevels=list(d = mean(dat$D)))$upper
>  [,1]
> 101 0.2308802
> 102 0.2669055
> 
>   I would be interested in any comments on these different approaches
> and on the difference in intervals returned by predict() and effect().
> 
> hope this helps,
> 
> Chuck
> 
>> Andy 
>>
>> From: Xingwang Ye
>>> Dear all, 
>>>   
>>> I search the mail list about this topic and learn that no 
>>> simple way is available to get "lsmeans" in R as in SAS.
>>> Dr.John Fox and Dr.Frank E Harrell have given very useful 
>>> information about "lsmeans" topic.
>>> Dr. Frank E Harrell suggests not to think about lsmeans, 
>>> just to think about what predicted values wanted
>>> and to use the predict function. However, after reading 
>>> the R help file for a whole day, I am still unclear how to do it.
>>> Could some one give me a hand? 
>>>  
>>> for example:
>>>   
>>> A,B and C are binomial variables(factors); d is a continuous 
>>> variable ; The response variable Y is  a continuous variable too.  
>>>
>>> To get lsmeans of Y according to A,B and C, respectively, in 
>>> SAS, I tried proc glm data=a;  class A B C;  model Y=A B C d; 
>>>  lsmeans A B C/cl; run;  
>>>
>>> In R, I tried this:  
>>>  library(Design)
>>>  ddist<-datadist(a)
>>>  options(datadist="ddist")
>>>  f<-ols(Y~A+B+C+D,data=a,x=TRUE,y=TRUE,se.fit=TRUE)  
>>>
>>> then how to get the "lsmeans" for A, B, and C, respectively 
>>> with predict function?
>>>
>>>  
>>>
>>> Best wishes
>>> yours, sincerely 
>>> Xingwang Ye
>>> PhD candidate 
>>> Research Group of Nutrition Related Cancers and Other Chronic 
>>> Diseases  
>>> Institute for Nutritional Sciences,  
>>> Shanghai Institutes of Biological Sciences, 
>>> Chinese Academy of Sciences 
>>> P.O.Box 32 
>>> 294 Taiyuan Road 
>>> Shanghai 200031 
>>> P.R.CHINA
>>>
>>>
>>

Re: [R] how to get "lsmeans"?

2007-03-21 Thread Prof Brian Ripley
On Wed, 21 Mar 2007, Chuck Cleland wrote:

> Liaw, Andy wrote:
>> I verified the result from the following with output from JMP 6 on the
>> same data (don't have SAS: don't need it):
>>
>> set.seed(631)
>> n <- 100
>> dat <- data.frame(y=rnorm(n), A=factor(sample(1:2, n, replace=TRUE)),
>>   B=factor(sample(1:2, n, replace=TRUE)),
>>   C=factor(sample(1:2, n, replace=TRUE)),
>>   d=rnorm(n))
>> fm <- lm(y ~ A + B + C + d, dat)
>> ## Form a data frame of points to predict: all combinations of the
>> ## three factors and the mean of the covariate.
>> p <- data.frame(expand.grid(A=1:2, B=1:2, C=1:2))
>> p[] <- lapply(p, factor)
>> p <- cbind(p, d=mean(dat$d))
>> p <- cbind(yhat=predict(fm, p), p)
>> ## lsmeans for the three factors:
>> with(p, tapply(yhat, A, mean))
>> with(p, tapply(yhat, B, mean))
>> with(p, tapply(yhat, C, mean))
>
>  Using Andy's example data, these are the LSMEANS and intervals I get
> from SAS:
>
> Ay LSMEAN  95% Confidence Limits
> 1   -0.071847   -0.387507 0.243813
> 2   -0.029621   -0.342358 0.283117
>
> By LSMEAN  95% Confidence Limits
> 1   -0.104859   -0.397935 0.188216
> 20.003391   -0.333476 0.340258
>
> Cy LSMEAN  95% Confidence Limits
> 1   -0.084679   -0.392343 0.222986
> 2   -0.016789   -0.336374 0.302795
>
>  One way of reproducing the LSMEANS and intervals from SAS using
> predict() seems to be the following:
>
>> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
>> newdat <- expand.grid(A=factor(c(1,2)),B=1.5,C=1.5,d=mean(dat$d))
>> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
>  A   B   C  d fitlwr   upr
> 1 1 1.5 1.5 0.09838595 -0.07184709 -0.3875070 0.2438128
> 2 2 1.5 1.5 0.09838595 -0.02962086 -0.3423582 0.2831165
>
>  However, another possibility seems to be:
>
>> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
>> newdat <-
> expand.grid(A=factor(c(1,2)),B=mean(as.numeric(dat$B)),C=mean(as.numeric(dat$C)),d=mean(dat$d))
>> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
>  ABC  d fitlwr   upr
> 1 1 1.43 1.48 0.09838595 -0.08078243 -0.3964661 0.2349012
> 2 2 1.43 1.48 0.09838595 -0.03855619 -0.3479589 0.2708465
>
>  The predictions directly above match what effect() in the effects
> package by John Fox returns:
>
> library(effects)
>
>> effect("A", fm, xlevels=list(d = mean(dat$D)))
>
> A effect
> A
>  1   2
> -0.08078243 -0.03855619
>
>  But for some reason the predict() and effect() intervals are a little
> different:
>
>> effect("A", fm, xlevels=list(d = mean(dat$D)))$lower
>  [,1]
> 101 -0.3924451
> 102 -0.3440179
>
>> effect("A", fm, xlevels=list(d = mean(dat$D)))$upper
> [,1]
> 101 0.2308802
> 102 0.2669055
>
>  I would be interested in any comments on these different approaches
> and on the difference in intervals returned by predict() and effect().

AFAIR, the effects packages uses normal-based confidence intervals 
and predict.lm uses t-based ones, and I have suggested to John Fox that 
t-based intervals would be preferable, at least as an option.


-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] for loop in assigning column names

2007-03-21 Thread Dimitris Rizopoulos
try

df.new <- cbind(df, ObJeCt[1:10])
names(df.new) <- c(names(df), paste("St", 1:10, sep = ""))


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm



- Original Message - 
From: "Luis Ridao Cruz" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, March 21, 2007 4:14 PM
Subject: [R] for loop in assigning column names


> R-help,
>
> I have a data frame (df) and I want to add some columns whose names
> should correspond to the "i" index in the loop below.
>
> for(i in 1:10)
> {
> df$eval(paste("St", as.character(i), sep = "" ))  <- ObJeCt[i]
> }
>
> An error message comes out :
>
> "Error: attempt to apply non-function"
>
> How can I get around this?
>
> I could do something like :
>
> df$St2 <- NA
> df$St3 <- NA
> dft$St4 < -NA
> ..
>
> and afterwards assign the results of the loop above
> to the columns df$St2,df$St3,,,
>
> The problem is that my object "ObJeCt[i]" may change in size
> and definition and therefore a way to systematize the task would
> be desirable.
>
> Thanks in advance
>
>> version
>   _
> platform   i386-pc-mingw32
> arch   i386
> os mingw32
> system i386, mingw32
> status
> major  2
> minor  4.1
> year   2006
> month  12
> day18
> svn rev40228
> language   R
> version.string R version 2.4.1 (2006-12-18)
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] question on suppressing error messages with Rmath library

2007-03-21 Thread Ranjan Maitra
Thanks, Jim and Ronggui! This would work, of course!

But I apologize for not being clear in the first post. I am calling Rmath from 
a C program. I could not figure out how to set this without going back and 
recompiling: the message in in pnt.c and pulls it from the header file nmath.h.

Thanks,
Ranjan


On Wed, 21 Mar 2007 22:08:16 +0800 ronggui <[EMAIL PROTECTED]> wrote:

> op <- options(warn=-1)
> [main codes here]
> options(op)
> 
> 
> 
> On 3/21/07, Ranjan Maitra <[EMAIL PROTECTED]> wrote:
> > Dear list,
> >
> > I have been using the Rmath library for quite a while: in the current 
> > instance, I am calling dnt (non-central t density function) repeatedly for 
> > several million. When the argument is small, I get the warning message:
> >
> > full precision was not achieved in 'pnt'
> >
> > which is nothing unexpected. (The density calls pnt, if you look at the 
> > function dnt.) However, to have this happen a huge number of times, when 
> > the optimizer is churning through the dataset is bothersome, but more 
> > importantly, a bottleneck in terms of speed. Is it possible to switch this 
> > off? Is there an setting somewhere that I am missing?
> >
> > Many thanks and best wishes,
> > Ranjan
> >
> > __
> > 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
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
> 
> -- 
> Ronggui Huang
> Department of Sociology
> Fudan University, Shanghai, China
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Gaussian Adaptive Quadrature

2007-03-21 Thread Ravi Varadhan
Hi,

The function "integrate" is based on QUADPACK Fortran package by Piessens.
It does indeed perform adaptive Gauss-Kronrod quadrature, where Kronrod's
method allows the re-use of abscissa from the previous iteration, thus
enabling the estimation of the quadrature error and its control.  In
contrast, in the standard Gaussian quadrature methods this is not feasible. 

The terminology "Gaussian quadrature" is not restricted to Gauss-Hermite
quadrature (where exp(-x^2) is the weight function), but applies more
broadly to Gauss-Legendre, Gauss-Laguerre, etc., where the abscissa are
chosen from Legendre, Laguerre polynomials.

Ravi. 


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Douglas Bates
Sent: Wednesday, March 21, 2007 9:25 AM
To: Doran, Harold
Cc: Help mailing list - R
Subject: Re: [R] Gaussian Adaptive Quadrature

On 3/21/07, Doran, Harold <[EMAIL PROTECTED]> wrote:
> The function integrate() uses AGQ. There are other functions for
> gaussian quadrature in the statmod() package that I really like.

I think that integrate does adaptive quadrature but not adaptive
Gaussian quadrature (which probably should have been called adaptive
Gauss-Hermite quadrature to be more specific).  In the first case the
"adaptive" refers to a choice of mesh size.  In the second case one is
integrating a function that is close to a multivariate Gaussian
density by first finding the conditional optimum of the integrand and
using a quadratic approximation to the log-integrand to establish the
location of the Gauss-Hermite quadrature points.

The Laplace approximation to the log-likelihood for a generalized
linear mixed model is a 1-point adaptive Gauss-Hermite quadrature
evaluation.

>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Caio
> > Lucidius Naberezny Azevedo
> > Sent: Wednesday, March 21, 2007 5:55 AM
> > To: Help mailing list - R
> > Subject: [R] Gaussian Adaptive Quadrature
> >
> > Hi all,
> >
> >   Does anybody know any function that performs gaussian
> > adapative quadrature integration of univariate functions?
> >
> >   Thanks in advance,
> >
> >   Regards,
> >
> > Caio
> >
> >  __
> >
> >
> >   [[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
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] for loop in assigning column names

2007-03-21 Thread ONKELINX, Thierry
Have you tried something like

df <- cbind(df, ObJeCT[, 1:10])

Cheers,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
[EMAIL PROTECTED]
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney

 

> -Oorspronkelijk bericht-
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Luis Ridao Cruz
> Verzonden: woensdag 21 maart 2007 16:14
> Aan: r-help@stat.math.ethz.ch
> Onderwerp: [R] for loop in assigning column names
> 
> R-help,
> 
> I have a data frame (df) and I want to add some columns whose 
> names should correspond to the "i" index in the loop below.
> 
>  for(i in 1:10)
>  {
> df$eval(paste("St", as.character(i), sep = "" ))  <- ObJeCt[i]  }
> 
> An error message comes out : 
> 
> "Error: attempt to apply non-function"
> 
> How can I get around this?
> 
> I could do something like :
> 
> df$St2 <- NA
> df$St3 <- NA
> dft$St4 < -NA
> ..
> 
> and afterwards assign the results of the loop above to the 
> columns df$St2,df$St3,,,
> 
> The problem is that my object "ObJeCt[i]" may change in size 
> and definition and therefore a way to systematize the task 
> would be desirable.
> 
> Thanks in advance
> 
> > version
>_   
> platform   i386-pc-mingw32 
> arch   i386
> os mingw32 
> system i386, mingw32   
> status 
> major  2   
> minor  4.1 
> year   2006
> month  12  
> day18  
> svn rev40228   
> language   R   
> version.string R version 2.4.1 (2006-12-18)
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] for loop in assigning column names

2007-03-21 Thread Luis Ridao Cruz
R-help,

I have a data frame (df) and I want to add some columns whose names
should correspond to the "i" index in the loop below.

 for(i in 1:10)
 {
df$eval(paste("St", as.character(i), sep = "" ))  <- ObJeCt[i]
 }

An error message comes out : 

"Error: attempt to apply non-function"

How can I get around this?

I could do something like :

df$St2 <- NA
df$St3 <- NA
dft$St4 < -NA
..

and afterwards assign the results of the loop above 
to the columns df$St2,df$St3,,,

The problem is that my object "ObJeCt[i]" may change in size
and definition and therefore a way to systematize the task would
be desirable.

Thanks in advance

> version
   _   
platform   i386-pc-mingw32 
arch   i386
os mingw32 
system i386, mingw32   
status 
major  2   
minor  4.1 
year   2006
month  12  
day18  
svn rev40228   
language   R   
version.string R version 2.4.1 (2006-12-18)

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] question on suppressing error messages with Rmath library

2007-03-21 Thread Luke Tierney
You might get less noise in the replies if you were explicit about
using Rmath stand-alone and asked on r-devel.

As far as I can see you would need to compile a version of the
stand-alone library that defines the macros for handling of warning
messages differently -- the current one just calls printf in the
stand-alone library.  (You might be able to trick the linker into using
a version of printf for calls from within Rmath that does nothing, but
I suspect recompiling the sourses is easier.)  We will probably be
rethinking this soon in conjunction with some other changes to
vectorized math in R.


Best,

luke

On Wed, 21 Mar 2007, Ranjan Maitra wrote:

> Dear list,
>
> I have been using the Rmath library for quite a while: in the current 
> instance, I am calling dnt (non-central t density function) repeatedly for 
> several million. When the argument is small, I get the warning message:
>
> full precision was not achieved in 'pnt'
>
> which is nothing unexpected. (The density calls pnt, if you look at the 
> function dnt.) However, to have this happen a huge number of times, when the 
> optimizer is churning through the dataset is bothersome, but more 
> importantly, a bottleneck in terms of speed. Is it possible to switch this 
> off? Is there an setting somewhere that I am missing?
>
> Many thanks and best wishes,
> Ranjan
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa  Phone: 319-335-3386
Department of Statistics andFax:   319-335-3017
Actuarial Science
241 Schaeffer Hall  email:  [EMAIL PROTECTED]
Iowa City, IA 52242 WWW:  http://www.stat.uiowa.edu

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] package:AlgDesign and .Random.seed

2007-03-21 Thread Uwe Ligges
So let me read the help page of ?RNG for all of us:

"Initially, there is no seed; a new one is created from the current time 
when one is required. Hence, different sessions will give different 
simulation results, by default."

Hence this is definitely a bug in AlgDesign.

Further on also remarkable for Bob Wheeler's decision to save .Random.seed:

".Random.seed saves the seed set for the uniform random-number 
generator, at least for the system generators. It does not necessarily 
save the state of other generators, and in particular does not save the 
state of the Box–Muller normal generator. If you want to reproduce work 
later, call set.seed rather than set .Random.seed."


Uwe Ligges




Michael Kubovy wrote:
> On Mar 21, 2007, at 4:16 AM, Uwe Ligges wrote:
> 
>> Michael Kubovy wrote:
>>> Dear r-helpers,
>>> Could you please help me solve the following problem: When I run
>>> require(AlgDesign)
>>> trt <- LETTERS[1:5]
>>> blk <- 10
>>> trtblk <- 3
>>> BIB <- optBlock(~., withinData = trt, blocksizes = rep(trtblk, blk))
>>> In response to the last command, R complains:
>>> Error in optBlock(~., withinData = trt, blocksizes = rep(trtblk, blk)) :
>>> object ".Random.seed" not found
>>> The documentation of optBlock() in AlgDesign doesn't say that I  
>>> needed to set .Random.seed. I thought it was initiated automatically  
>>> at the beginning of a session. What am I missing?
>>
>>
>> The first line in that function is
>> seed <- .Random.seed
>> but .Random.seed is generated at the first use of R's RNG, hence maybe 
>> later. This means the function contains a bug which you should report 
>> to the package maintainer, please.
>>
>> Best,
>> Uwe Ligges
> 
> Bob Wheeler's response:
> 
>> From: Bob Wheeler <[EMAIL PROTECTED]>
>> Date: March 21, 2007 9:19:29 AM EDT
>> To: Michael Kubovy <[EMAIL PROTECTED]>
>> Subject: Re:
>>
>> Each workspace in R requires you to set a random seed to start. You 
>> have not done this. It is an R artifact, and has nothing to do with 
>> AlgDesign.
>> --Bob Wheeler --- http://www.bobwheeler.com/
>>ECHIP, Inc. --- Randomness comes in bunches.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Select the last two rows by id group

2007-03-21 Thread Muenchen, Robert A (Bob)
Marc, thanks for so many great variations! I especially like:

tail(sort(table(DF$County)))

I often have frequency tables that are of interest only towards the end.

Cheers,
Bob

=
  Bob Muenchen (pronounced Min'-chen), Manager  
  Statistical Consulting Center
  U of TN Office of Information Technology
  200 Stokely Management Center, Knoxville, TN 37996-0520
  Voice: (865) 974-5230  
  FAX:   (865) 974-4810
  Email: [EMAIL PROTECTED]
  Web:   http://oit.utk.edu/scc, 
  News:  http://listserv.utk.edu/archives/statnews.html
=


> -Original Message-
> From: Marc Schwartz [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 20, 2007 8:58 PM
> To: Muenchen, Robert A (Bob)
> Cc: R-help@stat.math.ethz.ch
> Subject: Re: [R] Select the last two rows by id group
> 
> On Tue, 2007-03-20 at 11:53 -0400, Muenchen, Robert A (Bob) wrote:
> > Very nice! This is almost duplicates the SAS first.var and last.var
> > ability to choose the first and last observations by group(s).
> > Substituting the head function in where Marc has the tail function
> below
> > will adapt it to the first n. It is more flexible than the SAS
> approach
> > because it can do the first/last n rather than just the single first
> or
> > last.
> >
> > Let's say we want to choose the last observation in a county, and
> > counties have duplicate names in different states. You could sort by
> > state, then county, then use only county where Marc uses score$id in
> his
> > last example below, and it would get the last record for *every*
> county
> > regardless of duplicates. Does this sound correct?
> >
> > That's a handy bit of code!
> >
> > Cheers,
> > Bob
> 
> Bob,
> 
> You can test it using data here:
> 
> DF <- read.csv("http://www.nws.noaa.gov/nwr/SameCode.txt";,
>header = FALSE)
> 
> colnames(DF) <- c("Code", "County", "State")
> 
> > str(DF)
> 'data.frame':   3288 obs. of  3 variables:
>  $ Code  : int  1001 1003 1005 1007 1009 1011 1013 1015 1017 1019 ...
>  $ County: Factor w/ 1996 levels "Abbeville","Acadia",..: 97 105 116
> 169 186 249 259 272 326 348 ...
>  $ State : Factor w/ 60 levels "AK","AL","AR",..: 2 2 2 2 2 2 2 2 2 2
> ...
> 
> 
> The data is already sorted by State and then County.
> 
> 
> > system.time(DF.tail <- do.call("rbind", lapply(split(DF, DF$County),
> tail,  1)))
> [1] 6.851 0.085 7.085 0.000 0.000
> 
> 
> > str(DF.tail)
> 'data.frame':   1996 obs. of  3 variables:
>  $ Code  : int  45001 22001 16001 40001 55001 50001 72001 72003 72005
> 72007 ...
>  $ County: Factor w/ 1996 levels "Abbeville","Acadia",..: 1 2 3 4 5 6
7
> 8 9 10 ...
>  $ State : Factor w/ 60 levels "AK","AL","AR",..: 48 22 17 42 58 56 45
> 45 45 45 ...
> 
> 
> # How many unique county names in the source dataset?
> 
> > length(unique(DF$County))
> [1] 1996
> 
> 
> # Are they all the same unique counties?
> 
> > all(DF.tail$County == sort(unique(DF$County)))
> [1] TRUE
> 
> 
> It is curious to see just how many duplicates there are. For example:
> 
> > tail(sort(table(DF$County)))
> 
>MadisonJacksonLincoln   Franklin  Jefferson Washington
> 20 24 24 25 26 31
> 
> 
> > subset(DF, County == "Washington")
>   Code County State
> 651129 WashingtonAL
> 181   5143 WashingtonAR
> 304   8121 WashingtonCO
> 385  12133 WashingtonFL
> 535  13303 WashingtonGA
> 593  16087 WashingtonID
> 688  17189 WashingtonIL
> 783  18175 WashingtonIN
> 879  19183 WashingtonIA
> 987  20201 WashingtonKS
> 1106 21229 WashingtonKY
> 1167 22117 WashingtonLA
> 1189 23029 WashingtonME
> 1211 24043 WashingtonMD
> 1393 27163 WashingtonMN
> 1474 28151 WashingtonMS
> 1590 29221 WashingtonMO
> 1740 31177 WashingtonNE
> 1883 36115 WashingtonNY
> 1981 37187 WashingtonNC
> 2124 39167 WashingtonOH
> 2202 40147 WashingtonOK
> 2239 41067 WashingtonOR
> 2304 42125 WashingtonPA
> 2313 44009 WashingtonRI
> 2515 47179 WashingtonTN
> 2759 48477 WashingtonTX
> 2800 49053 WashingtonUT
> 2814 50023 WashingtonVT
> 2904 51191 WashingtonVA
> 3108 55131 WashingtonWI
> 
> 
> # The last state with Washington County (my neighbors, the
> "Cheeseheads") was in the result set
> 
> > subset(DF.tail, County == "Washington")
> Code County State
> Washington 55131 WashingtonWI
> 
> 
> 
> > subset(DF, County == "Allen")
>   Code County State
> 697  18003  AllenIN
> 887  20001  AllenKS
> 993  21003  AllenKY
> 1113 22003  AllenLA
> 2042 39003  AllenOH
> 
> 
> # The last state with Allen County (OH) was in the result set
> 
> > subset(DF.tail, County == "Allen")
>Code County State
> Allen 39003  AllenOH
> 
> 
> Just noticed a Big Ten theme there...Go Gophers!   ;-)
> 
> 
> So, it would seem that your hypothesis is correct, at least in this
> limit

[R] ar predict without noise

2007-03-21 Thread Michael John Shaw
Hi.

I am just getting started with R.  I would like to start by using one of
the autoregressive models (beginning at the very basic, perhaps with
just ar) to forecast a multivariate time series one step
ahead without noise and, while digging around for how to do so, maybe
someone can just tell me whether there is an option to set the noise term
to 0 (zero).

How do I set the noise term to zero?

Thank you.

--

Michael Shaw

Cooperative Institute for Research in Environmental Sciences
Campus Box 216
University of Colorado, Boulder, 80309-0216

303-492-3619
[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
and provide commented, minimal, self-contained, reproducible code.


[R] He wilma

2007-03-21 Thread Sonia KMohammed
Check this company out
C E O AMERICA I N C
SYm-CE OA
Currently : 6 Cents, CHEAP!!!
Add this to your radar

AN ALL AMERICAN COMPANY
Get IN Before the rush TOMORROW

 led the Pirates to a 68-55 record, a trip to the round of 16 in the 2000  
games and eight of their next nine.  ''This does a lot for our confidence,''  
We have to get back to the way we were before that game.''   The Suns, who   
nine years on Mike Krzyzewski's staff at Duke, where he was a four-year

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] package:AlgDesign and .Random.seed [Broadcast]

2007-03-21 Thread Liaw, Andy
From: Michael Kubovy
> 
> On Mar 21, 2007, at 4:16 AM, Uwe Ligges wrote:
> 
> > Michael Kubovy wrote:
> >> Dear r-helpers,
> >> Could you please help me solve the following problem: When I run
> >> require(AlgDesign)
> >> trt <- LETTERS[1:5]
> >> blk <- 10
> >> trtblk <- 3
> >> BIB <- optBlock(~., withinData = trt, blocksizes = 
> rep(trtblk, blk)) 
> >> In response to the last command, R complains:
> >> Error in optBlock(~., withinData = trt, blocksizes = rep(trtblk,
> >> blk)) :
> >>object ".Random.seed" not found
> >> The documentation of optBlock() in AlgDesign doesn't say that I   
> >> needed to set .Random.seed. I thought it was initiated 
> automatically  
> >> at the beginning of a session. What am I missing?
> >
> >
> > The first line in that function is
> > seed <- .Random.seed
> > but .Random.seed is generated at the first use of R's RNG, hence  
> > maybe later. This means the function contains a bug which you  
> > should report to the package maintainer, please.
> >
> > Best,
> > Uwe Ligges
> 
> Bob Wheeler's response:
> 
> > From: Bob Wheeler <[EMAIL PROTECTED]>
> > Date: March 21, 2007 9:19:29 AM EDT
> > To: Michael Kubovy <[EMAIL PROTECTED]>
> > Subject: Re:
> >
> > Each workspace in R requires you to set a random seed to 
> start. You  
> > have not done this. It is an R artifact, and has nothing to 
> do with  
> > AlgDesign.

I do not agree with that assessment (well, it's just my $0.02 anyway).
I don't need a random seed unless I'm doing computations that requires
pseudo-random numbers.  There are plenty of times I use R without
needing random seed.

None of the builtin RNGs in R requires explcit seed setting, nor does
any of the ones in the contributed packages that I know of.  Thus I
would claim that's a flaw in AlgDesign.

Andy

> > -- 
> > Bob Wheeler --- http://www.bobwheeler.com/
> >ECHIP, Inc. --- Randomness comes in bunches.
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 


--
Notice:  This e-mail message, together with any attachments,...{{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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] question on suppressing error messages with Rmath library

2007-03-21 Thread James W. MacDonald
Hi Ranjan,
Ranjan Maitra wrote:
> Dear list,
> 
> I have been using the Rmath library for quite a while: in the current
> instance, I am calling dnt (non-central t density function)
> repeatedly for several million. When the argument is small, I get the
> warning message:
> 
> full precision was not achieved in 'pnt'
> 
> which is nothing unexpected. (The density calls pnt, if you look at
> the function dnt.) However, to have this happen a huge number of
> times, when the optimizer is churning through the dataset is
> bothersome, but more importantly, a bottleneck in terms of speed. Is
> it possible to switch this off? Is there an setting somewhere that I
> am missing?

See ?options, particularly the section on 'warn'.

Best,

Jim


> 
> Many thanks and best wishes, Ranjan
> 
> __ 
> 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 and provide
> commented, minimal, self-contained, reproducible code.


-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623


**
Electronic Mail is not secure, may not be read every day, and should not be 
used for urgent or sensitive issues.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Prof Brian Ripley
On Wed, 21 Mar 2007, Mark Fisher wrote:

> I am new to R. I installed version 2.4.0 some time ago and I find that
> some packages I want to use require 2.4.1. I am using Windows XP. Do I
> need to uninstall R first before running the setup file for 2.4.1 or
> does the setup file "do the right thing"?

It 'does the right thing' as discussed in the rw-FAQ.  Please follow the 
posting guide.

-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] question on suppressing error messages with Rmath library

2007-03-21 Thread ronggui
op <- options(warn=-1)
[main codes here]
options(op)



On 3/21/07, Ranjan Maitra <[EMAIL PROTECTED]> wrote:
> Dear list,
>
> I have been using the Rmath library for quite a while: in the current 
> instance, I am calling dnt (non-central t density function) repeatedly for 
> several million. When the argument is small, I get the warning message:
>
> full precision was not achieved in 'pnt'
>
> which is nothing unexpected. (The density calls pnt, if you look at the 
> function dnt.) However, to have this happen a huge number of times, when the 
> optimizer is churning through the dataset is bothersome, but more 
> importantly, a bottleneck in terms of speed. Is it possible to switch this 
> off? Is there an setting somewhere that I am missing?
>
> Many thanks and best wishes,
> Ranjan
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Ronggui Huang
Department of Sociology
Fudan University, Shanghai, China

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] question on suppressing error messages with Rmath library

2007-03-21 Thread Ranjan Maitra
Dear list,

I have been using the Rmath library for quite a while: in the current instance, 
I am calling dnt (non-central t density function) repeatedly for several 
million. When the argument is small, I get the warning message:

full precision was not achieved in 'pnt'

which is nothing unexpected. (The density calls pnt, if you look at the 
function dnt.) However, to have this happen a huge number of times, when the 
optimizer is churning through the dataset is bothersome, but more importantly, 
a bottleneck in terms of speed. Is it possible to switch this off? Is there an 
setting somewhere that I am missing?

Many thanks and best wishes,
Ranjan

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Alberto Monteiro
Mark Fisher wrote:
> 
> I am new to R. I installed version 2.4.0 some time ago and I find 
> that some packages I want to use require 2.4.1. I am using Windows 
> XP. Do I need to uninstall R first before running the setup file for 
> 2.4.1 or does the setup file "do the right thing"?
> 
You don't have to uninstall. It does the right thing. 

But it will not delete the older 2.4.0 version from the Desktop, 
and all other places where Windows XP places programs.

Alberto Monteiro

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] package:AlgDesign and .Random.seed

2007-03-21 Thread Michael Kubovy
On Mar 21, 2007, at 4:16 AM, Uwe Ligges wrote:

> Michael Kubovy wrote:
>> Dear r-helpers,
>> Could you please help me solve the following problem: When I run
>> require(AlgDesign)
>> trt <- LETTERS[1:5]
>> blk <- 10
>> trtblk <- 3
>> BIB <- optBlock(~., withinData = trt, blocksizes = rep(trtblk, blk))
>> In response to the last command, R complains:
>> Error in optBlock(~., withinData = trt, blocksizes = rep(trtblk,  
>> blk)) :
>>  object ".Random.seed" not found
>> The documentation of optBlock() in AlgDesign doesn't say that I   
>> needed to set .Random.seed. I thought it was initiated  
>> automatically  at the beginning of a session. What am I missing?
>
>
> The first line in that function is
> seed <- .Random.seed
> but .Random.seed is generated at the first use of R's RNG, hence  
> maybe later. This means the function contains a bug which you  
> should report to the package maintainer, please.
>
> Best,
> Uwe Ligges

Bob Wheeler's response:

> From: Bob Wheeler <[EMAIL PROTECTED]>
> Date: March 21, 2007 9:19:29 AM EDT
> To: Michael Kubovy <[EMAIL PROTECTED]>
> Subject: Re:
>
> Each workspace in R requires you to set a random seed to start. You  
> have not done this. It is an R artifact, and has nothing to do with  
> AlgDesign.
> -- 
> Bob Wheeler --- http://www.bobwheeler.com/
>ECHIP, Inc. --- Randomness comes in bunches.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to get "lsmeans"?

2007-03-21 Thread Chuck Cleland
Liaw, Andy wrote:
> I verified the result from the following with output from JMP 6 on the
> same data (don't have SAS: don't need it):
> 
> set.seed(631)
> n <- 100
> dat <- data.frame(y=rnorm(n), A=factor(sample(1:2, n, replace=TRUE)),
>   B=factor(sample(1:2, n, replace=TRUE)),
>   C=factor(sample(1:2, n, replace=TRUE)),
>   d=rnorm(n))
> fm <- lm(y ~ A + B + C + d, dat)
> ## Form a data frame of points to predict: all combinations of the
> ## three factors and the mean of the covariate.
> p <- data.frame(expand.grid(A=1:2, B=1:2, C=1:2))
> p[] <- lapply(p, factor)
> p <- cbind(p, d=mean(dat$d))
> p <- cbind(yhat=predict(fm, p), p)
> ## lsmeans for the three factors:
> with(p, tapply(yhat, A, mean))
> with(p, tapply(yhat, B, mean))
> with(p, tapply(yhat, C, mean))

  Using Andy's example data, these are the LSMEANS and intervals I get
from SAS:

Ay LSMEAN  95% Confidence Limits
1   -0.071847   -0.387507 0.243813
2   -0.029621   -0.342358 0.283117

By LSMEAN  95% Confidence Limits
1   -0.104859   -0.397935 0.188216
20.003391   -0.333476 0.340258

Cy LSMEAN  95% Confidence Limits
1   -0.084679   -0.392343 0.222986
2   -0.016789   -0.336374 0.302795

  One way of reproducing the LSMEANS and intervals from SAS using
predict() seems to be the following:

> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
> newdat <- expand.grid(A=factor(c(1,2)),B=1.5,C=1.5,d=mean(dat$d))
> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
  A   B   C  d fitlwr   upr
1 1 1.5 1.5 0.09838595 -0.07184709 -0.3875070 0.2438128
2 2 1.5 1.5 0.09838595 -0.02962086 -0.3423582 0.2831165

  However, another possibility seems to be:

> dat.lm <- lm(y ~ A + as.numeric(B) + as.numeric(C) + d, data = dat)
> newdat <-
expand.grid(A=factor(c(1,2)),B=mean(as.numeric(dat$B)),C=mean(as.numeric(dat$C)),d=mean(dat$d))
> cbind(newdat, predict(dat.lm, newdat, interval="confidence"))
  ABC  d fitlwr   upr
1 1 1.43 1.48 0.09838595 -0.08078243 -0.3964661 0.2349012
2 2 1.43 1.48 0.09838595 -0.03855619 -0.3479589 0.2708465

  The predictions directly above match what effect() in the effects
package by John Fox returns:

library(effects)

> effect("A", fm, xlevels=list(d = mean(dat$D)))

 A effect
A
  1   2
-0.08078243 -0.03855619

  But for some reason the predict() and effect() intervals are a little
different:

> effect("A", fm, xlevels=list(d = mean(dat$D)))$lower
  [,1]
101 -0.3924451
102 -0.3440179

> effect("A", fm, xlevels=list(d = mean(dat$D)))$upper
 [,1]
101 0.2308802
102 0.2669055

  I would be interested in any comments on these different approaches
and on the difference in intervals returned by predict() and effect().

hope this helps,

Chuck

> Andy 
> 
> From: Xingwang Ye
>> Dear all, 
>>   
>> I search the mail list about this topic and learn that no 
>> simple way is available to get "lsmeans" in R as in SAS.
>> Dr.John Fox and Dr.Frank E Harrell have given very useful 
>> information about "lsmeans" topic.
>> Dr. Frank E Harrell suggests not to think about lsmeans, 
>> just to think about what predicted values wanted
>> and to use the predict function. However, after reading 
>> the R help file for a whole day, I am still unclear how to do it.
>> Could some one give me a hand? 
>>  
>> for example:
>>   
>> A,B and C are binomial variables(factors); d is a continuous 
>> variable ; The response variable Y is  a continuous variable too.  
>>
>> To get lsmeans of Y according to A,B and C, respectively, in 
>> SAS, I tried proc glm data=a;  class A B C;  model Y=A B C d; 
>>  lsmeans A B C/cl; run;  
>>
>> In R, I tried this:  
>>  library(Design)
>>  ddist<-datadist(a)
>>  options(datadist="ddist")
>>  f<-ols(Y~A+B+C+D,data=a,x=TRUE,y=TRUE,se.fit=TRUE)  
>>
>> then how to get the "lsmeans" for A, B, and C, respectively 
>> with predict function?
>>
>>  
>>
>> Best wishes
>> yours, sincerely 
>> Xingwang Ye
>> PhD candidate 
>> Research Group of Nutrition Related Cancers and Other Chronic 
>> Diseases  
>> Institute for Nutritional Sciences,  
>> Shanghai Institutes of Biological Sciences, 
>> Chinese Academy of Sciences 
>> P.O.Box 32 
>> 294 Taiyuan Road 
>> Shanghai 200031 
>> P.R.CHINA
>>
>>
> 
> 
> --
> Notice:  This e-mail message, together with any attachments,...{{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
> and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th 

[R] substitution matrix for amino acid

2007-03-21 Thread Nora Muda
Hi,
 
I want to compute the pairwise distances of amino acid
sequences and then construct the phylogenetic tree. I
noticed that ape package  support only for DNA
sequences and compute the pairwise distances by using
dist.dna function. Can anyone suggest what package
that support for protein sequences and then construct
the phylogenetic tree?
 
Thank you in advance for any help.
 
Nora.



 

We won't tell. Get more on shows you hate to love

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Gaussian Adaptive Quadrature

2007-03-21 Thread Douglas Bates
On 3/21/07, Doran, Harold <[EMAIL PROTECTED]> wrote:
> The function integrate() uses AGQ. There are other functions for
> gaussian quadrature in the statmod() package that I really like.

I think that integrate does adaptive quadrature but not adaptive
Gaussian quadrature (which probably should have been called adaptive
Gauss-Hermite quadrature to be more specific).  In the first case the
"adaptive" refers to a choice of mesh size.  In the second case one is
integrating a function that is close to a multivariate Gaussian
density by first finding the conditional optimum of the integrand and
using a quadratic approximation to the log-integrand to establish the
location of the Gauss-Hermite quadrature points.

The Laplace approximation to the log-likelihood for a generalized
linear mixed model is a 1-point adaptive Gauss-Hermite quadrature
evaluation.

>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Caio
> > Lucidius Naberezny Azevedo
> > Sent: Wednesday, March 21, 2007 5:55 AM
> > To: Help mailing list - R
> > Subject: [R] Gaussian Adaptive Quadrature
> >
> > Hi all,
> >
> >   Does anybody know any function that performs gaussian
> > adapative quadrature integration of univariate functions?
> >
> >   Thanks in advance,
> >
> >   Regards,
> >
> > Caio
> >
> >  __
> >
> >
> >   [[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
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] newbie upgrade from 2.4.0 to 2.4.1 question

2007-03-21 Thread Mark Fisher
Hi,

I am new to R. I installed version 2.4.0 some time ago and I find that 
some packages I want to use require 2.4.1. I am using Windows XP. Do I 
need to uninstall R first before running the setup file for 2.4.1 or 
does the setup file "do the right thing"?

--Mark.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to get "lsmeans"?

2007-03-21 Thread Liaw, Andy
I verified the result from the following with output from JMP 6 on the
same data (don't have SAS: don't need it):

set.seed(631)
n <- 100
dat <- data.frame(y=rnorm(n), A=factor(sample(1:2, n, replace=TRUE)),
  B=factor(sample(1:2, n, replace=TRUE)),
  C=factor(sample(1:2, n, replace=TRUE)),
  d=rnorm(n))
fm <- lm(y ~ A + B + C + d, dat)
## Form a data frame of points to predict: all combinations of the
## three factors and the mean of the covariate.
p <- data.frame(expand.grid(A=1:2, B=1:2, C=1:2))
p[] <- lapply(p, factor)
p <- cbind(p, d=mean(dat$d))
p <- cbind(yhat=predict(fm, p), p)
## lsmeans for the three factors:
with(p, tapply(yhat, A, mean))
with(p, tapply(yhat, B, mean))
with(p, tapply(yhat, C, mean))

Andy 

From: Xingwang Ye
> 
> Dear all, 
>   
> I search the mail list about this topic and learn that no 
> simple way is available to get "lsmeans" in R as in SAS.
> Dr.John Fox and Dr.Frank E Harrell have given very useful 
> information about "lsmeans" topic.
> Dr. Frank E Harrell suggests not to think about lsmeans, 
> just to think about what predicted values wanted
> and to use the predict function. However, after reading 
> the R help file for a whole day, I am still unclear how to do it.
> Could some one give me a hand? 
>  
> for example:
>   
> A,B and C are binomial variables(factors); d is a continuous 
> variable ; The response variable Y is  a continuous variable too.  
> 
> To get lsmeans of Y according to A,B and C, respectively, in 
> SAS, I tried proc glm data=a;  class A B C;  model Y=A B C d; 
>  lsmeans A B C/cl; run;  
> 
> In R, I tried this:  
>  library(Design)
>  ddist<-datadist(a)
>  options(datadist="ddist")
>  f<-ols(Y~A+B+C+D,data=a,x=TRUE,y=TRUE,se.fit=TRUE)  
> 
> then how to get the "lsmeans" for A, B, and C, respectively 
> with predict function?
> 
>  
> 
> Best wishes
> yours, sincerely 
> Xingwang Ye
> PhD candidate 
> Research Group of Nutrition Related Cancers and Other Chronic 
> Diseases  
> Institute for Nutritional Sciences,  
> Shanghai Institutes of Biological Sciences, 
> Chinese Academy of Sciences 
> P.O.Box 32 
> 294 Taiyuan Road 
> Shanghai 200031 
> P.R.CHINA
> 
> 


--
Notice:  This e-mail message, together with any attachments,...{{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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Over-writing functions from other packages? What is a good strategy??

2007-03-21 Thread Gabor Grothendieck
Sometimes but its also easy to forget about simple solutions.

On 3/21/07, Alberto Monteiro <[EMAIL PROTECTED]> wrote:
> Gabor Grothendieck wrote:
> >
> > Could you call yours Edges?
> >
> Is it a good idea to have two different functions, whose name
> differs by case sensitivity? I believe this is a shortcut to
> Chaos :-)
>
> IMHO, case sensitivity should _only_ be used for aesthetical
> purposes, else it may result in errors that are very difficult
> to find. Of course, YKMV.[*]
>
> Alberto Monteiro
>
> [*] I always use S.I. units :-)
>
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Detailed legend in mathplot ...

2007-03-21 Thread Petr Pikal
Hi

you can put quite sophisticated legend using legend command e.g.

legend(locator(1), legend=c("first", "second"), pch=c(21,22), lty = 
c(2,1))

Regards
Petr

On 21 Mar 2007 at 8:38, Petar Milin wrote:

From:   Petar Milin <[EMAIL PROTECTED]>
To: r-help 
Organization:   Department of Psychology, University of Novi Sad, Serbia
Date sent:  Wed, 21 Mar 2007 08:38:25 +0100
Subject:[R] Detailed legend in mathplot ...

> Hello,
> Recently, I have asked for a help with building graphs, and I got few
> great advices. Now, my appetite is growing :) and I wander how to add
> legend for two (or more) lines in following example:
> 
> matplot(DAT[, c(3,4)], type="b", ylim=c(0,8), xaxt="n", yaxt="n",
>  + pch=c(21,22), col="black", lty=c("dashed","solid"), xlab="",
>  ylab="")
> title(ylab="% correct", xlab="Trial", cex.lab=1.5)
> axis(1, at=1:4, labels=as.character(DAT$Trial), cex.axis=1.5)
> axis(2, cex.axis=1.5)
> 
> 
> Sincerely,
> Petar
> 
> __
> 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 and provide commented,
> minimal, self-contained, reproducible code.

Petr Pikal
[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Detailed legend in mathplot ...

2007-03-21 Thread Uwe Ligges


Petar Milin wrote:
> You are absolutely right, and I apologize. Here is the data.frame:
> no day concentrated distributed
> 1 4 7 6.8
> 2 5 3 6
> 3 6 2.3 5.65
> 4 7 1.6 5.30
> 9 8 0.9 4.95
> 
> And then, if DAT = data.frame, mathplot() should do the job.


So what is the problem with creating the legend? Is the help page for 
?legend not clear enough? I'd just do straightforward

legend(1, 1, legend = names(DAT)[3:4], lty = c("dashed", "solid"))

Otherwise, I do not understand your question.

Best,
Uwe Ligges



> Thank you in advance,
> Petar
> 
> 
> On Wed, 2007-03-21 at 09:37 +0100, Uwe Ligges wrote:
>> Petar Milin wrote:
>>> Hello,
>>> Recently, I have asked for a help with building graphs, and I got few
>>> great advices. Now, my appetite is growing :) and I wander how to add
>>> legend for two (or more) lines in following example:
>>>
>>> matplot(DAT[, c(3,4)], type="b", ylim=c(0,8), xaxt="n", yaxt="n",
>>>  + pch=c(21,22), col="black", lty=c("dashed","solid"), xlab="", ylab="")
>>> title(ylab="% correct", xlab="Trial", cex.lab=1.5)
>>> axis(1, at=1:4, labels=as.character(DAT$Trial), cex.axis=1.5)
>>> axis(2, cex.axis=1.5)
>>>
>> We do not have DAT, why don't you make it easier for us to help by 
>> specifying a very tiny data.frame that fits to your code?
>>
>> Best,
>> Uwe Ligges
>>
>>
>>> Sincerely,
>>> Petar
>>>
>>> __
>>> 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
>>> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Gaussian Adaptive Quadrature

2007-03-21 Thread Doran, Harold
The function integrate() uses AGQ. There are other functions for
gaussian quadrature in the statmod() package that I really like. 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Caio 
> Lucidius Naberezny Azevedo
> Sent: Wednesday, March 21, 2007 5:55 AM
> To: Help mailing list - R
> Subject: [R] Gaussian Adaptive Quadrature
> 
> Hi all,
>
>   Does anybody know any function that performs gaussian 
> adapative quadrature integration of univariate functions?
>
>   Thanks in advance,
>
>   Regards,
>   
> Caio
> 
>  __
> 
> 
>   [[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
> and provide commented, minimal, self-contained, reproducible code.
>

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Integer Optimization

2007-03-21 Thread Mahieux Dimitri
Hello everybody,

I am looking for a function (or package) which can solve a integer 
optimization problem.  I have found the glpk package but I don't known 
very well how to use it.
Someone has another solution ?

thx

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Detailed legend in mathplot ...

2007-03-21 Thread Petar Milin

You are absolutely right, and I apologize. Here is the data.frame:
no day concentrated distributed
1 4 7 6.8
2 5 3 6
3 6 2.3 5.65
4 7 1.6 5.30
9 8 0.9 4.95

And then, if DAT = data.frame, mathplot() should do the job.

Thank you in advance,
Petar


On Wed, 2007-03-21 at 09:37 +0100, Uwe Ligges wrote:
> 
> Petar Milin wrote:
> > Hello,
> > Recently, I have asked for a help with building graphs, and I got few
> > great advices. Now, my appetite is growing :) and I wander how to add
> > legend for two (or more) lines in following example:
> > 
> > matplot(DAT[, c(3,4)], type="b", ylim=c(0,8), xaxt="n", yaxt="n",
> >  + pch=c(21,22), col="black", lty=c("dashed","solid"), xlab="", ylab="")
> > title(ylab="% correct", xlab="Trial", cex.lab=1.5)
> > axis(1, at=1:4, labels=as.character(DAT$Trial), cex.axis=1.5)
> > axis(2, cex.axis=1.5)
> >
> 
> We do not have DAT, why don't you make it easier for us to help by 
> specifying a very tiny data.frame that fits to your code?
> 
> Best,
> Uwe Ligges
> 
> 
> > 
> > Sincerely,
> > Petar
> > 
> > __
> > 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
> > and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Over-writing functions from other packages? What is a good strategy??

2007-03-21 Thread Alberto Monteiro
Gabor Grothendieck wrote:
>
> Could you call yours Edges?
>
Is it a good idea to have two different functions, whose name
differs by case sensitivity? I believe this is a shortcut to
Chaos :-)

IMHO, case sensitivity should _only_ be used for aesthetical
purposes, else it may result in errors that are very difficult
to find. Of course, YKMV.[*]

Alberto Monteiro
 
[*] I always use S.I. units :-)

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Gaussian Adaptive Quadrature

2007-03-21 Thread Caio Lucidius Naberezny Azevedo
Hi all,
   
  Does anybody know any function that performs gaussian adapative quadrature 
integration of univariate functions?
   
  Thanks in advance,
   
  Regards,
  
Caio

 __


[[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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Ticks on barplots

2007-03-21 Thread Jim Lemon
Michael H. Prager wrote:
> Dear Gurus,
> 
> Using R 2.4.1 on Windows XP
> 
> I am generating stacked barplots of age-composition of fish populations 
> (Y) over time (X).  As there are many years, not every bars is labeled.  
> When looking at the plot, it becomes difficult to associate labels with 
> their bars.
> 
> We have improved this a bit by using axis() to add a tickmark below each 
> bar.  Can anyone suggest a way to draw ticks ONLY at bars where a tick 
> label is drawn?  Or to make such ticks longer than those where there is 
> no label?
> 
> This is going into a function, so I'm hoping for a method that doesn't 
> require looking at the plot first.
> 
> I have attached a PDF.
> 
> # sample code (simplified) #
> mp <- barplot(t(N.age), xlab = "Year", axisnames = FALSE)
> axis(side = 1, at = mp, labels = rownames(N.age), tcl = -0.75)
> 
Hi Mike,
PDF didn't get through, but I think I understand what you want. Here's a 
suggestion:

oddaxlab<-function(side=1,at,labels) {
  at<-at[which(nchar(labels)>0)]
  labels<-labels[which(nchar(labels)>0)]
  axis(side,at,labels)
}
groupie<-matrix(rnorm(32)+3,nrow=8)
labels<-matrix(c(c("1","","","","5","","7",""),
  c("","","","","13","","",""),
  c("17","","","20","","","",""),
  c("25","","","","","","31","")),nrow=8)
bpos<-barplot(groupie,beside=TRUE)
oddaxlab(at=barpos,labels=labels)

What the function does is only draw ticks and labels where there is a 
non-empty label. You pass only those labels that you want to appear. 
Hope I have gotten the right idea.

Jim

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] multcomp

2007-03-21 Thread Chuck Cleland
Nair, Murlidharan T wrote:
> Thanks for the hint. 
> Here is what I had done earlier according to the old package
>  
>  mult.comp<-simint(a~b, data=z, conf.level=0.99, type=c("Tukey") )
>  isoforms<-as.vector(rownames(mult.comp$estimate))
>  estimate<-as.vector(mult.comp$estimate)
>  lower<-as.vector(mult.comp$conf.int[,1])
>  upper<-as.vector(mult.comp$conf.int[,2])
>  p.val.raw<-as.vector(mult.comp$p.value.raw)
>  
> Here is how I modified the above so that I can use the new package. Can 
> someone comment if what I have done is correct or not?
> amod<-aov(a~b, data=z)
> mult.comp<-glht(amod, linfct=mcp(b="Tukey"))
> estimate<-confint(mult.comp)[1,1]
> lower<-confint(mult.comp)[1,2]
> upper<-confint(mult.comp)[1,3]
> summary(mult.comp) does give the adjusted pvalues.  I tried all the 
> subscripts to extract it to store in a variable but could not, can any one 
> help me here. Also,  how do I specify the conf.level to be equal to 0.99. The 
> default is 0.95

  To specify a confidence level other than the default, see the help
page for confint().

library(multcomp)
amod <- aov(breaks ~ tension, data = warpbreaks)
mc <- glht(amod, linfct = mcp(tension = "Tukey"))
confint(mc, level = .99)

 Simultaneous Confidence Intervals for General Linear Hypotheses

Multiple Comparisons of Means: Tukey Contrasts

Fit: aov(formula = breaks ~ tension, data = warpbreaks)

Estimated Quantile = 3.0494

Linear Hypotheses:
   Estimate lwr  upr
M - L == 0 -10. -22.0764   2.0764
H - L == 0 -14.7222 -26.7986  -2.6458
H - M == 0  -4.7222 -16.7986   7.3542

99% family-wise confidence level

  To see how to extract the p-values, str() is useful:

str(summary(mc))
summary(mc)$test$pvalues

[1] 0.038569618 0.001440005 0.463049425
attr(,"error")
[1] 0.000226511

> Thanks for your help,
> Cheers../Murli
> 
>  
> 
> 
> From: talepanda [mailto:[EMAIL PROTECTED]
> Sent: Sun 3/18/2007 11:07 PM
> To: Nair, Murlidharan T
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] multcomp
> 
> 
> 
> ?glht says
>> with 'print', 'summary',  'confint', 'coef' and 'vcov'  methods
>> being available.
> 
> try:
> 
> example(glht)
> summary(glht(amod, linfct = mcp(tension = "Tukey")))
> confint(glht(amod, linfct = mcp(tension = "Tukey")))
> 
> On 3/19/07, Nair, Murlidharan T <[EMAIL PROTECTED]> wrote:
>> I used the multcomp package sometime back for doing multiple
>> comparisons. I see that it has been updated and the methods like simint
>> are no longer supported. When I run the program it prompts to me to use
>> glht. How do I get the lower and upper conf int and the pValues using
>> glht? Does anyone have an example?
>>
>> Thanks ../Murli
>>
>>
>>
>>
>>   [[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
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Strange integer result on Debian/amd64

2007-03-21 Thread Dave Ewart
On Wednesday, 21.03.2007 at 09:29 +, Prof Brian Ripley wrote:

> >OK, I understand the problem now.  I was wondering if it something along
> >those lines, but initially dismissed that as a possibility since I
> >expected 'choose' to be an integer calculation.
> 
> It is not, because it would be far too easy to get integer overflow.

Yes, of course.  And, also, as I have now remembered, it is perfectly
feasible to use non-integer parameters to n-choose-k as well.

It is clearly too long since I did my Stats degrees *blush*

> >However, the underlying problem that gave rise to the difficulty was as
> >follows.  A colleague wishes to create a matrix, where one of the
> >dimensions of the matrix is the result of the 'choose' function, i.e.
> >
> > mycols<-choose(11,6)
> > a_matrix<-matrix(0,nrow=11,ncol=mycols)
> >
> >Clearly, 'ncol' casts mycols as as integer.  In this case, a_matrix has
> >only 461 columns, not 462.
> >
> >What's the best way to make this work as required?
> 
> Use round(mycols).  I think we ought to do this internally: we do when 
> using computations via beta/gamma functions.

*nods* - thanks.

Dave.
-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016


signature.asc
Description: Digital signature
__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Strange integer result on Debian/amd64

2007-03-21 Thread Prof Brian Ripley
On Wed, 21 Mar 2007, Dave Ewart wrote:

> On Wednesday, 21.03.2007 at 14:07 +0800, Berwin A Turlach wrote:
>
>>> All help/suggestions/appreciated!
>>
>> The calculations are done in floating point arithmetic, not integer
>> arithmetic. From the help page on `choose' one might already guess
>> so much, but reading "R-2.4.1/src/nmath/choose.c" definitely confirms
>> this fact.
>>
>> Thus, your problem is covered by FAQ 7.31:
>>
>> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
>
> Thanks Berwin.
>
> OK, I understand the problem now.  I was wondering if it something along
> those lines, but initially dismissed that as a possibility since I
> expected 'choose' to be an integer calculation.

It is not, because it would be far too easy to get integer overflow.

> However, the underlying problem that gave rise to the difficulty was as
> follows.  A colleague wishes to create a matrix, where one of the
> dimensions of the matrix is the result of the 'choose' function, i.e.
>
>  mycols<-choose(11,6)
>  a_matrix<-matrix(0,nrow=11,ncol=mycols)
>
> Clearly, 'ncol' casts mycols as as integer.  In this case, a_matrix has
> only 461 columns, not 462.
>
> What's the best way to make this work as required?

Use round(mycols).  I think we ought to do this internally: we do when 
using computations via beta/gamma functions.

-- 
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Strange integer result on Debian/amd64

2007-03-21 Thread Dave Ewart
On Wednesday, 21.03.2007 at 09:10 +, Dave Ewart wrote:

> However, the underlying problem that gave rise to the difficulty was as
> follows.  A colleague wishes to create a matrix, where one of the
> dimensions of the matrix is the result of the 'choose' function, i.e.
> 
>   mycols<-choose(11,6)
>   a_matrix<-matrix(0,nrow=11,ncol=mycols)
> 
> Clearly, 'ncol' casts mycols as as integer.  In this case, a_matrix has
> only 461 columns, not 462.

Ignore me, obviously one can simply do:

a_matrix<-matrix(0,nrow=11,ncol=round(mycols))

Thanks again,

Dave.
-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016


signature.asc
Description: Digital signature
__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Strange integer result on Debian/amd64

2007-03-21 Thread Dave Ewart
On Wednesday, 21.03.2007 at 14:07 +0800, Berwin A Turlach wrote:

> > All help/suggestions/appreciated!
> 
> The calculations are done in floating point arithmetic, not integer
> arithmetic. From the help page on `choose' one might already guess
> so much, but reading "R-2.4.1/src/nmath/choose.c" definitely confirms
> this fact.
> 
> Thus, your problem is covered by FAQ 7.31:
> 
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

Thanks Berwin.

OK, I understand the problem now.  I was wondering if it something along
those lines, but initially dismissed that as a possibility since I
expected 'choose' to be an integer calculation. 

However, the underlying problem that gave rise to the difficulty was as
follows.  A colleague wishes to create a matrix, where one of the
dimensions of the matrix is the result of the 'choose' function, i.e.

  mycols<-choose(11,6)
  a_matrix<-matrix(0,nrow=11,ncol=mycols)

Clearly, 'ncol' casts mycols as as integer.  In this case, a_matrix has
only 461 columns, not 462.

What's the best way to make this work as required?

Dave.
-- 
Dave Ewart
[EMAIL PROTECTED]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016


signature.asc
Description: Digital signature
__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Detailed legend in mathplot ...

2007-03-21 Thread Uwe Ligges


Petar Milin wrote:
> Hello,
> Recently, I have asked for a help with building graphs, and I got few
> great advices. Now, my appetite is growing :) and I wander how to add
> legend for two (or more) lines in following example:
> 
> matplot(DAT[, c(3,4)], type="b", ylim=c(0,8), xaxt="n", yaxt="n",
>  + pch=c(21,22), col="black", lty=c("dashed","solid"), xlab="", ylab="")
> title(ylab="% correct", xlab="Trial", cex.lab=1.5)
> axis(1, at=1:4, labels=as.character(DAT$Trial), cex.axis=1.5)
> axis(2, cex.axis=1.5)
>

We do not have DAT, why don't you make it easier for us to help by 
specifying a very tiny data.frame that fits to your code?

Best,
Uwe Ligges


> 
> Sincerely,
> Petar
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] package:AlgDesign and .Random.seed

2007-03-21 Thread Uwe Ligges


Michael Kubovy wrote:
> Dear r-helpers,
> 
> Could you please help me solve the following problem: When I run
> 
> require(AlgDesign)
> trt <- LETTERS[1:5]
> blk <- 10
> trtblk <- 3
> BIB <- optBlock(~., withinData = trt, blocksizes = rep(trtblk, blk))
> 
> In response to the last command, R complains:
> 
> Error in optBlock(~., withinData = trt, blocksizes = rep(trtblk, blk)) :
>   object ".Random.seed" not found
> 
> The documentation of optBlock() in AlgDesign doesn't say that I  
> needed to set .Random.seed. I thought it was initiated automatically  
> at the beginning of a session. What am I missing?


The first line in that function is
 seed <- .Random.seed
but .Random.seed is generated at the first use of R's RNG, hence maybe 
later. This means the function contains a bug which you should report to 
the package maintainer, please.

Best,
Uwe Ligges




>  > sessionInfo()
> R version 2.4.1 (2006-12-18)
> i386-apple-darwin8.8.1
> 
> locale:
> C
> 
> attached base packages:
> [1] "grid"  "datasets"  "stats" "graphics"  "grDevices"  
> "utils" "methods"   "base"
> 
> other attached packages:
> AlgDesign   xtable latticeExtra  lattice  
> gridBase MASS  JGR   iplots
>   "1.0-7"  "1.4-3"  "0.1-4""0.14-16"  "0.4-3"  
> "7.2-32" "1.4-15"  "1.0-5"
>JavaGDrJava
>   "0.3-6" "0.4-14"
> 
> 
> 
> 
> 
> _
> Professor Michael Kubovy
> University of Virginia
> Department of Psychology
> USPS: P.O.Box 400400Charlottesville, VA 22904-4400
> Parcels:Room 102Gilmer Hall
>  McCormick RoadCharlottesville, VA 22903
> Office:B011+1-434-982-4729
> Lab:B019+1-434-982-4751
> Fax:+1-434-982-4766
> WWW:http://www.people.virginia.edu/~mk9y/
> 
> __
> 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
> and provide commented, minimal, self-contained, reproducible code.

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] how to get "lsmeans"?

2007-03-21 Thread Xingwang Ye
Dear all, 
  
I search the mail list about this topic and learn that no simple way is 
available to get "lsmeans" in R as in SAS.
Dr.John Fox and Dr.Frank E Harrell have given very useful information about 
"lsmeans" topic.
Dr. Frank E Harrell suggests not to think about lsmeans, just to think 
about what predicted values wanted
and to use the predict function. However, after reading the R help file for 
a whole day, I am still unclear how to do it.
Could some one give me a hand? 
 
for example:
  
A,B and C are binomial variables(factors); d is a continuous variable ;
The response variable Y is  a continuous variable too.  

To get lsmeans of Y according to A,B and C, respectively, in SAS, I tried  
proc glm data=a;  
 class A B C;  
 model Y=A B C d;  
 lsmeans A B C/cl;  
run;  

In R, I tried this:  
 library(Design)  
 ddist<-datadist(a)  
 options(datadist="ddist")  
 f<-ols(Y~A+B+C+D,data=a,x=TRUE,y=TRUE,se.fit=TRUE)  

then how to get the "lsmeans" for A, B, and C, respectively with predict 
function?

 

Best wishes 
yours, sincerely 
Xingwang Ye
PhD candidate 
Research Group of Nutrition Related Cancers and Other Chronic Diseases  
Institute for Nutritional Sciences,  
Shanghai Institutes of Biological Sciences, 
Chinese Academy of Sciences 
P.O.Box 32 
294 Taiyuan Road 
Shanghai 200031 
P.R.CHINA

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] error installing packages

2007-03-21 Thread Prof Brian Ripley
On Tue, 20 Mar 2007, Bernardo Rangel Tura wrote:

> On Wed, 2007-03-07 at 09:33 -0800, Bricklemyer, Ross S wrote:
>> I was finally able to get R to 'configure', 'make', and 'install' on 
>> Mandriva 2007.  Itried to install gnomeGUI and I received an error.  See 
>> below.  At what step do I make R a shared library?  Where did I go wrong?
>>
>> Ross
>>
>> ==
>> downloaded 74Kb
>>
>> * Installing *Frontend* package 'gnomeGUI' ...
>> Using R Installation in R_HOME=/usr/local/lib64/R
>> R was not built as a shared library
>> Need a shared R library
>> ERROR: configuration failed for package 'gnomeGUI'
>> * Removing '/usr/local/lib64/R/library/gnomeGUI'
>>
>> The downloaded packages are in
>> /root/tmp/RtmpkHUeyA/downloaded_packages
>> Warning message:
>> installation of package 'gnomeGUI' had non-zero exit status in: 
>> install.packages(c("gnomeGUI"))
>> =
>
>
> Hi Ross!
>
> I use Ubuntu and instaling R using Synaptic. In this software have this
> observation about GnomeGUI:
>
> As of R 2.1.0, this interface is no longer provided with the upstream
> sources. As such, this package is now an empty stub that will be removed
> in a subsequent revision of the Debian package.
>
> So I think  gnomeGUI not instalable in R now...

This is almost entirely misinformation.  gnomeGUI is a package on CRAN 
(and has been for a couple of years), and can be installed just like any 
other package.  Like several others, it requires R to have been configured 
with --enable-R-shlib.

Please file a bug report on the Debian package that is misleading you.

[GNOME has moved on since gnomeGUI was written, and you may well find that 
you need to install older GNOME components to make use of it.]

-- 
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
and provide commented, minimal, self-contained, reproducible code.