Re: [R] How to personalize the rpart function: t.default(x)

2004-09-01 Thread Prof Brian Ripley
On Thu, 2 Sep 2004, Simone Vantini wrote: > I'm trying to personalize the rpart function by introducing a > list('init','split','eval') in the argument method. But I receive an error > message:"Error in t.default(x): argument is not a matrix". > Can anyone tell me what the argument of this functio

[R] xtable Questions

2004-09-01 Thread Kevin Wang
Hi, These are two problems I've never seen when I used xtable() before... R 1.9.1 for Windows XP, xtable version 1.2-3: > final.df Loci ChrMarker Position P.values Deviance DF 1 Idd5 1 D1Mit181 42.6 0.0011 103.21 78 2 Idd6/19/20 6 D6Mit374 66.

RE: [R] Re: [S] [R/S] question re solution

2004-09-01 Thread Manoj - Hachibushu Capital
> Someone else mentioned Venables and Ripley (2000) S > Programming (Springer). Please see this or some other discussion of the > "..." argument. The "Introduction to R" (from Cran website) also talks about it. See pg 49 - section 10.4 (was just reading this the other day). Cheers Manoj ---

Re: [R] using hist() with tapply()

2004-09-01 Thread Kjetil Brinchmann Halvorsen
Schwarz,Paul wrote: Hi, I've been passing the hist() function to tapply() to quickly generate histograms based on the list of factors supplied to tapply(). However, I have not figured out how to generate titles for each of the histograms, which paste in the unique values of the list factors as

[R] Re: [S] [R/S] question re solution

