Re: [R] Using functions in LAPACK in a C program

2007-03-30 Thread Prof Brian Ripley
I can keep the pace of R development. Paul. - Original Message - From: Prof Brian Ripley <[EMAIL PROTECTED]> Date: Friday, March 30, 2007 1:56 am Subject: Re: [R] Using functions in LAPACK in a C program To: Paul August <[EMAIL PROTECTED]> Cc: r-help@stat

Re: [R] Minimum valid number of observations for rpart

2007-03-30 Thread Prof Brian Ripley
On Fri, 30 Mar 2007, [EMAIL PROTECTED] wrote: Hi, I wonder if anyone knows a study dealing with the minimum valid number of observations when using CART?. I have no idea what you mean by 'valid' here. Could you answer the question for logistic regression to indicate to us what form of answer

Re: [R] Hmisc summary.formula.reverse export problem

2007-03-29 Thread Prof Brian Ripley
Well, write.table works on 'tables', that is matrix-like objects. An object summary is not matrix-like. You may be looking for capture.output(print(taulu3), file="O:/taulu1.txt") On Fri, 30 Mar 2007, Lauri Nikkinen wrote: > Dear R-users, > > I'm trying to export object taulu3 from R to a text

Re: [R] Regarding Vista

2007-03-29 Thread Prof Brian Ripley
Please to both of you: check the advice in the R 2.5.0 alpha version of the rw-FAQ. That has worked for everyone else who has reported a problem with installing packages on Vista. I've placed a copy online at http://www.stats.ox.ac.uk/pub/R/rw-FAQ.html specifically http://www.stats.ox.ac.uk/pub

Re: [R] Using functions in LAPACK in a C program

2007-03-29 Thread Prof Brian Ripley
On Thu, 29 Mar 2007, Paul August wrote: > Hi, > > I wonder where I can find an example of using a function in LAPACK > library in a user's own C code. In about 20 R packages, e.g. the recommended package mgcv. > I wrote a C program which will be > compiled and linked to produce a DLL file and

Re: [R] gls bug?

