Re: [R] How to do ANOVA with fractional values and overcome the error: Error in `storage.mode<-`(`*tmp*`, value = "double") : invalid to change the storage mode of a factor

2007-09-06 Thread Prof Brian Ripley
Your data file has commas as the decimal point. Use read.csv2 for such files. What happened was that PercentError was read as a factor, and you can't do ANOVA on factors. The warning > In addition: Warning message: > using type="numeric" with a factor response will be ignored in: > model.respo

Re: [R] Rggobi compilation error: display.c

2007-09-05 Thread Prof Brian Ripley
On Wed, 5 Sep 2007, Yuelin Li wrote: On a ubuntu linux computer (Feisty, i386), I compile R and additional packages from source. The compiler is gcc 4.1.2. The problem is, I can run "sudo R" and successfully compile all packages (e.g., MASS, lattice) except rggobi. The error seems to be in di

Re: [R] Choosing the optimum lag order of ARIMA model

2007-09-05 Thread Prof Brian Ripley
On Wed, 5 Sep 2007, Megh Dal wrote: > Hi Leeds, Thanx for this reply. Actually I did not want to know whether > any differentiation is needed or not. My question was that : what is the > difference between two models : > > arima(data, c(2,1,2)) > > and > > arima(diff(data), c(2,0,2)) > > If

Re: [R] capture.out(system())?