2004-09-01 Thread Spencer Graves
Erin Hodgess wrote: Dear R and S People: First, thank you to so many people for your help to my problem. Here is the solution: a <- 0.5*(outer(1:n3,1:n3,function(x,y,n2.){n2. - pmax(x,y)},n2.=n2)) I have one final pesky question, please: During my experiments, I tried the following: a <- 0.5*(oute

[R] [R/S] question re solution

2004-09-01 Thread Erin Hodgess
Dear R and S People: First, thank you to so many people for your help to my problem. Here is the solution: a <- 0.5*(outer(1:n3,1:n3,function(x,y,n2.){n2. - pmax(x,y)},n2.=n2)) I have one final pesky question, please: During my experiments, I tried the following: a <- 0.5*(outer(1:n3,1:n3,func

Re: [R] allocating memory in C, not in R

2004-09-01 Thread Sundar Dorai-Raj
Sigal Blay wrote: Thank you for the fast reply. Below is a simplified version of my c function that I am currenctly using with a .C() call. The values that has to be returned to R are the three outVectors. If I need to convert .C to .Call, How do I do it based on myFunction below? Thank you for

RE: [R] How to personalize the rpart function: t.default(x)

2004-09-01 Thread Liaw, Andy
On top of what Rolf had said, traceback() would help tracking down how the error happened. Andy > From: Rolf Turner > > t is for transpose; look at ?t, ?t.default, > ?t.data.frame > > Bottom line: Somewhere in your code you are trying to transpose > something that is not a matrix. (Or you are

Re: [R] allocating memory in C, not in R

2004-09-01 Thread Sigal Blay
Thank you for the fast reply. Below is a simplified version of my c function that I am currenctly using with a .C() call. The values that has to be returned to R are the three outVectors. If I need to convert .C to .Call, How do I do it based on myFunction below? Thank you for your help. void

Re: [R] How to personalize the rpart function: t.default(x)

2004-09-01 Thread Rolf Turner
t is for transpose; look at ?t, ?t.default, ?t.data.frame Bottom line: Somewhere in your code you are trying to transpose something that is not a matrix. (Or you are passing to an existing function an object which that function expects to be a matrix, but isn't.) cheers

[R] How to personalize the rpart function: t.default(x)

2004-09-01 Thread Simone Vantini
I'm trying to personalize the rpart function by introducing a list('init','split','eval') in the argument method. But I receive an error message:"Error in t.default(x): argument is not a matrix". Can anyone tell me what the argument of this function is or where this function appears in the rpart fu

Re: [R] [R/S] strange

2004-09-01 Thread Peter Dalgaard
Erin Hodgess <[EMAIL PROTECTED]> writes: > Dear R and S People: > > I have run across something very strange. Here is a function that I wrote > for R: > > boot1 <- function(y,method="f",p=1) { > n1 <- length(y) > n2 <- n1*p > n3 <- n2 - 1 > a <- 0.5*(outer(1:n3,1:n3,function(x,y){n2 - p

Re: [R] allocating memory in C, not in R

2004-09-01 Thread Prof Brian Ripley
On Wed, 1 Sep 2004, S. Blay wrote: > I need to retrieve several vectors of various types from a call > to .C(), but I don't know their length in advance. > Is there a way to do this without allocating an excessive amount > of memory? > If so, an example would be very helpful. It would be very

Re: [R] allocating memory in C, not in R

2004-09-01 Thread Sundar Dorai-Raj
S. Blay wrote: Dear R helpers, I need to retrieve several vectors of various types from a call to .C(), but I don't know their length in advance. Is there a way to do this without allocating an excessive amount of memory? If so, an example would be very helpful. You should probably use the .

[R] allocating memory in C, not in R

2004-09-01 Thread S. Blay
Dear R helpers, I need to retrieve several vectors of various types from a call to .C(), but I don't know their length in advance. Is there a way to do this without allocating an excessive amount of memory? If so, an example would be very helpful. S. Blay Department of Statistics and Actuari

RE: [R] using hist() with tapply()

2004-09-01 Thread Kevin Bartz
Hi Paul, I think lattice's histogram will do what you want, and in a friendlier manner. Take a look at this example: require(lattice) a <- data.frame(draw = as.vector(mapply(rnorm, rep(100, 4), rep(0, 4), 1:4)), sd = factor(paste("sd =", rep(1:4, each = 100 Go ahead and exa

[R] Re: [S] [R/S] strange solution

2004-09-01 Thread Spencer Graves
Hi, Erin: A cleaner way is to pass "n2" to "outer" as a "..." argument, as in the following modification of your code: boot1 <- function(y,method="f",p=1) { n1 <- length(y) n2 <- n1*p n3 <- n2 - 1 a <- 0.5*(outer(1:n3,1:n3,function(x,y, n2.){n2. - pmax(x,y)}, n2.=n2)) return(a) } y1 <- c(

[R] [R/S] strange solution

2004-09-01 Thread Erin Hodgess
Dear R and S People: I ended up using the "assign" command, and things work in S+. boot1 <- function(y,method="f",p=1) { n1 <- length(y) #n2 <- n1*p assign("n2",n1*p) n3 <- n2 - 1 a <- 0.5*(outer(1:n3,1:n3,function(x,y){n2 - pmax(x,y)})) return(a) } thanks for listening! Sincerely, Erin H mail

RE: [R] Rcmdr X11 protocol error message

2004-09-01 Thread John Fox
Dear Michael and Peter, I've made the following changes to the current development version of the Rcmdr package (on my web site, at http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/index.html, but not posted to CRAN): (1) The default for the Rcmdr grab.focus option is now set to FALSE for non-Wi

[R] [R/S] strange

2004-09-01 Thread Erin Hodgess
Dear R and S People: I have run across something very strange. Here is a function that I wrote for R: boot1 <- function(y,method="f",p=1) { n1 <- length(y) n2 <- n1*p n3 <- n2 - 1 a <- 0.5*(outer(1:n3,1:n3,function(x,y){n2 - pmax(x,y)})) return(a) } and here is the R output: > y1 [1] 9 8 7 3 6

[R] using hist() with tapply()

2004-09-01 Thread Schwarz,Paul
Hi, I've been passing the hist() function to tapply() to quickly generate histograms based on the list of factors supplied to tapply(). However, I have not figured out how to generate titles for each of the histograms, which paste in the unique values of the list factors as part of the histogr

Re: [R] D'agostino test

2004-09-01 Thread Diethelm Wuertz
Ludwig Baringhaus wrote: Several versions of the D'Agostino Test are implemented in "fBasics" from Rmetrics beside many other tests for normality Unlike the Shapiro-Wilk or the Anderson-Darling test, the D'Agostino test is not an omnibus test for testing the hypothesis of normality. In fact,

Re: [R] coercing a string naming to a variable name and return value

2004-09-01 Thread Adaikalavan Ramasamy
I am not sure if I understand your problem but I think you might be close to the solution. Perhaps if you changed 'index' in your code to 'i', you might get the answer. Try this : set.seed(1066) m <- matrix(rnorm(9), nc=3) colnames(m) <- paste("ratio", 1:3, sep="") m ratio1 ratio2

Re: [R] Accesing the name of an assigned object in a function

2004-09-01 Thread Gabor Grothendieck
Arne Henningsen email.uni-kiel.de> writes: > > Hi Hendrik, > > if I understand you right, match.call() can help you. > > All the best, > Arne > > On Wednesday 01 September 2004 12:13, Henrik Andersson wrote: > > I want to use the name that I assign to an object in the function that > > produc

Re: [R] coercing a string naming to a variable name and return value

2004-09-01 Thread Sundar Dorai-Raj
Dewez Thomas wrote: Hi all, I haven't been able to find how to assess a variable who's name is constructed with paste. The problem is following: In a data frame, there are 12 columns whose title vary only by a digit, all other part being equal. I would like to compute a operation on a subset these

Re: [R] coercing a string naming to a variable name and return value

2004-09-01 Thread Roger D. Peng
You can use "[[", I think, as in basin.param[[string.variable]] or, eqivalently for a data frame basin.param[, string.variable] -roger Dewez Thomas wrote: Hi all, I haven't been able to find how to assess a variable who's name is constructed with paste. The problem is following: In a data frame, th

RE: [R] Membership

2004-09-01 Thread Liaw, Andy
http://cran.r-project.org/src/contrib/cluster_1.9.6.tar.gz Andy > From: Kannnan > > Dear sir, > > I like to change the objective function in > > fanny function(fuzzy clustering) and I like to modify the membership > function in constructing membership grade to objects to the class. > > > S

[R] coercing a string naming to a variable name and return value

2004-09-01 Thread Dewez Thomas
Hi all, I haven't been able to find how to assess a variable who's name is constructed with paste. The problem is following: In a data frame, there are 12 columns whose title vary only by a digit, all other part being equal. I would like to compute a operation on a subset these variables and parse

Re: [R] While installing Hmisc...

2004-09-01 Thread Jan Goebel
I guess that the perl script during the installation of Hmisc has used all of your available memory. I had the same problem with my laptop (288MB RAM), using the console without an X-Server and/or adding some temporary Swap space could help. Best jan On Mon, 30 Aug 2004, data Analytics wrote:

Re: [R] Tick marks in cloud (lattice)

2004-09-01 Thread Deepayan Sarkar
Pär Matsson wrote: Hi! Probably a simple question, but I can't get any tick marks in the 3d scatterplot I created using the cloud function. The following works to display the three groups using different symbols: data(iris) cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = 1.2,

Re: [R] Unique lists from a list

2004-09-01 Thread Adaikalavan Ramasamy
name <- c("a", "b", "a", "c", "d", "a", "b") addr <- c(10, 20, 10, 30, 40, 10, 20) duplicated(name) [1] FALSE FALSE TRUE FALSE FALSE TRUE TRUE which(duplicated(name)) [1] 3 6 7 addr[ -which(duplicated(name)) ] [1] 10 20 30 40 cbind( name, addr) [ -which(duplicated(name)), ] name addr [

Re: [R] lme: howto specify covariance structure between levels of grouping factors

2004-09-01 Thread Spencer Graves
1. Have you followed "the posting guide! http://www.R-project.org/posting-guide.html";? In many cases, it might help you answer your own questions. If not, it might help you formulate a question in a way that might generate more useful replies. 2. Have you studied Pinhiero and B

Re: [R] Unique lists from a list

2004-09-01 Thread james . holtman
Try this: l.1 <- list(list(name='a', addr='123'),list(name='b', addr='234'), list(name='b', addr='234'), list(name='a', addr='123')) # create a list l.names <- unlist(lapply(l.1, '[[', 'name')) # get the 'name' l.u <- unique(l.names) # make unique new.list <- l.1[match(l.u, l.names

Re: [R] Unique lists from a list

2004-09-01 Thread Prof Brian Ripley
On Wed, 1 Sep 2004, michael watson (IAH-C) wrote: > I have a list. Two of the elements of this list are "Name" and > "Address", both of which are character vectors. Name and Address are > linked, so that the same "Name" always associates with the same > "Address". > > What I want to do is pull

[R] Tick marks in cloud (lattice)

2004-09-01 Thread Pär Matsson
Hi! Probably a simple question, but I can't get any tick marks in the 3d scatterplot I created using the cloud function. The following works to display the three groups using different symbols: data(iris) cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris, cex = 1.2, groups = Species,

[R] Unique lists from a list

2004-09-01 Thread michael watson (IAH-C)
Hi I have a list. Two of the elements of this list are "Name" and "Address", both of which are character vectors. Name and Address are linked, so that the same "Name" always associates with the same "Address". What I want to do is pull out the unique values, as a new list of the same format (ie

Re: [R] Accesing the name of an assigned object in a function

2004-09-01 Thread Thomas Lumley
On Wed, 1 Sep 2004, Eryk Wolski wrote: > ?assign No, this is not going to work. If Henrik has described his wish correctly, he wants to execute the call assigned.name <- stupid.function(whatever) and be able, inside stupid.function, to find out what name the result is going to be assigned to.

[R] Membership

2004-09-01 Thread Kannnan
Dear sir, I like to change the objective function in fanny function(fuzzy clustering) and I like to modify the membership function in constructing membership grade to objects to the class. So I kindly request to provide the source code of this fanny function, it will be very helpful to continu

RE: [R] Rcmdr X11 protocol error message

2004-09-01 Thread John Fox
Dear Michael, I can confirm Michael's observations: no problems until after a graphics device window is opened. Then increasing numbers of warnings each time commands are executed from within the Rcmdr. This happens whether the commands are executed from dialog boxes or from the (upper) script win

[R] Dependant proportions and sample size

2004-09-01 Thread Bock, Michael
I need to do a sample size calculation to determine the number of audits required. The results of an audit will be: 1) OK 2) Minor variances 3) Multiple variances 4) Severe variances We want to know the sample size required to determine the proportions in each category within say 5% with a confid

[R] Recall: Multiple dependant proportions and sample size

2004-09-01 Thread Bock, Michael
Bock, Michael would like to recall the message, "Multiple dependant proportions and sample size". [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

[R] SIMPER-similarity percentage

2004-09-01 Thread Marta Rufino
Hello, Does anyone know if the SIMPER analysis is implemented in R? It is a multivariate analysis that shows the contribution of a each variable in a group, and the variables responsible for the difference between groups. It is implemented in the statistical package PRIMER and is frequently used

[R] Multiple dependant proportions and sample size

2004-09-01 Thread Bock, Michael
I need to do a sample size calculation to determine the number of audits required. The results of an audit will be: 1) OK 2) Minor variances 3) Multiple variances 4) Severe variances We want to know the sample size required to determine the proportions in each category within say 5% with a confid

Re: [R] changing default labels of axis in ts plots

2004-09-01 Thread Prof Brian Ripley
On Wed, 1 Sep 2004, javier garcia - CEBAS wrote: > Hi; > I'm in Spain and my locale and tz are the spanish one, and I'm using plot() > with irregular time series. And I would like to change the default labels in > x and y axis: > > 1) The labels of months in the x axis of the plots appear in Sp

[R] changing default labels of axis in ts plots

2004-09-01 Thread javier garcia - CEBAS
Hi; I'm in Spain and my locale and tz are the spanish one, and I'm using plot() with irregular time series. And I would like to change the default labels in x and y axis: 1) The labels of months in the x axis of the plots appear in Spanish - c("Enero,"Febrero",...) - and I would like them to a

Re: AW: [R] Looking for help in calculating percentiles

2004-09-01 Thread Uwe Ligges
Harmony Tenney wrote: How do I calculate the 95th percentile when I know the 25th, the median and the 75th?? He? You cannot, or do you have some concrete knowledge about the distribution? Then you might be able to parameterize the distribution (if not too many parameters have to be estimated) by

Re: AW: [R] Looking for help in calculating percentiles

2004-09-01 Thread Harmony Tenney
How do I calculate the 95th percentile when I know the 25th, the median and the 75th?? Thanks, Harmony Tenney [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

Re: [R] Imputing missing values

2004-09-01 Thread Frank E Harrell Jr
Dimitris Rizopoulos wrote: Hi Jan, you could try the following: dat <- data.frame(Price=c(10,12,NA,8,7,9,NA,9,NA), Crop=c(rep("Rise", 5), rep("Wheat", 4)), Season=c(rep("Summer", 3), rep("Winter", 4), rep("Summer", 2))) ## dat <- dat[order(dat$Season, dat$Cro

Re: [R] RODBC query on one line

2004-09-01 Thread Mikkel Grum
Thanks Brian and Sean, Works well and solves another problem I had: changing the same condition in a series of related but different queries, by making only one change in a variable that is then used in all the queries. Mikkel --- Sean Davis <[EMAIL PROTECTED]> wrote: > I often use paste to bui

Re: [R] degrees of freedom (lme4 and nlme)

2004-09-01 Thread Douglas Bates
Alexandre Galvão Patriota wrote: Hi, I'm having some problems regarding the packages lme4 and nlme, more specifically in the denominator degrees of freedom. I used data Orthodont for the two packages. The commands used are below. require(nlme) data(Orthodont) fm1<-lme(distance~age+ Sex, data=Orthod

Re: [R] Accesing the name of an assigned object in a function

2004-09-01 Thread Eryk Wolski
?assign /E On Wed, 1 Sep 2004, Henrik Andersson wrote: > I want to use the name that I assign to an object in the function that > produces the output, somewhat like below: > > stupid.function <- function(input){ > [body] > cat("Summarized output is ", output$summary, "Full output is

Re: [R] Advice on good programming practice, lexical scope

2004-09-01 Thread Gabor Grothendieck
Gabor Grothendieck myway.com> writes: : : Sixten Borg ihe.se> writes: : : : : : In "An Introduction to R" (See R help menu), there is an example of a : function 'open.account' that makes use : : of the lexical scope in R. : : : : I have a set of functions that can be used to output R tables

Re: [R] Rcmdr X11 protocol error message

2004-09-01 Thread Michael Bibo
John Fox wrote: Dear Peter and Michael, I installed Quantian on a spare machine that I have and observed the same warning messages that Michael has been reporting. These (and the problem with help files but not with viewing data sets that Peter reported) occurred with version 0.9-11 of Rcmdr but n

Re: [R] Accesing the name of an assigned object in a function

2004-09-01 Thread Arne Henningsen
Hi Hendrik, if I understand you right, match.call() can help you. All the best, Arne On Wednesday 01 September 2004 12:13, Henrik Andersson wrote: > I want to use the name that I assign to an object in the function that > produces the output, somewhat like below: > > stupid.function <- function(

Re: [R] blockwise sums

2004-09-01 Thread Vicente Canto Casasola
Hi, all!! From the help page for 'aggregate': Splits the data into subsets, computes summary statistics for each, and returns the result in a convenient form. So here's the solution I found to this problem: blocksums <- function(x,n) { temp <- 1:length(x)-1 temp <- list((temp%/%n)+1) aggreg

Re: [R] Advice on good programming practice, lexical scope

2004-09-01 Thread Gabor Grothendieck
Sixten Borg ihe.se> writes: : : In "An Introduction to R" (See R help menu), there is an example of a function 'open.account' that makes use : of the lexical scope in R. : : I have a set of functions that can be used to output R tables and graphics into a single report document. (I am : aware

[R] not positive definite D matrix in quadprog

2004-09-01 Thread Molins, Jordi
Hello to everybody, I have a quadratic programming problem that I am trying to solve by various methods. One of them is to use the quadprog package in R. When I check positive definiteness of the D matrix, I get that one of the eigenvalues is negative of order 10^(-8). All the others are positiv

Re: [R] obtaining exact p-values in mixed effects model

2004-09-01 Thread Yves Magliulo
hi, > Is there a way we can obtain > the exact p-values from lme without rounding? use summary instead. > used commands: > > library(nlme) > g<-lme(value~factor(fac1)+factor(fac2)+factor(fac1):factor(fac2),data=mydataframe,random=~1|factor(fac3)) > ag<-anova(g) summary(g)$tTable[,5] will pr

[R] lme: howto specify covariance structure between levels of grouping factors

2004-09-01 Thread Patrick Van Cleemputte
Dear all, I am studying the possibility of using the nlme package in R to analyse field trials of agricultural crops. I have a problem with the syntax for the modelling of variance covariance structures. I can model the within-group covariance structure using the correlation argument and the cov

Re: [R] D'agostino test

2004-09-01 Thread Ludwig Baringhaus
> Several versions of the D'Agostino Test are implemented in > "fBasics" from Rmetrics beside many other tests for normality. Unlike the Shapiro-Wilk or the Anderson-Darling test, the D'Agostino test is not an omnibus test for testing the hypothesis of normality. In fact, D'Agostino's D is a suit

[R] Optim in R

2004-09-01 Thread Z P
Dear all, I recently use the optim function to find the maxima for some likelihood function. I have many parameters, more than 12. As the help file mention, the default method does not do well in univariate case. How about the different method in optim? I notice the nlm function uses newton met

[R] Accesing the name of an assigned object in a function

2004-09-01 Thread Henrik Andersson
I want to use the name that I assign to an object in the function that produces the output, somewhat like below: stupid.function <- function(input){ [body] cat("Summarized output is ", output$summary, "Full output is given by typing", assigned.name, "\n") } assigned.name <- stupid.functio

Re: [R] sample size for t-tests

2004-09-01 Thread Peter Dalgaard
Adaikalavan Ramasamy <[EMAIL PROTECTED]> writes: > Look into the code of power.t.test in the stats package. For example, > the sample size for two-sample t-test, two-tail testing and strict > interpretation of tail probability can be found by solving the following > equation iteratively : > > \be

Re: [R] RODBC query on one line

2004-09-01 Thread Sean Davis
I often use paste to build up SQL queries into line-sized chunks, but this is only a convenience and not required. It does improve readability and maintainability, in my opinion. Sean On Sep 1, 2004, at 5:09 AM, Mikkel Grum wrote: Dear R-helpers, When I use sqlQuery in the package RODBC, I cann

Re: [R] RODBC query on one line

2004-09-01 Thread Prof Brian Ripley
Not true: you have to submit the query as one element of a character vector, not the same thing at all. You *can* use paste() to assemble it. On Wed, 1 Sep 2004, Mikkel Grum wrote: > Dear R-helpers, > > When I use sqlQuery in the package RODBC, I cannot > break the line, but have to write the e

Re: [R] Imputing missing values

2004-09-01 Thread Mahbub Latif
Try this: newPrice = unlist(sapply(Price, Crop:Season, function(x){ x[is.na(x)]=mean(x,na.rm=T); return(x); })) --- Jan Smit <[EMAIL PROTECTED]> wrote: > Dear all, > > Apologies for this beginner's question. I have a > variable Price, which is associated with factors > Season a

Re: [R] sample size for t-tests

2004-09-01 Thread Adaikalavan Ramasamy
Look into the code of power.t.test in the stats package. For example, the sample size for two-sample t-test, two-tail testing and strict interpretation of tail probability can be found by solving the following equation iteratively : \begin{equation} 1 - \beta = \Pr ( t_{v,ncp}^{*} < t_{v, \alp

Re: [R] Imputing missing values

2004-09-01 Thread Dimitris Rizopoulos
Hi Jan, you could try the following: dat <- data.frame(Price=c(10,12,NA,8,7,9,NA,9,NA), Crop=c(rep("Rise", 5), rep("Wheat", 4)), Season=c(rep("Summer", 3), rep("Winter", 4), rep("Summer", 2))) ## dat <- dat[order(dat$Season, dat$Crop),] dat$Price.imp <- unl

[R] obtaining exact p-values in mixed effects model

2004-09-01 Thread Rudi Alberts
Hello, Using a fixed effects linear model (with lm), I can get exact p-values out of the AVOVA table, even if they are very small, eg. 1.0e-200. Using lme (linear mixed effects) from the nlme library, it appears that there is rounding of the p-values to zero, if the p-value is less than about 1.0

[R] RODBC query on one line

2004-09-01 Thread Mikkel Grum
Dear R-helpers, When I use sqlQuery in the package RODBC, I cannot break the line, but have to write the entire SQL Query on the same line. Is this expected behaviour? It is definitely workable, but makes the queries a slightly difficult to read and edit. I'm using R 1.9.1 and RODBC 1.0-4 on Win

RE: [R] Imputing missing values

2004-09-01 Thread Manoj - Hachibushu Capital
How about the following code below? Price[is.na(price)] = mean(Price[-which(is.na(price))]); HTH Manoj -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jan Smit Sent: Wednesday, September 01, 2004 5:44 PM To: [EMAIL PROTECTED] Subject: [R] Imputing miss

[R] Imputing missing values

2004-09-01 Thread Jan Smit
Dear all, Apologies for this beginner's question. I have a variable Price, which is associated with factors Season and Crop, each of which have several levels. The Price variable contains missing values (NA), which I want to substitute by the mean of the remaining (non-NA) Price values of the sam

Re: [R] Sparse Matrices in R

2004-09-01 Thread Bjørn-Helge Mevik
"Wolski" <[EMAIL PROTECTED]> writes: > Hi! > help.search("sparse matrix") > > > graph2SparseM(graph)Coercion methods between graphs and sparse > matrices > tripletMatrix-class(Matrix) > Class "tripletMatrix" sparse matrices in >

Re: [R] Accessing aov p-value

2004-09-01 Thread Prof Brian Ripley
On Wed, 1 Sep 2004, michael watson (IAH-C) wrote: > I have a data.frame, and want to perform an analysis of variance on each > row. Really? On one row? Makes no sense to me! > I am currently using aov() and summary(), but what I want to do is > perform an analysis of variance on each row and

[R] Advice on good programming practice, lexical scope

2004-09-01 Thread Sixten Borg
In "An Introduction to R" (See R help menu), there is an example of a function 'open.account' that makes use of the lexical scope in R. I have a set of functions that can be used to output R tables and graphics into a single report document. (I am aware that several tools can do this already).

[R] Accessing aov p-value

2004-09-01 Thread michael watson (IAH-C)
Hi I have a data.frame, and want to perform an analysis of variance on each row. I am currently using aov() and summary(), but what I want to do is perform an analysis of variance on each row and then append the F statistic and the p-value to the end of the row, so I can then use these to filter

[R] About Factor Analysis

2004-09-01 Thread E D. Isaia
Hello, I' doing some simulation on (confirmatory) factor analysis on a covariance matrix and I resort to factanal() function, which works fine but it performs only the maximum-likelihood method of extracting factors. I wonder if (and where) I can find a package that performs the principal axis f

Re: [R] error in mle -- user error reported by optim

2004-09-01 Thread Prof Brian Ripley
The error is rather in _your_ log-likelihood: you are going to have to try much harder to avoid underflow/overflow. Avoiding log(exp(a1*x1+a2*x2)) would be a start. You might begin to appreciate why R's d*** and p*** functions have a `log.p' argument. Better starting values would help, probably

Re: [R] D'agostino test

2004-09-01 Thread Diethelm Wuertz
Several versions of the D'Agostino Test are implemented in "fBasics" from Rmetrics beside many other tests for normality. Diethelm Wuertz www.Rmetrics.org Alexandre Bournery wrote: Hi, Does anyone know if the D'agostino test is available with R ? Alex __