2007-03-29 Thread Prof Brian Ripley
On Fri, 16 Mar 2007, simon bond wrote: > I found that the following code crashes R (version 2.4.0 in windows). > >> x=rnorm(10,0.1,1) >> library(nlme) >> gls(x~0) > > I quickly found a work-around for what I was trying to do, but I thought > I should report this. This will be fixed (to give a se

Re: [R] C interface

2007-03-29 Thread Prof Brian Ripley
We don't know what document that is, and you haven't given us a useful pointer, have you? And the authors (presumably Roger Peng and Jan de Leeuw) deserve credit. The definitive documentation is the 'Writing R Extensions' manual which ships with R. There is also a lot in 'S Programming' (see

Re: [R] Large matrix into a vector

2007-03-28 Thread Prof Brian Ripley
We have already seen three solutions. I don't like to see the use of c() for its side effects. In this case Marc's as.vector seems to me to be self-explanatory, and that is a virtue in programming that is too often undervalued. On Wed, 28 Mar 2007, Marc Schwartz wrote: > On Wed, 2007-03-28 at

Re: [R] what is the difference between survival analysis and (...)

2007-03-28 Thread Prof Brian Ripley
That is not the only way to apply logistic regression to this problem (although it is a common error in the analysis of cancer studies). One can discretize time and apply logistic regression to survival over each short time period (jointly): doing so comes pretty close to what the Cox proporti

Re: [R] Problem with adding packages to default start-up list

2007-03-28 Thread Prof Brian Ripley
On Wed, 28 Mar 2007, Jeff Lusk wrote: > After reading the help files (?Startup) and using > RSiteSearch("defaultPackages"), I have been trying to add several packages > to my default startup list using the following code: > > local({ > old<-getOption("defaultPackages") > options(defaultPackages=c(

Re: [R] changes in behaviour of Rcmd SHLIB since 2.4.0

2007-03-28 Thread Prof Brian Ripley
On Wed, 28 Mar 2007, [EMAIL PROTECTED] wrote: > > Dear all, > > I have some C code using the zlib uncompress. It compiles fine under Win XP > (with SP2) with R up to 2.3.1 and generates four files (Makedeps, *.d, > *.dll, and *.o): No one every said that zlib interface would be exported from R, a

Re: [R] Regarding Vista

2007-03-28 Thread Prof Brian Ripley
On Wed, 28 Mar 2007, [EMAIL PROTECTED] wrote: > The Vista issue is not innocent as it threatens the life of R within > large corporations. So any posts on how R runs under Vista and what has > to be done to make it work and what cannot be done etc will be very > useful. See the rw-FAQ in the R

Re: [R] Jackknife estimates of predict.lda success rate

2007-03-27 Thread Prof Brian Ripley
Reposting the same message is not making it any easier for your audience to understand. You need to tell us what you mean by your subject line and 'jackknife reclassification'. Given these are far from standard terms, either you mean something else (and 'jackknife' is very frequently misused

Re: [R] Error in nlme with factors in R 2.4.1

2007-03-27 Thread Prof Brian Ripley
HERBICIDE is already a factor, and this works without the unneeded factor() calls. Notice that you used a different version of nlme in R 2.4.0 and R 2.4.1, so you have not established that the change in R version is responsible. In fact, it is not: it is caused by the update of nlme to 3.1-78 an

Re: [R] problem with installation of packages

2007-03-26 Thread Prof Brian Ripley
This is an internet access problem (there is missing space in the message that has been corrected since 2.4.1) The issue is > Warning: unable to access index for repository > http://cran.wustl.edu/src/contrib That is an issue specific to your setup, but why is someone mailing from an Indian ad

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-26 Thread Prof Brian Ripley
Yes, sqlDrop does not work correctly for Excel worksheet names (and there are other quirks). As I said in another message, it is on my TODO list to make this work better, but in the absence of good documentation of what the Excel ODBC driver should do and several with known bugs it is largely a

Re: [R] setting LD_LIBRARY_PATH

2007-03-26 Thread Prof Brian Ripley
On Mon, 26 Mar 2007, ian white wrote: > Dear R-help, > > I am trying to use a package (not from CRAN) which includes two shared > library (.so) files. The maintainer suggests inserting two lines > in /usr/bin/R, > > LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:path-to-package/lib > export LD_LIBRARY_PATH (

Re: [R] Problem in loading all packages all at once

2007-03-26 Thread Prof Brian Ripley
I really don't know what is going on here, beyond that 'utils' has not been loaded. But 1) You are not supposed to edit system files like library/base/R/Rprofile. If you do, don't ask for help! 2) I don't see how the output shown came from the input shown: almost surely it did not. 3) It is e

Re: [R] a very small query

2007-03-26 Thread Prof Brian Ripley
On Mon, 26 Mar 2007, [EMAIL PROTECTED] wrote: > what is the command to give me the listing of the loaded packages. ?search ?sessionInfo (sessionInfo massages the output of search() to show only packages). > I mean which are active and not the listing of all the installed > packages as given by

Re: [R] DCOM graphics bug?

2007-03-26 Thread Prof Brian Ripley
Assuming this is about the R (D)COM server from http://cran.r-project.org/contrib/extra/dcom/00ReadMe.html please note that it has its own mailing lists (accessed via the link on that page). You will need to tell people the versions of everything you used (as the R posting guide asked you to).

Re: [R] sort argument in mosaicplot

2007-03-25 Thread Prof Brian Ripley
On Sun, 25 Mar 2007, Jean lobry wrote: x <- matrix(1:4,2,2) mosaicplot(x) # This one is OK mosaicplot(x, sort = 1:length(dim(x)) ) please, seq_len(dim(x)) is designed for this task. # Not OK, I have the following error message: Erreur dans mosaicplot.default(x, sort = 1:length(dim(x))) :

Re: [R] write.csv feature/bug with pipe

2007-03-25 Thread Prof Brian Ripley
This is simply user error: the column names _are_ written to the pipe. Because the connection was not open, the connection is opened to write the column names, closed, opened to write the data and then closed. In any case, you should call close() on connections you create to avoid leaking connec

Re: [R] Sys.setlocale("LC_CTYPE","fr_FR.UTF-8")

2007-03-24 Thread Prof Brian Ripley
On Sun, 11 Mar 2007, NOEL Yvonnick wrote: > Dear R users, > > I'm trying to have a gWiddgetsRGtk2 script run under R-2.4.1. The script > run OK under Linux but all accentuated characters appear as "?" when the > script is run under Windows. > > As Gtk+ requires UTF-8, I thought it was the source o

Re: [R] creating R packs for all

2007-03-23 Thread Prof Brian Ripley
On Fri, 23 Mar 2007, Erin Hodgess wrote: > Dear R People: > > I am in the process of creating an R package via Windows. > > If I would decide to submit in to CRAN, what would I need to > do in order to make it run for the Linux or Mac People, please? If it passes R CMD check on Windows it should

Re: [R] Get "home" directory and simple I/O

2007-03-23 Thread Prof Brian Ripley
But the request was for a *generic* solution. On Windows there might not be anything corresponding to a home directory (and the rw-FAQ discusses the concept and how R resolves this). The best answer I know of is path.expand("~"). On Fri, 23 Mar 2007, Henrik Andersson wrote: > Sys.getenv("HOME"

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Prof Brian Ripley
On Fri, 23 Mar 2007, Prof Brian Ripley wrote: > The problem is that way the ODBC driver exposes table names is not valid > SQL, and nor is the way quoting has to be used. You can get around this > via direct SQL sent by sqlQuery. In addition, by default the Excel ODBC > driver gi

Re: [R] landscape pdf

2007-03-23 Thread Prof Brian Ripley
PDF does not have orientation: just set the width > height in pdf() to get a 'landscape' plot. The 'horizontal' option in postscript() was originally (in S/S-PLUS) designed for sending plots direct to a printer: pdf() does not have that option either. On Fri, 23 Mar 2007, Sebastian Weber wrote

Re: [R] Updating a worksheet in Excel file using RODBC

2007-03-23 Thread Prof Brian Ripley
The problem is that way the ODBC driver exposes table names is not valid SQL, and nor is the way quoting has to be used. You can get around this via direct SQL sent by sqlQuery. In addition, by default the Excel ODBC driver gives you read-only access to worksheets. Searching the list archives

Re: [R] difftime / RBloomberg

2007-03-22 Thread Prof Brian Ripley
n zoo RDCOMClientMASS > xtablesurvivalsvSocketsvIO R2HTML svMisc > "1.1-7""0.1-10" "2.3-8" "1.2-1""0.91-0""7.2-30" > "1.4-2" "2.30" &

Re: [R] difftime / RBloomberg

2007-03-22 Thread Prof Brian Ripley
On Thu, 22 Mar 2007, Schiller Judith 1541 EB wrote: > hi, > > I've troubles with some difftime objects. e.g. > > ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) - 2 > > works, telling me "Time difference of 57 days". But when I'd like to add > days, such as > > ISOdate(2001, 4, 26) - ISOdate(2001, 2,

Re: [R] problem with RCurl install on Unix

2007-03-22 Thread Prof Brian Ripley
On Thu, 22 Mar 2007, Martin Maechler wrote: >> "Steven" == Steven McKinney <[EMAIL PROTECTED]> >> on Wed, 21 Mar 2007 19:29:43 -0700 writes: > >Steven> I get the same problem, and haven't >Steven> figured it out yet. > >Steven> Is it a 32bit/64bit clash? > > Well, I can ins

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

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)), >>

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

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 mu

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

Re: [R] odbcConnect - no data source and default driver

2007-03-20 Thread Prof Brian Ripley
You need to read the documentation for your ODBC driver manager (presumably iODBC) on your unstated OS. You do need to set up a DSN or driver and the error message is that you have not done so. [I have used iODBC in the past but no longer do so. As I recall Debian Linux has it set up in a non

Re: [R] CPU usage on Windows

2007-03-19 Thread Prof Brian Ripley
On Mon, 19 Mar 2007, Jonathan Wang wrote: > On 3/16/07, Richard M. Heiberger <[EMAIL PROTECTED]> wrote: >> I can't imagine using Windows without Emacs. >> In particular, the Windows ports of Emacs are very aware >> of the operating system and usually make the right assumptions. >> >> The type of b

Re: [R] Setting site-wide default CRAN repository?

2007-03-18 Thread Prof Brian Ripley
On Sun, 18 Mar 2007, Tim Keitt wrote: > I can't seem to find this anywhere. How do I set the default CRAN > repository _site wide_ on a linux box? What I want to do is eliminate > the pop-up list of repository locations when using > 'install.packages()'. I know how to do this for a single account.

Re: [R] Problem Loading rggobi package

2007-03-18 Thread Prof Brian Ripley
This is really a GGobi issue not an R issue, but I believe their mailing lists are down. I think you are assuming that it is rggobi.dll that cannot be found, but that is not what the message says. I would have expected Windows to give you a dialog box telling you the exact problem, and I suspe

Re: [R] Error with get_all_vars()

2007-03-18 Thread Prof Brian Ripley
AFAIK there is no get_all_vars() in any released version of R, and this is NOT the place to report on unreleased ('Under development (unstable)') versions of R (and especially not on non-current versions). (Please use the R-devel list to comment on current development versions.) This was fixed

Re: [R] Lag operator in R does not work

2007-03-17 Thread Prof Brian Ripley
On Sun, 18 Mar 2007, [EMAIL PROTECTED] wrote: > Hi - I'm quite wondering what makes the lag operator does not work for my > time series. I have a time series of length about 20 elements. I would > like to have a lag 1 of this time series. I did the following: > > logprice = log(price, base=e

Re: [R] problem with mfg argument of par

2007-03-17 Thread Prof Brian Ripley
The problem here is that setting par(mfg =) does an implicit par(new=TRUE) on the next plot (as otherwise it would advance to the next position). That is going to be confusing if there has been no plot, and that is what you are seeing: the first plot is done at c(1,1), overriding the setting of

Re: [R] Font in JavaGD() & pdf()

2007-03-17 Thread Prof Brian Ripley
what do you mean by 'send the figure to pdf'? My guess is that this is a Mac-specific question (e.g. you are using the R.app GUI), so please consider if this is the appropriate list. On Fri, 16 Mar 2007, Kubovy Michael wrote: > Dear r-helpers, > > When I do an xYplot and display the result in a

Re: [R] Bad points in regression

2007-03-16 Thread Prof Brian Ripley
On Fri, 16 Mar 2007, Alberto Monteiro wrote: > Ted Harding wrote: >> >>> alpha <- 0.3 >>> beta <- 0.4 >>> sigma <- 0.5 >>> err <- rnorm(100) >>> err[15] <- 5; err[25] <- -4; err[50] <- 10 >>> x <- 1:100 >>> y <- alpha + beta * x + sigma * err >>> ll <- lm(y ~ x) >>> plot(ll) >> >> ll is the output

Re: [R] Problem installing R onto Solaris 2.10 system - need advice!!!!!

2007-03-16 Thread Prof Brian Ripley
It seems you are using f90, but FLIBS was computed using g77. That would mean that something has been altered since R was configured, or that the way the Fortran compiler was specified was incorrect. I think you need to start again and make use of only one set of compilers. On Fri, 16 Mar 2007

Re: [R] ARIMA standard error

2007-03-16 Thread Prof Brian Ripley
On Fri, 16 Mar 2007, Gad Abraham wrote: > Andrew Robinson wrote: >> Hi Gad, >> >> try: >> >> >>> class(a) >> [1] "Arima" >>> getAnywhere(print.Arima) > > Thanks Andrew. > > For the record, the standard error is the square root of the diagonal of > the covariance matrix a$var.coef (itself obtained

Re: [R] error code 5 from Lapack routine 'dsyevr'

2007-03-16 Thread Prof Brian Ripley
On Fri, 16 Mar 2007, Richard D. Morey wrote: > While using the rmvnorm function, I get the error: > > Error in eigen(sigma, sym = TRUE) : error code 5 from Lapack routine > 'dsyevr' > > The same thing happens when I try the eigen() function on my covariance > matrix. The matrix is a symmetric 111x

Re: [R] Redirecting output to the screen

2007-03-15 Thread Prof Brian Ripley
This is much easier in R-devel: just use message() and scan("stdin"). gannet% cat Test.R message("Enter file name: ", appendLF=FALSE) fn <- scan("stdin", what="", n=1) works for me in R-devel via R --vanilla -f Test.R > Rout.txt I believe it also works under Windows. On Wed, 14 Mar 2007, John S

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread Prof Brian Ripley
It is inefficient to use which() rather than a logical index, since you allocate two numeric index vectors (one the length of the original vector) and use an interpreted function rather than optimized C code. Also, in this usage which() handles NAs incorrectly. I think the clearest answer is pro

Re: [R] how to show date with this subset

2007-02-22 Thread Prof Brian Ripley
On Fri, 23 Feb 2007, Alfonso Sammassimo wrote: > Dear List, > > Thankyou to Jim and Marc for their help on my previous question. > > I have a data frame of five columns, the first being a list of dates and the > other four columns are numeric values. I wanted to list the days where all 4 > columns

Re: [R] residuals and glm

2007-02-22 Thread Prof Brian Ripley
On Thu, 22 Feb 2007, Martin Olivier wrote: > I have some problems to compute the residuals from a glm model with > binomial distribution. > > Suppose I have the following result : > resfit<-glm(y~x1+x2,weights=we,family=binomial(link="logit")) > > Now I would like to obtain the residuals . the co

Re: [R] MANOVA usage

2007-02-22 Thread Prof Brian Ripley
On Thu, 22 Feb 2007, Aalim Weljie wrote: > Hello, > > I had a couple questions about manova modeling in R. > > I have calculated a manova model, and generated a summary.manova output > using both the Wilks test and Pillai test. > > The output is essentially the same, except that the Wilks lambda

Re: [R] applying lm on an array of observations with common design matrix

2007-02-22 Thread Prof Brian Ripley
On Thu, 22 Feb 2007, Petr Klasterecky wrote: > Ranjan Maitra napsal(a): >> On Sun, 18 Feb 2007 07:46:56 +0000 (GMT) Prof Brian Ripley <[EMAIL >> PROTECTED]> wrote: >> >>> On Sat, 17 Feb 2007, Ranjan Maitra wrote: >>> >>>> Dear list, >&

Re: [R] Data frame operations getting slower when accessed by index

2007-02-21 Thread Prof Brian Ripley
What are D and M? 'Index' here could be a number or a name. In either case, df[[D]] would be the equivalent of df$D. However, your computation does not need a loop at all, let alone two. Try something like tmp <- with(df, paste(D, m)) dates <- unique(tmp) On Wed, 21 Feb 2007, Alp ATICI wrote

Re: [R] simple question on one-sided p-values for coef() on output of lm()

2007-02-21 Thread Prof Brian Ripley
On Wed, 21 Feb 2007, Ranjan Maitra wrote: > I was wondering if it is possible to get the p-values for one-sided > tests on the parameters of a linear regression. > > For instance, I use lm() and store the result in an object. lm() gives > me a matrix, using summary() and coef() on which gives me

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Prof Brian Ripley
BSD manual for math(3) > says: > > The log2() and nan() functions are missing, and many functions > are not available in their long double variants. > > > I do not know how to locate the library that contains function log2, sorry. > What can I do next to help? >

Re: [R] R unstable and crashes after executing .C

2007-02-21 Thread Prof Brian Ripley
This really is the wrong list for C programming questions related to R. See the posting guide and consider R-devel. See also the debugging advice in 'Writing R Extensions'. Almost certainly your C code has destroyed R structures, most likely by writing outside array bounds. Running under valgri

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Prof Brian Ripley
; implemented in nls or optim is preferred? Yes, unless perhaps you are trying to achieve a perfect fit, when all bets are off for nls. > > > Prof Brian Ripley wrote: >> Well, the algorithm used does not affect the confidence interval >> (provided it works correctly), but what

Re: [R] Confindence interval for Levenberg-Marquardt fit

2007-02-21 Thread Prof Brian Ripley
Well, the algorithm used does not affect the confidence interval (provided it works correctly), but what is nls.ml (presumably in some package you have not mentioned) and why would I want to use an old-fashioned algorithm? You could start nls at the solution you got from nls.ml and use confint(

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-20 Thread Prof Brian Ripley
The problem is that rgl is apparently written for GNU make, and has (as shipped) ifdef MAKINGAGL [EMAIL PROTECTED]@ -Iext [EMAIL PROTECTED]@ else PKG_CPPFLAGS= -If:/R/R-2.4.1/src/extra/zlib -DHAVE_PNG_H -If:/R/R-2.4.1/src/gnuwin32/bitmap/libpng -Iext PKG_LIBS=-lgdi32 -lopengl32 -lglu32 -Lf:/R/

Re: [R] contextstack overflow

2007-02-20 Thread Prof Brian Ripley
On Tue, 20 Feb 2007, Steven Finch wrote: Hello! I written several implementations in R of Rémy's algorithm for generating random ordered strictly binary trees on 2n+1 vertices. One implementation involves manufacturing character strings like: "X <- list(0,list(0,0))" for the case n=2. If I

Re: [R] Installing Package rgl - Compilation Fails - Summary

2007-02-20 Thread Prof Brian Ripley
On Tue, 20 Feb 2007, Ranjan Maitra wrote: > Hi Duncan, > > I don't know if this will list all the dependencies for your > documentation, since Rick's error messages did not involve libraries and > header files already installed by him for something else, perhaps. It will not, and most of this i

Re: [R] linux gplots install unhappy

2007-02-20 Thread Prof Brian Ripley
On Tue, 20 Feb 2007, Marc Schwartz wrote: > On Tue, 2007-02-20 at 10:17 -0800, Randy Zelick wrote: >> Hello all, >> >> I use R on both windows and a "mainframe" linux installation (RedHat >> enterprise 3.0, which they tell me is soon to be upgraded to 4.0). On >> windows I installed the package gp

Re: [R] summary polr

2007-02-20 Thread Prof Brian Ripley
That's not it (the function is 'coef' not 'coeff', and R can tell functions and lists apart). If you read the help page for polr you will see you could have used Hess=TRUE. It works then. THAT is why we needed an example, to see how you used the function. On Tue, 20 Feb 2007, Michael Dewey

Re: [R] tree()

2007-02-20 Thread Prof Brian Ripley
This is a function of your data and the tuning parameters you chose to use. See ?tree.control. On Tue, 20 Feb 2007, stephenc wrote: > Hi > > I am trying to use tree() to classify movements in a futures contract. My > data is like this: > > diff dip dim

Re: [R] Difficulties with dataframe filter using elements from an array created using a for loop or seq()

2007-02-20 Thread Prof Brian Ripley
FAQ Q7.31 On Tue, 20 Feb 2007, Todd A. Johnson wrote: > Hi All- > > This seems like such a pathetic problem to be posting about, but I have no > idea why this testcase does not work. I have tried this using R 2.4.1, > 2.4.0, 2.3.0, and 2.0.0 on several different computers (Mac OS 10.4.8, > Windo

Re: [R] Installing Rmpi on FC5 with lam

2007-02-19 Thread Prof Brian Ripley
Is /usr/lib/lam in your ld search path? This sort of message usually means a shared library cannot be found. You do need lam-libs as well according to yum. R CMD ldd /usr/lib/R/library/Rmpi/libs/Rmpi.so /sbin/ldconfig -p | grep /usr/lib/lam might be illuminating. There are various problems w

Re: [R] Installing Package rgl - Compilation Fails

2007-02-19 Thread Prof Brian Ripley
You are missing the OpenGLU headers. On FC5 they are in mesa-libGLU-devel From the README: REQUIREMENTS Windowing System (osx/carbon, unix/x11 or win32) OpenGL Library OpenGL Utility Library (GLU) On Mon, 19 Feb 2007, Rick Bilonick wrote: I'm running R 2.4.1 (with the latest

Re: [R] Documenting options specific to a package.

2007-02-19 Thread Prof Brian Ripley
(An R-devel topic, I believe.) I would have documentation for options() in the package that documented the additional options and linked to \code{\link[base]{options}}. Users will be given a choice of which page to view on most systems, so just make sure the title makes clear that this is option

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Prof Brian Ripley
On Mon, 19 Feb 2007, Johannes Graumann wrote: > On Monday 19 February 2007 11:53, Prof Brian Ripley wrote: >> do.call("pmax", dataframe[,intensityindeces]) > Thank you very much for your help! > > Any idea why do.call("pmax",list(na.rm=TRUE),dataframe[,inten

Re: [R] Data frame: how to create list of row max?

2007-02-19 Thread Prof Brian Ripley
do.call("pmax", dataframe[,intensityindeces]) if I understand you aright. On Mon, 19 Feb 2007, Johannes Graumann wrote: > Dear all, > > Can anyone please shed some light onto how to do this? > > This will give me all "intensity" columsn in my data frame: > intensityindeces <- grep("^Intensity",n

Re: [R] dbi, rodbc, rmysql, charset problem

2007-02-18 Thread Prof Brian Ripley
You seem never to have told R or us what charset these data are in. I think it is likely that they are being transferred in latin2 (like your email), and you are running R in UTF-8 according to Sys.getlocale. So what you need to do is to either 1) Run R in latin2 or 2) use iconv() to conver

Re: [R] applying lm on an array of observations with common design matrix

2007-02-17 Thread Prof Brian Ripley
On Sat, 17 Feb 2007, Ranjan Maitra wrote: > Dear list, > > I have a 4-dimensional array Y of dimension 330 x 67 x 35 x 51. I have a > design matrix X of dimension 330 x 4. I want to fit a linear regression > of each > > lm( Y[, i, j, k] ~ X). for each i, j, k. > > Can I do it in one shot without

Re: [R] reading text file not table

2007-02-17 Thread Prof Brian Ripley
I think he is missing fill=TRUE, which is the default for read.csv but not read.table. (As Ted Harding implied but as I recall did not spell out.) If you want to read a file as text, used readLines. You can then extract the lines you want and use read.table on a textConnection from just those

Re: [R] missing -> nonmissing levels

2007-02-16 Thread Prof Brian Ripley
Well, if it is missing, how do you know what level to turn it back into? That is what NA means in R: not available. If you want missings to be a separate level, you could use factor(as.character(X), exclude=NULL) [1] A B Levels: A B BTW, using summary() for a length-3 object is not helpf

Re: [R] optim() and resultant hessian

2007-02-16 Thread Prof Brian Ripley
On Fri, 16 Feb 2007, Brian Healey wrote: > R users; > > A question about optimization within R. > > I've been using both optim() and nlminb() to estimate parameters and all > seems to be working fine. For context (but without getting into specifics - > sorry), I'm working with a problem that is kn

Re: [R] Working with temporal data [Solved]

2007-02-16 Thread Prof Brian Ripley
On Fri, 16 Feb 2007, Marc Schwartz wrote: On Fri, 2007-02-16 at 15:39 +, Sérgio Nunes wrote: Just for the record, here are my steps for producing a date based histogram. Data is stored in a file where each line only has a date - 2007/02/16 d<-readLines("filename.dat") d<-as.Date(d, format

Re: [R] SPSS and library(foreign)

2007-02-16 Thread Prof Brian Ripley
On Fri, 16 Feb 2007, Anthony Staines wrote: > Hi, > I have a valid SPSS .sav file (which I can open happily in SPSS v11 on > Windows XP). > > Opening it in R2.41 on Linux we get this message :- > >> HSE3023 <- read.spss("HSE.sav") > Error in read.spss("HSE.sav") : > error reading system-file

Re: [R] Unable to connect to PostgreSQL

2007-02-15 Thread Prof Brian Ripley
It looks like you are trying to use package DBI (without telling us). That is of no use without a specific DBMS interface, e.g. packages RMySQL, ROracle and RSQLite. AFAIK, there is no DBI interface to PostgreSQL. RODBC works well, RJDBC may well work (if Java works for your system) and there

Re: [R] lapply and use.names howto

2007-02-15 Thread Prof Brian Ripley
On Thu, 15 Feb 2007, Johannes Graumann wrote: > How do I make R use the use.names option in a context like this: What 'use.names option'? sapply has a USE.NAMES argument, but lapply does not. > lapply(data, function(x)(read.table(x,quote="",header=TRUE,sep="\t")), > use.names=TRUE) 'data' is

Re: [R] se.contrast confusion

2007-02-13 Thread Prof Brian Ripley
On Tue, 13 Feb 2007, Adam D. I. Kramer wrote: > Hello, > > I've got what I'd expect to be a pretty simple issue: I fit an aov object > using multiple error strata, and would like some significance tests for the > contrasts I specified. It _is_ covered on the relevant help page. See the 'split' a

Re: [R] Generating MVN Data

2007-02-13 Thread Prof Brian Ripley
'should work', yes. Do what he asked for (in any reasonable reading), no. > set.seed(1) > library(mvtnorm) ## you both omitted to mention that > X <- rmvnorm(n=10,mean=1:2,sigma=matrix(c(1,0.5,0.5,1),2,2)) > var(X) [,1] [,2] [1,] 0.4878773 0.1238040 [2,] 0.1238040 0.9508090 For

Re: [R] How to get the polynomials out of poly()

2007-02-12 Thread Prof Brian Ripley
plot(raw=TRUE) does this for you: there is little point in fitting by orthogonal polynomials and then converting back. As the help page says quite explicitly, poly() does not store the orthogonal polynomials: please also consult the reference it gives. It also points out that predict() creates

Re: [R] Boxplot: quartiles/outliers

2007-02-11 Thread Prof Brian Ripley
If you look at boxplot.default you will see that it calls boxplot.stats to compute the statistics used. So you can make renamed copies of both functions and alter them to behave as you like. (Because of namespace issues, you cannot just use your own boxplot.stats.) I am not sure why you would

Re: [R] dyn.load problem under linux

2007-02-10 Thread Prof Brian Ripley
This is a mismatch of compiler between the machine that the code was compiled on and that running the code. >> '/usr/lib/R/library/POP.R/libs/ezlic20.so': >> libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file libstdc++-libc6.2-2.so.3 is a g++ runtime. On my FC5 system it is

Re: [R] how to eval subset?

2007-02-09 Thread Prof Brian Ripley
You mean the 'subset' argument to model.frame and not subset() the function, I think. The answer is on the help page for model.frame[.default]. All the variables in 'formula', 'subset' and in '...' are looked for first in 'data' and then in the environment of 'formula' (see the

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
-level n-args solution handling NAs is quite a lot faster. On Fri, 9 Feb 2007, Martin Maechler wrote: >>>>>> "TL" == Thomas Lumley <[EMAIL PROTECTED]> >>>>>> on Fri, 9 Feb 2007 08:13:54 -0800 (PST) writes: > >TL> On 2/9/07, Pr

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
On Fri, 9 Feb 2007, Frank E Harrell Jr wrote: [...] > I looked in all the code for the Hmisc and Design packages and didn't find a > single example where pmin or pmax did not have 2 arguments. So I think it is > important to have pmin2 and pmax2. Why? Do you have any reason to suppose that t

Re: [R] Timings of function execution in R [was Re: R in Industry]

2007-02-09 Thread Prof Brian Ripley
The other reason why pmin/pmax are preferable to your functions is that they are fully generic. It is not easy to write C code which takes into account that <, [, [<- and is.na are all generic. That is not to say that it is not worth having faster restricted alternatives, as indeed we do with

Re: [R] densityplot png in a for loop

2007-02-09 Thread Prof Brian Ripley
This is FAQ Q7.22 On Fri, 9 Feb 2007, Albert Vilella wrote: > Hi all, > > I am trying to plot a list of densityplots as png files, but when I do > it in a for loop, I get empty png files as a result. > > If I manually run the instructions inside the loop, it works... any hints? > > library(lattic

Re: [R] Data.frame columns in R console

2007-02-09 Thread Prof Brian Ripley
ery useful system, my sincere thanks goes to R developers! > > > > -Lauri > > > 2007/2/8, Prof Brian Ripley <[EMAIL PROTECTED]>: >> >> ?options, look for 'width'. >> >> I don't know what OS this in: the Windows Rgui has an optio

Re: [R] "class" package

2007-02-09 Thread Prof Brian Ripley
It is part of the VR bundle and should be in all R installations, as a recommended package. Did you try > library(class) ? If that really does not work, please re-install R. On Fri, 9 Feb 2007, XinMeng wrote: > Hello sir: > Where can I download the package "class"? > What I can find is only:

Re: [R] Data.frame columns in R console

2007-02-08 Thread Prof Brian Ripley
?options, look for 'width'. I don't know what OS this in: the Windows Rgui has an option to set the width to the width of the console, but you can override it. On Thu, 8 Feb 2007, Lauri Nikkinen wrote: > Hi R-users, > > > > A newbie question: assume that I have for example 30 columns in my > dat

Re: [R] Impossible to get jpeg or png output

2007-02-08 Thread Prof Brian Ripley
Probably you have no write permission in the current directory. That message means (as it says) that the process cannot open the file for writing, and that is not an R issue. On Thu, 8 Feb 2007, Mahieux Dimitri wrote: Hi, When I want to output a png file, I have the following error message

Re: [R] Re : Re: setting a number of values to NA over a data.frame.

2007-02-08 Thread Prof Brian Ripley
I think you do understand it. Indexing a data frame by a logical matrix is provided just for applications like this and the reverse, mydf[is.na(mydf)] <- something prettyR's toNA seems to believe that data frames can be other than 2D, which is surprising. On Thu, 8 Feb 2007, Olivier ETERRADOS

Re: [R] path for source()

2007-02-08 Thread Prof Brian Ripley
I don't think anyone have answered the actual question yet. The answer is simple: the search path for search is '.', the current directory. Just as it is for almost all the software on your system except binaries and package addons (including, e.g. R's search path for packages). But R is a

Re: [R] problems installing R on Linux

2007-02-07 Thread Prof Brian Ripley
We don't know what 'Linux' is here. What Linux distribution, what are your C and Fortran compilers (in detail, e.g. from gcc --version and g77 --version)? We need to see the tail of tests/Examples/base-Ex.Rout.fail to know what went wrong. If you can supply those pieces of information we can

Re: [R] How-To construct a cov list to use a covariance matrix in factanal?

2007-02-07 Thread Prof Brian Ripley
We still do not have reproducible code, but a 'dataframe' is not a matrix. And I would expect a covariance matrix to have the same row and column names: the examples do. On Wed, 7 Feb 2007, Alistair Campbell wrote: > Thanks for that Brian, > > I have worked through the examples. They work becaus

Re: [R] glm gamma scale parameter

2007-02-06 Thread Prof Brian Ripley
els > The role of dispersion parameter for the Gamma family is rather > different. This is a parametric family which can be fitted by maximum > likelihood, including its shape parameter > > > Jill Willie > Open Seas > Safeco Insurance > [EMAIL PROTECTED] > >

<    1   2   3   4   5   6   7   8   9   10   >