2007-09-05 Thread Prof Brian Ripley
On Wed, 5 Sep 2007, Gustaf Rydevik wrote: > On 9/4/07, Werner Wernersen <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I am trying to capture the console output of program I >> call via system() but that always returns only >> character(0). >> >> For example: >> capture.output(system("pdflatex out.tex")

Re: [R] bootstrap confidence intervals with previously existing bootstrap sample

2007-09-04 Thread Prof Brian Ripley
On Tue, 4 Sep 2007, [EMAIL PROTECTED] wrote: > Dear R users, > > I am new to R. I would like to calculate bootstrap confidence intervals > using the BCa method for a parameter of interest. My situation is this: I > already have a set of 1000 bootstrap replicates created from my original > data set

Re: [R] Efficient sampling from a discrete distribution in R

2007-09-03 Thread Prof Brian Ripley
On Mon, 3 Sep 2007, Issac Trotts wrote: > Hello r-help, > > As far as I've seen, there is no function in R dedicated to sampling > from a discrete distribution with a specified mass function. The > standard library doesn't come with anything called rdiscrete or rpmf, > and I can't find any such t

Re: [R] Different behavior of mtext

2007-09-03 Thread Prof Brian Ripley
legend text on the device but to align the text to the left of this block. Prof Brian Ripley a écrit : On Sun, 2 Sep 2007, Sébastien wrote: Dear R Users, I am quite surprised to see that mtext gives different results when it is used with 'pairs' and with "plot'. In the tw

Re: [R] Different behavior of mtext

2007-09-03 Thread Prof Brian Ripley
On Sun, 2 Sep 2007, Sébastien wrote: Dear R Users, I am quite surprised to see that mtext gives different results when it is used with 'pairs' and with "plot'. In the two following codes, it seems that the 'at' argument in mtext doesn't consider the same unit system. It is stated to be in 'us

Re: [R] sin(pi)?

2007-09-03 Thread Prof Brian Ripley
On Mon, 3 Sep 2007, Nguyen Dinh Nguyen wrote: > Dear all, > I found something strange when calculating sin of pi value What exactly? Comments below on two guesses as to what. > sin(pi) > [1] 1.224606e-16 That is non-zero due to using finite-precision arithmetic. The number stored as pi is no

Re: [R] About "=" in command line in windows.

2007-08-31 Thread Prof Brian Ripley
On Fri, 31 Aug 2007, Vladimir Eremeev wrote: > It seems, I don't understand something, or there is a bug in R. A limitation in command-line parsing which is Windows-specific. Don't use -e for complex expressions, as the quoting is getting removed by your shell. In Windows both the shell (and i

Re: [R] Incomplete Gamma function

2007-08-31 Thread Prof Brian Ripley
On Fri, 31 Aug 2007, Robin Hankin wrote: > Hi Kris > > > lgamma() gives the log of the gamma function. Yes, but he used Igamma. According to ?pgamma, 'pgamma' is closely related to the incomplete gamma function. As defined by Abramowitz and Stegun 6.5.1 P(a,x) = 1/Gamma(

Re: [R] R and Windows Vista

2007-08-31 Thread Prof Brian Ripley
On Thu, 30 Aug 2007, Jan Budczies wrote: > > Hello group, > > it is reported (R for Windows FAQ) that R runs under Windows Vista. > However, does someone here have experience with R under Vista 64 > and large (>3 or 4 GB) memory? Yes, the person who wrote the FAQ entry does. Note that the distri

Re: [R] Choosing the optimum lag order of ARIMA model

2007-08-31 Thread Prof Brian Ripley
On Fri, 31 Aug 2007, Megh Dal wrote: > Dear all R users, > > I am really struggling to determine the most appropriate lag order of > ARIMA model. My understanding is that, as for MA [q] model the auto > correlation coeff vanishes after q lag, it says the MA order of a ARIMA > model, and for a

Re: [R] Q: how to interrupt long calculation?

2007-08-30 Thread Prof Brian Ripley
On Thu, 30 Aug 2007, D. R. Evans wrote: > Prof Brian Ripley said the following at 08/30/2007 11:00 AM : >> On Thu, 30 Aug 2007, D. R. Evans wrote: >> >>> Paul Smith said the following at 08/29/2007 04:32 PM : >>> >>>> The instance of R runnin

Re: [R] Q: how to interrupt long calculation?

2007-08-30 Thread Prof Brian Ripley
On Thu, 30 Aug 2007, D. R. Evans wrote: > Paul Smith said the following at 08/29/2007 04:32 PM : > >> The instance of R running will be immediately killed and then you can >> start R again. > > But then I would lose all the work. There must be some way to merely > interrupt the current calculation

Re: [R] Behaviour of very large numbers

2007-08-30 Thread Prof Brian Ripley
On Thu, 30 Aug 2007, willem vervoort wrote: > Dear all, > I am struggling to understand this. > > What happens when you raise a negative value to a power and the result > is a very large number? Where are the 'very large numbers' here? R can cope with much larger numbers (over 10^300). > B > [

Re: [R] Another issue with the Matrix package *under R-devel*

2007-08-30 Thread Prof Brian Ripley
I suspect you have not using a re-installed Matrix after re-building R. I can reproduce the problem using a version of Matrix I installed under 2.5.1, but not with one installed under R-devel this week. Since R-devel is 'Under development' you may need to reinstall packages when it changes. Thi

Re: [R] xeon processor and ATLAS

2007-08-29 Thread Prof Brian Ripley
On Tue, 28 Aug 2007, hui xie wrote: > hi everyone: > > I have a Dell Server that has a Xeon processor, and I would like to use > the best ATLAS posted in the R website. I find that R has ATLAS for > core2duo and P4. I am not sure which one of these two is best suited for > Xeon processor, or is

Re: [R] sql query over local tables

2007-08-29 Thread Prof Brian Ripley
On Tue, 28 Aug 2007, Jorge Cornejo Donoso wrote: > Hi i have to table with IDs in each one. And what is a 'table'? If these are data frames, see ?merge. If they are tables (which are arrays in R), then still use merge() if they can be converted to data frames. > I want to make a join (as in

Re: [R] Rmpi and x86

2007-08-28 Thread Prof Brian Ripley
On Tue, 28 Aug 2007, Martin Morgan wrote: > Edna -- > > I'll keep this on the list, so that others will learn, and others will > correct me when I give bad advice! > >> relocation R_X86_64_32 against `lam_mpi_comm_world' can not be used >> when making a shared object; recompile with -fPIC > > This

Re: [R] Forcing coefficients in lm object

2007-08-28 Thread Prof Brian Ripley
It is fit$coefficients, not fit$coef . From the help page: name: A literal character string or a name (possibly backtick quoted). For extraction, this is normally (see under Environments) partially matched to the 'names' of the object. Note the qualifier 'for extracti

Re: [R] Limiting size of pairs plots

2007-08-28 Thread Prof Brian Ripley
From ?pairs The graphical parameter 'oma' will be set by 'pairs.default' unless supplied as an argument. so try pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", pch = 21, bg = c("red", "green3", "blue")[unclass(iris$Species)], oma = c(8,3,5,3)) On Tue, 28 A

Re: [R] Problem with save or/and if (I think but maybe not ...)

2007-08-27 Thread Prof Brian Ripley
On Mon, 27 Aug 2007, Ptit_Bleu wrote: Hi, I recently discovered the R program and I thought it could be useful to me. I have to analyse data saved as .Px file (x between 0 and 8 - .P0 files have 18 lines at the beginning that I have to skip). New files are generated everyday. relrfichier

Re: [R] R-2.5.1 RedHat EL5 compilation failed

2007-08-26 Thread Prof Brian Ripley
Well, the INSTALL file said The main source of information on installation is the `R Installation and Administration Manual', an HTML copy of which is available as file `doc/html/R-admin.html'. Please read that before installing R. But if you are impatient, read on but please refer t

Re: [R] How to provide argument when opening RGui from an external application

2007-08-26 Thread Prof Brian Ripley
am working under the Windows XP environment. You could try ?Rscript within R, or Rscript --help from the command line (assuming you have R's bin directory on your path. Or read 'An Introduction to R'. Duncan Murdoch Prof Brian Ripley a écrit : Look into Rscript.exe (on Wind

Re: [R] Character position command

2007-08-25 Thread Prof Brian Ripley
On Sat, 25 Aug 2007, Mitchell Hoffman wrote: > This is a very simple question, so I apologize I couldn't find it online: > > I want to shorten the string 'apples.pears' to 'apples'. > > string='apples.pears' > string1=substr(string,0,x) > > For x above, I would like to have a command like charAt(s

Re: [R] How to provide argument when opening RGui from an external application

2007-08-25 Thread Prof Brian Ripley
Look into Rscript.exe (on Windows), which is a flexible way to run scripts. Neither using a GUI nor using source() are recommended. On Fri, 24 Aug 2007, Sébastien wrote: Dear R-users, I have written a small application (in visual basic) that automatically generate some R scripts. I would lik

Re: [R] How can i inhibit this work "Please select a CRAN mirror for use in this session "?

2007-08-25 Thread Prof Brian Ripley
On Sat, 25 Aug 2007, zhijie zhang wrote: > Dear Rusers, > When i start R, there always the following work to do first, how should i > cancel it? > *--- Please select a CRAN mirror for use in this session ---* > I don't know why it does so, maybe i have done something unintentionally. You certai

Re: [R] Error building R 2-5.2.1 on Sun Solaris 8

2007-08-23 Thread Prof Brian Ripley
What is 'R 2-5.2.1'? AFAIK there is no such version. I can tell you the most likely issue: is your Perl is pre 5.6.1 (very old indeed)? The current R-patched (2.5.1 patched) requires Perl 5.6.1, and we do suggest that you install that rather than 2.5.1. (Interestingly, all versions of R since

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Prof Brian Ripley
On Thu, 23 Aug 2007, John Kane wrote: > The FAQ Section 7 is a very useful place for new users > to find out any number of R idiosycracies. However > there is no numbering on the FAQ Table of Content or > on the Sections Tables of Contents. Hmm, doc/FAQ does have a numbered table of contents and

Re: [R] Estimate Intercept in ARIMA model

2007-08-23 Thread Prof Brian Ripley
This is described on the help page! include.mean: Should the ARIMA model include a mean term? The default is 'TRUE' for undifferenced series, 'FALSE' for differenced ones (where a mean would not affect the fit nor predictions). Further, if 'include.mean' is true, this

Re: [R] plotting lda results

2007-08-22 Thread Prof Brian Ripley
Read ?plot.lda, which tells you the ... arguments are (for dimen=1, the only option for two groups) passed to ldahist, so then read its help page. I don't know what you want (and your example is not reproducible): I would expect you to get a single plot with two panels (figures), but there are

Re: [R] How do i print a "main title" on a win.graph with several plots?

2007-08-22 Thread Prof Brian Ripley
?title, look at the 'outer' argument. You can see further discussion of the outer margins in 'An Introduction to R'. I don't know why you are using win.graph(): it is a deprecated form of windows() with many of the arguments taking unchangable defaults. On Wed, 22 Aug 2007, Tom Willems wrote:

Re: [R] open/execute/call/run an external file

2007-08-21 Thread Prof Brian Ripley
On Tue, 21 Aug 2007, STEPHEN M POWERS wrote: > I'm trying to figure out how to trigger a process from within R. I have > an exectuable file that runs a Fortran model, but ideally, would like to > run it from R. Note that I'm not talking about importing the function at > all, passing variables,

Re: [R] R on a flash drive

2007-08-21 Thread Prof Brian Ripley
On Wed, 22 Aug 2007, Williams Scott wrote: > I often run R via a Ceedo virtualisation on a USB drive > (http://www.ceedo.com/) with XP. It costs a few dollars to it this way, > but is a very low stress installation and has worked flawlessly, albeit It is not necessary though, as R does not need '

Re: [R] problems installing updated version of vars package

2007-08-21 Thread Prof Brian Ripley
On Tue, 21 Aug 2007, sj wrote: > All, > > I was looking onlin and noticed that the vars package (by Bernhard Pfaff) > was recently updated (update date listed Aug 6, 2007) The updated packages > has some features that I would find very useful. I have used the update > packages function and vars wa

Re: [R] runing .r file from C#

2007-08-21 Thread Prof Brian Ripley
On Tue, 21 Aug 2007, Alex MD wrote: > Hi, > > I know that the general subject "calling R from C" has been discused but I > have been reading the manuals and also scouting the lists and I can not seam > to find > a working solution for my problem. It's a C# issue. > I want to call a R script ( l

Re: [R] prediction interval for multiple future observations

2007-08-21 Thread Prof Brian Ripley
On Mon, 20 Aug 2007, Vlad Skvortsov wrote: > Hi! > > '?predict.lm' says that the prediction intervals returned by predict() > are for single observation only. Is there a way to specify the desired > number of observations to construct the interval for? What it says in full is The predictio

Re: [R] Prerequisite for running RWeka

2007-08-19 Thread Prof Brian Ripley
On Sun, 19 Aug 2007, [EMAIL PROTECTED] wrote: > Hi - > > I have a question on RWeka. I installed the package and try to run using > some examples available in the package. However, it stalls my machine > for a while. I'm wondering if I need weka (which is java implementation) > installed before

Re: [R] can't find "as.family" function

2007-08-19 Thread Prof Brian Ripley
On Sun, 19 Aug 2007, Mario Alfonso Morales Rivera wrote: Hi R users, I want to use dglm Package. I run the examples and it give me an error: Error en dglm(lot1 ~ log(u), ~1, data = clotting, family = Gamma) : no se pudo encontrar la función "as.family" dglm can't find "as.family" funct

Re: [R] recommended combo of apps for new user?

2007-08-18 Thread Prof Brian Ripley
Some additional comments on the DBMS front. (a) SPSS is not a DBMS, so it is not clear that you need this. But if you do and are storing valuable data in a DBMS a lot of further questions come into play, like how you are going to do backups. I'd say PostgreSQL was really only for professional-

Re: [R] problem using "rank"

2007-08-17 Thread Prof Brian Ripley
On Fri, 17 Aug 2007, Jiong Zhang, PhD wrote: > Hi All, > > I had 12766 elements in a column, 12566 are values and 200 are "NA"s. I > used the following line to get the ranks: > > total_list$MB.rank <- rank(-total_list$MB,ties.method="min",na.last=NA) > > but I got an error message: > > Error in `

Re: [R] installation of the gsl package on Suse 10.1

2007-08-17 Thread Prof Brian Ripley
On Fri, 17 Aug 2007, luca laghi wrote: > I am trying to install the gsl package. > I had gsl installed with YaSt in /usr/lib. > when I launch R as superuser and launch install.packages, it says in > cannot find Gnu Scientific Library. How can I make it find them? Please tell us the exact message

Re: [R] Date format on x-axis

2007-08-17 Thread Prof Brian Ripley
If you want to use English, you need to set your session to be use English. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html We need to know your OS and locale, and you did not follow the guide. On a Unix-alike probably Sys.setlocale("LC_TIME","en_US") or Sys.set

Re: [R] Question about sm.options & sm.survival

2007-08-17 Thread Prof Brian Ripley
On Thu, 16 Aug 2007, Rachel Jia wrote: > Hi, there: > > It's my first time to post question in this forum, so thanks for your > tolerance if my question is too naive. I am using a nonparametric smoothing > procedure in sm package to generate smoothed survival curves for continuous > covariate. I w

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Prof Brian Ripley
On Thu, 16 Aug 2007, Marc Schwartz wrote: > The easiest way might be to modify the lapply() call as follows: > > d[] <- lapply(d, function(x) if (is.factor(x)) factor(sub(" +$", "", x)) else > x) > >> str(d) > 'data.frame': 60 obs. of 3 variables: > $ x: Factor w/ 5 levels "1","2","3","4",..:

Re: [R] Polynomial fitting

2007-08-16 Thread Prof Brian Ripley
It is easier to use poly(raw=TRUE), and better to use poly() with orthogonal polynomials. The original poster shows signs of having read neither the help for predict.lm nor the posting guide, and so almost certainly misused the predict method. On Thu, 16 Aug 2007, Jon Minton wrote: > Remembe

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread Prof Brian Ripley
?toeplitz ?lower.tri since it is the lower triangle of a Toeplitz matrix (or drop the top row) r <- 0.95 R <- toeplitz(r^(0:4)) R[upper.tri(R)] <- 0 R[-1,] On Thu, 16 Aug 2007, [EMAIL PROTECTED] wrote: > Hi, > Sorry if this is a repost. I searched but found no results. > I am wondering if it i

Re: [R] binomial simulation

2007-08-16 Thread Prof Brian Ripley
On Wed, 15 Aug 2007, Moshe Olshansky wrote: > Thank you - I wasn't aware of this function. > One can even use lchoose which allows really huge > arguments (more than 2^1000)! Using dbinom() for binomial probabilities would be even better, and that has a log=TRUE argument to return results on nat

Re: [R] getting lapply() to work for a new class

2007-08-15 Thread Prof Brian Ripley
;list', so is it is 'natural' to call it on a list. And please do NOT edit other people's messages without indication: the R posting guide covers that and it is a copyright violation. > > -P > > -Original Message- Not so: an EDITED version of my message. >

Re: [R] getting lapply() to work for a new class

2007-08-15 Thread Prof Brian Ripley
On Wed, 15 Aug 2007, Pijus Virketis wrote: > I would like to get lapply() to work in the natural way on a class I've > defined. What you have not said is that this is an S4 class. > As far as I can tell, lapply() needs the class to be coercible > to a list. Even after I define as.list() and as.v

Re: [R] Error in building R

2007-08-15 Thread Prof Brian Ripley
On Wed, 15 Aug 2007, Giovanni Petris wrote: > > Hello, > > I am upgrading to the current R 2.5.1 under Sun Solaris 8. Actually, 2.5.1 is not current: '2.5.1 patched' aka R-patched is and this has already been addressed there. > I call the configure script with the --without-readline flag, and

Re: [R] installation of packages

2007-08-14 Thread Prof Brian Ripley
Please see the discussion in the rw-FAQ. On Wed, 15 Aug 2007, [EMAIL PROTECTED] wrote: > Dear All, > > Have just installed v2.5.1 on Windows XP. Works fine but I had quite a few > pakages loaded for 2.5.0 (from contributed) and was wondering how I can > get 2.5.1 to recognise them without having

Re: [R] Mann-Whitney U

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Natalie O'Toole wrote: > Hi, > > Could someone please tell me how to perform a Mann-Whitney U test on a > dataset with 2 groups where one group has more data values than another? > > I have split up my 2 groups into 2 columns in my .txt file i'm using with > R. Here is the cod

Re: [R] weights in GAMs (package mgcv)

2007-08-14 Thread Prof Brian Ripley
Let's simplify to a linear model. If your covariates have uncertainties, most likely a linear regression is not appropriate. This sounds like an 'errors in measurements' model, as covered in @Book{Fuller.87, author = "Fuller, Wayne A.", title= "Measurement Error Models",

Re: [R] Import of Access data via RODBC changes column name ("NO" to "Expr1014") and the content of the column

2007-08-14 Thread Prof Brian Ripley
ng R and restarting it? Sorry, no. You cannot move objects in memory. But why '477Mb' is coming up is still unexplained, and suggests that the machine has a peculiar amount of memory or some flag has been used. Thank you for your help. Kind regards, Maciej -Ursprüngliche

Re: [R] glm(family=binomial) and lmer

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Chris O'Brien wrote: > Dear R users, > > I've notice that there are two ways to conduct a binomial GLM with binomial > counts using R. The first way is outlined by Michael Crawley in his > "Statistical Computing book" (p 520-521): and in the places he got it from (it is not

Re: [R] {grid} plain units with non NULL data arguments

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Wolfram Fischer wrote: > In help(unit) I read: > > The 'data' argument must be a list when the 'unit.length()' > is greater than 1. For example, 'unit(rep(1, 3), c("npc", > "strwidth", "inches"), data=list(NULL, "my string", NULL))'. > > In the newest R-versions i

Re: [R] graph dimensions default

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Simon Pickett wrote: > Yes, > > Thankyou, that does the trick nicely. I thought that kind of thing could > be specified using par() but I guess not. As I said, size is not a property of the plot. And par() applies to the current device, not future ones. > > Thanks again. > >

Re: [R] Linear Regression with slope equals 0

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, [EMAIL PROTECTED] wrote: > > Hi there, am trying to run a linear regression with a slope of 0. > > I have a dataset as follows > > t d > 1 303 > 2 302 > 3 304 > 4 306 > 5 307 > 6 303 > > I would like to test the significance that these points would lie on a > horizontal straig

Re: [R] graph dimensions default

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Simon Pickett wrote: > Hi, > > I would like to (if possible) set the default width and height for graphs > at the start of each session and have each new graphic device overwrite > the previous one. Hmm. It is graphics devices that have dimensions, and plots that overwrite

Re: [R] Import of Access data via RODBC changes column name ("NO" to "Expr1014") and the content of the column

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Maciej Hoffman-Wecker wrote: > > Dear all, > > I have some problems with importing data from an Access data base via > RODBC to R. The data base contains several tables, which all are > imported consecutively. One table has a column with column name "NO". If > I run the code a

Re: [R] cov.unscaled in gls object

2007-08-14 Thread Prof Brian Ripley
This is what the vcov() generic is for. You are asking for internal details from a different class ("summary.lm"). On Tue, 14 Aug 2007, Sven Garbade wrote: > Hi list, > > can I extract the cov.unscaled ("the unscaled covariance matrix") from a > gls fit (package nlme), like with summary.lm? Bac

Re: [R] invert 160000x160000 matrix

2007-08-14 Thread Prof Brian Ripley
On Tue, 14 Aug 2007, Patnaik, Tirthankar wrote: > A variety of tricks would need to be used to invert a matrix of this > size. If there are any other properties of the matrix that you know > (symmetric, positive definite, etc, sparse) then they could be useful > too. You could partition the ma

Re: [R] question regarding is.factor()

2007-08-13 Thread Prof Brian Ripley
typeof() for 'types'. However, "factor" is not a type but a class, so class() is probably what you want. On Mon, 13 Aug 2007, Jabez Wilson wrote: > Dear all, please help with what must be a straightforward question which > I can't answer. But 'An Introduction to R' could. > I add a column o

Re: [R] A clean way to initialize class slot of type "numeric" vector

2007-08-12 Thread Prof Brian Ripley
Well, c() is NULL, so R did as you asked it to. See ?integer: an integer vector of length 0 can be gotten by integer(0) (and other ways). If you want integers, why have a slot which is numeric? > setClass("foo", representation(members="integer")) [1] "foo" > new("foo") An object of class "foo"

Re: [R] Convert factor to numeric vector of labels

2007-08-12 Thread Prof Brian Ripley
See the FAQ Q7.10 (and please study the posting guide) On Sun, 12 Aug 2007, Falk Lieder wrote: Hi, I have imported a data file to R. Unfortunately R has interpreted some numeric variables as factors. Therefore I want to reconvert these to numeric vectors whose values are the factor levels' lab

Re: [R] Connecting to database on statup

2007-08-11 Thread Prof Brian Ripley
On Sat, 11 Aug 2007, Ruddy M wrote: > Hello, > Q/ Is it possible to create a DBMS connection automatically on startup of R? > (Making sure of course that the db server has been started...) > I am running MySQL on Mac OS X 10.4.2 with R2.4.1. > > I have tried to write a function using the RMySQL c

Re: [R] R-excel

2007-08-10 Thread Prof Brian Ripley
On Fri, 10 Aug 2007, Peter Wickham wrote: I am running R 2.5.1 using Mac OSX 10.4.10. "xlsReadWrite" is a Windows binary. Instead, install and load packages: (1) "gtools":(2) "gdata". These are both Windows and Mac binaries. "gdata" depends on "gtools", so be sure to load "gtools" first or set t

Re: [R] kde2d error message

2007-08-10 Thread Prof Brian Ripley
If X or Y contains missing values, _you_ supplied missing values as the 'lims' argument and it will be those missing values that are reported. I do not see how you expect to be able to do density estimation with missing values: they are unknown and so no part of the answer is known. If you are

Re: [R] Cleaning up the memory

2007-08-10 Thread Prof Brian Ripley
On Fri, 10 Aug 2007, Monica Pisica wrote: Thanks! I will look into ... I have 4 GB RAM, and i was monitoring the memory with Windows task manager so i was looking how R "gets" more and more memory allocation from less than 100Mb to 1500Mb . Then you are almost certainly fragmentin

Re: [R] Cleaning up the memory

2007-08-10 Thread Prof Brian Ripley
On Fri, 10 Aug 2007, Monica Pisica wrote: > > Hi, > > I have 4 huge tables on which i want to do a PCA analysis and a kmean > clustering. If i run each table individually i have no problems, but if > i want to run it in a for loop i exceed the memory alocation after the > second table, even if

Re: [R] reading xcms files

2007-08-10 Thread Prof Brian Ripley
On Fri, 10 Aug 2007, Roberto Olivares Hernandez wrote: > Hi, > > I am using xcms library to read mass spectrum data. I generate objects > from CDF files using the command line > >> SME10 <- xcmsRaw("SME_10.CDF") > > I have 50 CDF files with different name and I don't want to repeat the > comman

Re: [R] Memory Experimentation: Rule of Thumb = 10-15 Times the Memory

2007-08-10 Thread Prof Brian Ripley
of the the loaded dataset, I'll just need to document that > it is possible that files as small as 1/40th of system memory may > consume it all. That rules out some important datasets (US Census, UK > Office of National Statistics files, etc) for 2GB servers. > > Regards, Mike

Re: [R] S4 based package giving strange error at install time, but not at check time

2007-08-09 Thread Prof Brian Ripley
On Thu, 9 Aug 2007, Rajarshi Guha wrote: > Hi, I have a S4 based package package that was loading fine on R > 2.5.0 on both OS X and > Linux. I was checking the package against 2.5.1 and doing R CMD check > does not give any warnings. So I next built the package and installed > it. Though the pack

Re: [R] RMySQL loading error

2007-08-09 Thread Prof Brian Ripley
On Thu, 9 Aug 2007, Clara Anton wrote: > Hi, > > I am having problems loading RMySQL. > > I am using MySQL 5.0, R version 2.5.1, and RMySQL with Windows XP. More exact versions would be helpful. > When I try to load rMySQL I get the following error: > > > require(RMySQL) > Loading required pack

Re: [R] Memory Experimentation: Rule of Thumb = 10-15 Times the Memory

2007-08-09 Thread Prof Brian Ripley
On Thu, 9 Aug 2007, Charles C. Berry wrote: > On Thu, 9 Aug 2007, Michael Cassin wrote: > >> I really appreciate the advice and this database solution will be useful to >> me for other problems, but in this case I need to address the specific >> problem of scan and read.* using so much memory. >>

Re: [R] ARIMA fitting

2007-08-09 Thread Prof Brian Ripley
On Tue, 7 Aug 2007, [EMAIL PROTECTED] wrote: Hello, I‘m trying to fit an ARIMA process, using STATS package, arima function. Can I expect, that fitted model with any parameters is stationary, causal and invertible? Please read ?arima: it answers all your questions, and points out that the ans

Re: [R] Help on R performance using aov function

2007-08-09 Thread Prof Brian Ripley
aov() will handle multiple responses and that would be considerably more efficient than running separate fits as you seem to be doing. Your code is nigh unreadable: please use your spacebar and remove the redundant semicolons: `Writing R Extensions' shows you how to tidy up your code to make i

Re: [R] tcltk error on Linux

2007-08-09 Thread Prof Brian Ripley
On Thu, 9 Aug 2007, Mark W Kimpel wrote: > I am having trouble getting tcltk package to load on openSuse 10.2 > running R-devel. I have specifically put my /usr/share/tcl directory in > my PATH, but R doesn't seem to see it. I also have installed tk on my > system. Any ideas on what the problem is

Re: [R] R memory usage

2007-08-09 Thread Prof Brian Ripley
See ?gc ?"Memory-limits" On Wed, 8 Aug 2007, Jun Ding wrote: > Hi All, > > I have two questions in terms of the memory usage in R > (sorry if the questions are naive, I am not familiar > with this at all). > > 1) I am running R in a linux cluster. By reading the R > helps, it seems there are no

Re: [R] Reading time/date string

2007-08-09 Thread Prof Brian Ripley
On Thu, 9 Aug 2007, Matthew Walker wrote: > Thanks Mark, that was very helpful. I'm now so close! > > Can anyone tell me how to extract the "value" from an instance of a > "difftime" class? I can see the value, but how can I place it in a > dataframe? as.numeric(time_delta) Hint: you want

Re: [R] Error: Cannot Coerce POSIXt to POSIXct when building package

2007-08-08 Thread Prof Brian Ripley
On Wed, 8 Aug 2007, Praveen Kanakamedala wrote: > A newbie here - please forgive me if this is a basic question. We have an > in house package built in R 2.2.1 (yes we're a little behind the times at > our firm)and would like to rebuild it using R 2.5.1. However, when I try > and build the packa

Re: [R] Changing font in boxplots

2007-08-08 Thread Prof Brian Ripley
On Wed, 8 Aug 2007, G Iossa, School Biological Sciences wrote: > Hi John, > > Thanks so much for such a quick reply. > I have tried to set all to Times font running > > par(font.lab=6) (not 4, maybe this is a local setting on my machine?) '6' is a setting specific to certain devices on Windows.

Re: [R] Find out the workspace name

2007-08-08 Thread Prof Brian Ripley
On Wed, 8 Aug 2007, ONKELINX, Thierry wrote: > ?getwd() and ?setWindowTitle, which even has this as the first example. help.search("window title") gets you there. >> [mailto:[EMAIL PROTECTED] Namens Luis Ridao Cruz >> >> Sometimes there might be several R sessions open at the same >> time. In

Re: [R] how to include bar values in a barplot?

2007-08-08 Thread Prof Brian Ripley
Please see ?format ?round Note that text() is said to expect a character vector, so why did you supply a numeric vector? labels: a character vector or expression specifying the _text_ to be written. An attempt is made to coerce other language objects (names and calls)

Re: [R] Interaction factor and numeric variable versus separate regressions

2007-08-07 Thread Prof Brian Ripley
These are not the same model. You want x*f, and then you will find the differences in intercepts and slopes from group 1 as the coefficients. Remember too that the combined model pools error variances and the separate model has separate error variance for each group. To understand model formula

Re: [R] cannot add lines to plot

2007-08-07 Thread Prof Brian Ripley
On Tue, 7 Aug 2007, Zeno Adams wrote: > > Hello, > > I want to plot a time series and add lines to the plot later on. > However, this seems to work only as long as I plot the series against > the default index. As soon as I plot against an object > of class chron or POSIXt (i.e. I want to add a da

Re: [R] Y-intercept Value

2007-08-06 Thread Prof Brian Ripley
?offset : you can specify a different intercept for each case, or a common one. Or you could just use lm (y - 3 ~ 0 +x), but offset() works better for prediction. On Mon, 6 Aug 2007, Benjamin Zuckerberg wrote: > > Hello everyone, > > Quick question...is there a way of specifying a y-intercept

Re: [R] data analysis

2007-08-06 Thread Prof Brian Ripley
On Tue, 7 Aug 2007, [EMAIL PROTECTED] wrote: > On 06-Aug-07 19:26:59, lamack lamack wrote: >> Dear all, I have a factorial design where the >> response is an ordered categorical response. >> >> treatment (two levels: 1 and 2) >> time (four levels: 30, 60,90 and 120) >> ordered response (0,1,2,3) >

Re: [R] Function for trim blanks from a string(s)?

2007-08-06 Thread Prof Brian Ripley
I am sure Marc knows that ?sub has examples of trimming trailing space and whitespace in various styles. On Mon, 6 Aug 2007, Marc Schwartz wrote: > On Mon, 2007-08-06 at 12:15 -0700, adiamond wrote: >> I feel like an idiot posting this because every language I've ever seen has a >> string functi

Re: [R] Q: calling par() in .First()

2007-08-06 Thread Prof Brian Ripley
On Mon, 6 Aug 2007, Greg Snow wrote: > Be aware that the effects of calls to par usually only last for the > duration of the graphics device, not the R session. They always apply to the current device only (and will create a current device if possible). > If you put a call to par in your startu

Re: [R] warnings()

2007-08-06 Thread Prof Brian Ripley
Possible routes: 1) Use options(warn=2) and traceback(). 2) Search the *package* sources. This is from package GRASS, I believe. (Not all messages come from packages: they can come from R itself or from compiled code linked into a package.) On Mon, 6 Aug 2007, javier garcia-pintado wrote: >

Re: [R] lda and maximum likelihood

2007-08-06 Thread Prof Brian Ripley
On Mon, 6 Aug 2007, [EMAIL PROTECTED] wrote: > I am trying to compare several methods for classify data into groups. > In that purpose I 'd like to developp model comparison and selection > using AIC. > > In the lda function of the MASS library, the maximum likelihood of the > function is not give

Re: [R] Question regarding QT device

2007-08-05 Thread Prof Brian Ripley
grDevices::deviceIsInteractive is only in the unreleased R-devel version of R: which version are you using? Please do study the R posting guide: we do ask for basic information for a good reason, and do ask for questions on packages (especially unreleased packages) to be sent to the maintainer.

Re: [R] Sorting data for multiple regressions

2007-08-03 Thread Prof Brian Ripley
Well, R has a by() function that does what you want, and its help page contains an example of doing regression by group. (There are other ways.) On Fri, 3 Aug 2007, Paul Young wrote: > So I am trying to perform a robust regression (fastmcd in the robust > package) on a dataset and I want to per

Re: [R] FW: Selecting undefined column of a data frame (was [BioC] read.phenoData vs read.AnnotatedDataFrame)

2007-08-03 Thread Prof Brian Ripley
e result is a single column and so will not have a name: there seems no reason to be different from > foo[["FileName"]] NULL > foo$FileName NULL which similarly select a single column. At one time they were different in R, for no documented reason. On Fri, 3 Aug 2007, Prof

Re: [R] FW: Selecting undefined column of a data frame (was [BioC] read.phenoData vs read.AnnotatedDataFrame)

2007-08-03 Thread Prof Brian Ripley
You are reading the wrong part of the code for your argument list: > foo["FileName"] Error in `[.data.frame`(foo, "FileName") : undefined columns selected [.data.frame is one of the most complex functions in R, and does many different things depending on which arguments are supplied. On Fri,

Re: [R] How to properly finalize external pointers?

2007-08-03 Thread Prof Brian Ripley
On Fri, 3 Aug 2007, Duncan Murdoch wrote: On 8/3/2007 9:19 AM, Jens Oehlschlägel wrote: Dear R .Call() insiders, Can someone enlighten me how to properly finalize external pointers in C code (R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the finalizer set in R_RegisterCFi

Re: [R] plot to postscript orientation

2007-08-03 Thread Prof Brian Ripley
Do you have the Orientation menu set to 'Auto'? The effect described seems that if 'Rotate media' is selected, which it should not be. The files look fine to me in GSView 4.8 on Windows and other viewers on Linux. I agree with Uwe that it is a viewer issue (most reported postscript/PDF are).

  1   2   3   4   5   6   7   8   9   10   >