Re: [R] a newbie question about "data"

2007-11-07 Thread Prof Brian Ripley
A lot of those changes are of course in the on-line Errata at http://www.stats.ox.ac.uk/pub/MASS4/Errata4.1 . E.g. R Changes = p.12 As from R 1.7.0 data() is not needed for our datasets, but it is needed for R's own datasets ability.cov, iris3 and swiss prior to R 2.0.0.

Re: [R] a newbie question about "data"

2007-11-07 Thread envisage
thanks for the detailed info. and sorry for the anonymously posting(may be subscripted with another email account, i can't specify which one is, now i subscript r-help mail list with this mail account). On Nov 8, 2007 12:48 PM, <[EMAIL PROTECTED]> wrote: > The book came out in 2002 and a lot has h

[R] analysis of 2x2 tables of various designs

2007-11-07 Thread Max Moldovan
Dear Colleagues, Could you recommend a package of combination of functions in R for analysis of 2x2 tables of various designs. Preferably it should include tests and confidence limits (both exact and approximate) for alternative designs, such as independent proportions (e.g. parallel group clin

Re: [R] a newbie question about "data"

2007-11-07 Thread Bill.Venables
The book came out in 2002 and a lot has happened with R in the time since then. In particular it is now possible for R to have 'lazy loading' of objects. If the person setting up the package has used this option (as they all now should), when the package is loaded R essentially is made aware t

Re: [R] a newbie question about "data"

2007-11-07 Thread envisage
Rolf, thanks for the reply, i see now. On Nov 8, 2007 11:43 AM, Rolf Turner <[EMAIL PROTECTED]> wrote: > > > On 8/11/2007, at 4:26 PM, envisage wrote: > > > hi, I am reading Modern Applied Statistics with S 4th ed。 > > page4 have these two lines: > >> library(MASS) > >> data(chem) # needed in R on

Re: [R] creating a dynamic output vector

2007-11-07 Thread Ben Bolker
Steve Powers wrote: > > Not exactly. That doesn't work for me. Because I don't actually know > what variables are created each time I run the program, I don't have an > easy way to call all the ones I need at once (which your suggestion > appears to require). But I do have a list of names fo

Re: [R] a newbie question about "data"

2007-11-07 Thread Rolf Turner
On 8/11/2007, at 4:26 PM, envisage wrote: > hi, I am reading Modern Applied Statistics with S 4th ed。 > page4 have these two lines: >> library(MASS) >> data(chem) # needed in R only > but I find withou the line " data(chem)" > I can still access chem, isn't it? > is it unnecessary or something i

Re: [R] creating a dynamic output vector

2007-11-07 Thread Rolf Turner
On 8/11/2007, at 3:00 PM, Steve Powers wrote: > Everyone is assuming I know what the output data are, or that they > come > out from my model in some easily called vector. But I don't, and > they do > not. The outputs are hidden, and all are separate variables that > need to > be called. Al

[R] a newbie question about "data"

2007-11-07 Thread envisage
hi, I am reading Modern Applied Statistics with S 4th ed。 page4 have these two lines: > library(MASS) > data(chem) # needed in R only but I find withou the line " data(chem)" I can still access chem, isn't it? is it unnecessary or something i missed here? thanks for the replay in advance. ___

Re: [R] creating a dynamic output vector

2007-11-07 Thread jim holtman
Here is a script that will find all the atomic objects of length 1 and put them in a dataframe that you then use to determine what variables are there. > a <- 1 # generate some atomic objects > b <- 1.3 > x.char <- "character string" > x.log <- TRUE > x.real <- pi > # get all atomic objects of l

Re: [R] Adding submenus to existing consol GUI menu

2007-11-07 Thread Gabor Grothendieck
You could try deleting all the existing menus and then recreating them in the way you want. I believe that once worked although I haven't tried it recently. On Nov 7, 2007 4:14 PM, simon gatehouse <[EMAIL PROTECTED]> wrote: > If possible I would like to add two sub-menus to the R Console under >

Re: [R] creating a dynamic output vector

2007-11-07 Thread Steve Powers
Everyone is assuming I know what the output data are, or that they come out from my model in some easily called vector. But I don't, and they do not. The outputs are hidden, and all are separate variables that need to be called. Also which ones come out after a given run will vary each time. Al

Re: [R] Aggregate with non-scalar function

2007-11-07 Thread Mike Nielsen
Yes, that's exactly it! Many thanks, it all comes back to me now! It's the darn do.call that I can never remember somehow. I know I've reinvented this wheel several times -- you'd think I'd learn. Sigh. Again, my thanks! Regards, Mike On Nov 7, 2007 2:35 PM, jim holtman <[EMAIL PROTECTED]>

Re: [R] creating a dynamic output vector

2007-11-07 Thread jim holtman
Here is a function that might do what you want: > # function to create the output > f.output <- function(dat){ + # create the base output vector + output.base <- rep(NA,10) + names(output.base) <- paste("var", 1:10, sep='') + output.base[names(dat)] <- dat + output.base + } > >

Re: [R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Julian Burgos
Do this: pfit$coefficients[is.na(pfit$coefficients)]=0 Julian Ptit_Bleu wrote: > Hello, > > I'm trying to fit some points with a 8-degrees polynom (result of lm is > stored in pfit). > In most of the case, it is ok but for some others, some coefficients are > "NA". > I don't really understand t

Re: [R] Mixing lty specifications in legend

2007-11-07 Thread Duncan Murdoch
On 07/11/2007 7:01 PM, Peter Dunn wrote: > Hi all > > I have a plot with lines, one specified as (say) lty=1, > using standard line types, and another as (say) my > own spec: lty="51". > > I can't get legend to display both. Toy example: > > >> plot(1~1) >> legend("topright", lty=c("51",1),

[R] Mixing lty specifications in legend

2007-11-07 Thread Peter Dunn
Hi all I have a plot with lines, one specified as (say) lty=1, using standard line types, and another as (say) my own spec: lty="51". I can't get legend to display both. Toy example: > plot(1~1) > legend("topright", lty=c("51",1), legend=c("My own","Standard")) Error in segments(x1, y1, x2,

Re: [R] creating a dynamic output vector

2007-11-07 Thread Bert Gunter
?match I think is what you're after. e.g. x <- letters[1:10] y <- c("b","f") x[match(x,y)] Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Alspach Sent: Wednesday, November 07, 2007 2:41 PM To: St

Re: [R] Homework help: t test hypothesis testing with summarized data?

2007-11-07 Thread Peter Dalgaard
Zembower, Kevin wrote: > Is this how a t hypothesis test is done when I don't have the actual > data, but just the summarized statistics: > >> #Homework 9.2.6 [1] >> n<-31 >> xbar<-3.10 >> s_x<-1.469 >> m<-57 >> ybar<-2.43 >> s_y<-1.35 >> s_pooled<- (((n-1)*s_x^2) + ((m-1)*s_y^2)) / (n + m - 2)

Re: [R] creating a dynamic output vector

2007-11-07 Thread Steve Powers
Not exactly. That doesn't work for me. Because I don't actually know what variables are created each time I run the program, I don't have an easy way to call all the ones I need at once (which your suggestion appears to require). But I do have a list of names for all the variables I want. We ne

Re: [R] R as a programming language

2007-11-07 Thread Dale Steele
I'm anxiously awaiting my copy of the soon to be published "A First Course in Statistical Programming with R" by W. John Braun University of Western Ontario Duncan J. Murdoch University of Western Ontario Paperback (ISBN-13: 9780521694247) http://www.cambridge.org/catalogue/catalogue.asp?isbn=9

Re: [R] R as a programming language

2007-11-07 Thread Simon Blomberg
Although Crawley is an ecologist, not a programmer or statistician. But he is an FRS. Maybe that counts for something. ;-) Simon. On Thu, 2007-11-08 at 01:56 +0300, Alexy Khrabrov wrote: > With all due respect to the great book -- of which I own 2 copies I > bought new -- it's not an "O'Reilly

Re: [R] vectorize a list

2007-11-07 Thread Moshe Olshansky
Stack does not work for me either, but unlist works, i.e. unlist(l) --- Frank Schmid <[EMAIL PROTECTED]> wrote: > Dear R user > > Suppose I have the following list: > > > f <- rnorm(2) > > s <- rnorm(3) > > l <- list(f,s) > > l > [[1]] > [1] 0.31784399 0.08575421 > > [[2]] > [1] -0.6191679

Re: [R] R as a programming language

2007-11-07 Thread Duncan Murdoch
On 11/7/2007 8:13 AM, Duncan Murdoch wrote: > On 11/7/2007 7:46 AM, Alexy Khrabrov wrote: >> Greetings -- coming from Python/Ruby perspective, I'm wondering about >> certain features of R as a programming language. > > Lots of question, I'll intersperse some answers. >> >> Say I have a huge tab

Re: [R] running sum of a vector

2007-11-07 Thread Benilton Carvalho
x <- 1:10 cumsum(x) b On Nov 7, 2007, at 5:59 PM, Alexy Khrabrov wrote: > I need a vector with sums of vectors up to each position in the > original. The imperative version is simple: > > # running sum: the traditional imperative way > sumr.1 <- function(x) { > s <- c() > ss <- 0 > for (i

Re: [R] running sum of a vector

2007-11-07 Thread Chuck Cleland
Alexy Khrabrov wrote: > I need a vector with sums of vectors up to each position in the > original. The imperative version is simple: > > # running sum: the traditional imperative way > sumr.1 <- function(x) { >s <- c() >ss <- 0 >for (i in 1:length(x)) { > ss <- ss + x[i] >

[R] running sum of a vector

2007-11-07 Thread Alexy Khrabrov
I need a vector with sums of vectors up to each position in the original. The imperative version is simple: # running sum: the traditional imperative way sumr.1 <- function(x) { s <- c() ss <- 0 for (i in 1:length(x)) { ss <- ss + x[i] s[i] <- ss } s } Yet I want a f

Re: [R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
With all due respect to the great book -- of which I own 2 copies I bought new -- it's not an "O'Reilly Programming in " book. The idea of a programming book like that is to thoroughly treat the language from a programmer's standpoint, in a fairly standard way, such as Ruby or Python. As

Re: [R] Dealing with schema in RODBC

2007-11-07 Thread Marc Schwartz
On Wed, 2007-11-07 at 22:15 +, Mark Lyman wrote: > Is there a way to get a table in a certain schema? The Oracle database I am > using has a table by the same name in two different schemas. This creates > problems in sqlUpdate because to sqlUpdate there are duplicate columns. The > following

Re: [R] creating a dynamic output vector

2007-11-07 Thread Peter Alspach
Steve Is this the sort of thing you mean? output <- character(26) names(output) <- paste('var', LETTERS[1:26], sep='') output output[paste('var', LETTERS[c(2,4,6,7,16)], sep='')] <- c(1, pi, letters[1:3]) output Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[E

Re: [R] R as a programming language

2007-11-07 Thread Duncan Murdoch
On 11/7/2007 7:46 AM, Alexy Khrabrov wrote: > Greetings -- coming from Python/Ruby perspective, I'm wondering about > certain features of R as a programming language. Lots of question, I'll intersperse some answers. > > Say I have a huge table t of the form > > run ord unitwords

[R] creating a dynamic output vector

2007-11-07 Thread Steve Powers
Let's say I have a program that returns variables whose names may be any string within the vector NAMES=c("varA","varB","varC","varD","varE","varF"..."varZ"), but I do not ever know which ones have actually been created. So in one example output, "varA", "varC", and "varD" could exist, but in a

[R] Dealing with schema in RODBC

2007-11-07 Thread Mark Lyman
Is there a way to get a table in a certain schema? The Oracle database I am using has a table by the same name in two different schemas. This creates problems in sqlUpdate because to sqlUpdate there are duplicate columns. The following is part of the output of sqlColumns: sqlColumns(eids, "TEST

Re: [R] [R-sig-ME] mixed model testing

2007-11-07 Thread John Maindonald
Whether or not you need a mixed model, e.g. random versus fixed slopes, depends on how you intend to use results. Suppose you have lines of depression vs lawn roller weight calculated for a number of lawns. If the data will always be used to make predictions for one of those same lawns, a fixed sl

Re: [R] bug in multcomp?

2007-11-07 Thread Richard M. Heiberger
The only obvious typo is the misspelling of "Tukey". Uppercase is necessary. But that is not the cause of the current error. I can't duplicate the problem from your description. Look at the data.frame data_mcp. If that doesn't give you the hint, then you will need to send the data to the list,

Re: [R] Trouble in creating a list

2007-11-07 Thread Henrique Dallazuanna
Hi, i think that is more easy MyList <- list(levels(Model[,colnames(Model)[2]])) names(MyList) <- colnames(Model)[2] On 07/11/2007, Gang Chen <[EMAIL PROTECTED]> wrote: > > Hi, > > I really appreciate your help! As I'm still learning basics in R, please > pardon my simple questions. > > It seems

[R] Adding submenus to existing consol GUI menu

2007-11-07 Thread simon gatehouse
If possible I would like to add two sub-menus to the R Console under Windows. For example, I would like to add: winMenuAddItem("File", "Load CSV...", "loadCSV()") winMenuAddItem("File", "Save CSV...", "saveCSV()") and have them appear under the initial 'File' item rather than add a new 'File' m

Re: [R] function

2007-11-07 Thread jim holtman
Does this do what you want? > x <- 1:10 > x.f <- function(dat){ + c(mean=mean(dat), median=median(dat), sd=sd(dat)) + } > x.f(x) mean median sd 5.50 5.50 3.027650 > On 11/7/07, Bill Hunsicker <[EMAIL PROTECTED]> wrote: > > Rhelp, > > I have a collection of data that I wou

Re: [R] Aggregate with non-scalar function

2007-11-07 Thread jim holtman
Is this closer to what you would like? > x <- textConnection(" hostName user sys idle date time + 10142 fred 0.4 0.5 98.0 2007-11-01 02:02:18 + 16886 barney 0.5 0.2 94.6 2007-10-25 19:12:12 + 8795 fred 0.0 0.1 99.8 2007-10-30 05:08:22 + 5261 fred 0.1 0.2 99.7 20

[R] (no subject)

2007-11-07 Thread andrew collier
hello, i am a bit of a statistical neophyte and currently trying to make some sense of confidence intervals for correlation coefficients. i am using the cor.test() function. the documentation is quite terse and i am having trouble tieing up the output from this function with stuff that i have r

[R] Estimate a logit of shares

2007-11-07 Thread Trevor Marcel
Hello, I would like to estimate a logit with aggregated data. Each line describes an observation with the following fields : - share of choice A - share of choice B - share of choice C - Var.A1 (specific to choice A) - Var.A2 (specific to choice A) - Var.B1 (specific to choice B) - Var.B2 (specif

[R] function

2007-11-07 Thread Bill Hunsicker
Rhelp, I have a collection of data that I would like to perform some simple functions on like mean, stdev I would like to write a function that I sent data set to and have mean, and other calculations derived from data set returned. Can you help me? Regards, Bill Bill Hunsicker RF Micr

Re: [R] Kolmogorov-Smirnoff test

2007-11-07 Thread Jasjeet Singh Sekhon
A bootstrap Kolmogorov-Smirnoff test will have the correct test level even if there are ties---i.e., even if non-continuous distributions are being compared. See Abadie, Alberto. 2002. ``Bootstrap Tests for Distributional Treatment Effects in Instrumental Variable Models.'' Journal of the Americ

Re: [R] Imputing missing values in time series

2007-11-07 Thread Gabor Grothendieck
Here is na.locf both operating on x and on a zoo variable compared to the others: > set.seed(1) > x = 1:1e5 > x[sample(1:1e5, 1)] = NA > system.time(z2<-locf.iverson2(x)) user system elapsed 0.050.000.05 > system.time(z1<-locf.iverson(x)) user system elapsed 0.110.00

Re: [R] Indexing, and using an empty string as a name

2007-11-07 Thread Prof Brian Ripley
[Adding R-help back, as you did later.] On Wed, 7 Nov 2007, Charilaos Skiadas wrote: > On Nov 7, 2007, at 2:51 AM, Prof Brian Ripley wrote: > >> On Tue, 6 Nov 2007, Charilaos Skiadas wrote: >> >>> Hello all, >>> >>> I ran into the following, to me unexpected, behavior. I have (for >>> reasons t

[R] Homework help: t test hypothesis testing with summarized data?

2007-11-07 Thread Zembower, Kevin
Is this how a t hypothesis test is done when I don't have the actual data, but just the summarized statistics: > #Homework 9.2.6 [1] > n<-31 > xbar<-3.10 > s_x<-1.469 > m<-57 > ybar<-2.43 > s_y<-1.35 > s_pooled<- (((n-1)*s_x^2) + ((m-1)*s_y^2)) / (n + m - 2) > s_pooled [1] 1.939521 > t_obs <- (xba

Re: [R] Shortcut to refer to an attached dataframe?

2007-11-07 Thread Gabor Grothendieck
Here is one possibility: > gets <- function(pos) get(search()[pos]) > attach(iris) > summary(gets(2)) Sepal.LengthSepal.Width Petal.LengthPetal.Width Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300 Median

[R] Shortcut to refer to an attached dataframe?

2007-11-07 Thread Jeff Marcus
When I attach data frames I often want to be able to refer to the whole data frame rather then one of its components. For example: attach (my.data.frame) summary(my.data.frame) That's fine but often the frame has a very long name so I'd prefer some shorthand way of referring to it by its p

Re: [R] vectorize a list

2007-11-07 Thread Thibaut Jombart
Frank Schmid wrote: >Dear R user > >Suppose I have the following list: > > > f <- rnorm(2) > > s <- rnorm(3) > > l <- list(f,s) > > l >[[1]] >[1] 0.31784399 0.08575421 > >[[2]] >[1] -0.6191679 0.7615479 -1.0087659 > > >Can I stack the entries of this list in 1 vector with the first list >entry f

Re: [R] vectorize a list

2007-11-07 Thread Henrique Dallazuanna
try this: unlist(l) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 08/11/2007, Frank Schmid <[EMAIL PROTECTED]> wrote: > > Dear R user > > Suppose I have the following list: > > > f <- rnorm(2) > > s <- rnorm(3) > > l <- list(f,s) > > l > [[1]] > [1] 0.31784399 0.

Re: [R] Trouble in creating a list

2007-11-07 Thread Henrique Dallazuanna
Try this: 1)eval(parse(text=paste("MyList<-list(", colnames(Model)[2], "=", Model[,colnames(Model)[2]], ")"))) 2)Model[,colnames(Model)[2]] 3)MyList[[3]] <- "Teste" MyList[[4]] <- "Teste1" -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 07/11/2007, Gang Chen

Re: [R] its does not recognize POSIXct w/ both time and Date?

2007-11-07 Thread B. Bogart
Hello all, Please disregard this thread, turns out I was not dealing with properly formated POSIXct data actually. I'm writing only for the archives in case someone else has a similar problem. I had loaded the file with read.table using colClasses to use POSIXct as the class for the first col

Re: [R] PVM error message

2007-11-07 Thread elw
> I am working with a Fedora Core 6 OS and R 2.5. I have just finished > I am using PVM3.4.5+6-WIN32.tar.gz Isn't that supposed to be the wad of files for Windows machines? there's a different link on the PVM homepage to the source for unices... --elijah _

[R] vectorize a list

2007-11-07 Thread Frank Schmid
Dear R user Suppose I have the following list: > f <- rnorm(2) > s <- rnorm(3) > l <- list(f,s) > l [[1]] [1] 0.31784399 0.08575421 [[2]] [1] -0.6191679 0.7615479 -1.0087659 Can I stack the entries of this list in 1 vector with the first list entry followed by the second? The reference m

Re: [R] Simple Umacs example help..

2007-11-07 Thread Adam Wilson
Greetings, I've been playing with the umacs package for a few days and have worked out an example of a simple linear regression using gibbs samplers (included below). While extremely basic, I hope this might be helpful. I would love to see more examples of MH sampling as well. #

Re: [R] Daily announcements of changes (was: Save as postScrips latest R version)

2007-11-07 Thread Camila Estevam
Hi Professor Murdoch Thank you very much for your reply, I really did not know about the daily announcements. Next time I will check them. I will install the R-patched and let you know if it works. Thanks again, Camila --- Duncan Murdoch <[EMAIL PROTECTED]> escreveu: > It seems people are un

[R] PVM error message

2007-11-07 Thread Lenzo, Antonino
Hello R enthusiasts, I am working with a Fedora Core 6 OS and R 2.5. I have just finished loading PVM on my test cluster and this is working properly. Also, rpvm has been loaded in R. However, when I try to load my test program, I receive this error: Loading required package: rpvm Error in dyn

Re: [R] Imputing missing values in time series

2007-11-07 Thread Joao Santos
Hello, I have a similar problem but in my case I have a seasonal time series and the gaps are bigger. Like I said the TS as a seasonality to the week and some gaps are so big that seasonality is broken. I need a process to predict this values and keep the seasonality. From the search that I mad

[R] Trouble in creating a list

2007-11-07 Thread Gang Chen
I want to create a list based on the information from a data.frame, Model. So I tried the following: MyList <- list(colnames(Model)[2] = levels(Model$(colnames(Model)[2]))) but it failed with an error: Error: unexpected '=' in "list(colnames(Model)[2] =" I have the following problems with th

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread Julian Burgos
I'm assuming that you want to add b if 33 & a<5.25]) This is very simple R coding. I recommend you spend some time learning the basics. There are very good tutorials at the R website. Julian [EMAIL PROTECTED] wrote: > Hello, > > A stupid question: > > I have an array with two columns, the f

[R] Help please with predict.lme from nlme with nested random effects

2007-11-07 Thread Tom Cameron
Apologies for long posting but with this one I thought you would want all the details. I have tried all the usual books and searched internet and R pages but I cant find an example of an analysis with this problem and no examples of the predict function being used with lme models that have neste

Re: [R] question about running out of memory on R -- memory.limit change in R 2.6.0?

2007-11-07 Thread kees
Earl, Reported memory sizes work ok on Vista 64. If I ask for 3.5M it will give it, even though I have only 2Mb of RAM. It devaults to 2Mb as expected. Op Tue, 06 Nov 2007 19:38:07 +0100 schreef Earl F. Glynn <[EMAIL PROTECTED]>: > "jim holtman" <[EMAIL PROTECTED]> wrote in message > news:[E

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread Bert Gunter
Or even simpler (when cc is a data frame), instead of sum(cc[cc[,"a"] <= 5.25 & cc[,"a"] >= 3, "b"]) ## with(cc, sum(b[a <= 5.25 & a >= 3])) Bert Gunter Genentech Nonclinical Statistics __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] Daily announcements of changes (was: Save as postScrips latest R version)

2007-11-07 Thread Duncan Murdoch
It seems people are unaware of the daily announcements of R changes. If a change is significant enough to warrant mention in the NEWS file, it will be announced on one of the lists described here: http://developer.r-project.org/RSSfeeds.html These are available as RSS feeds, as the URL suggest

Re: [R] Algorithms for coincidences

2007-11-07 Thread Doran, Harold
Thank you, Greg. In part, that's what I'm poking around for. I'm wondering if there are any adaptations to clustered situations. I have that paper below since it is the reference in qbirthday(), but haven't found anything that has adapted this further. > -Original Message- > From: [EMAIL

Re: [R] Using R for large econometric models

2007-11-07 Thread John C Frain
I take it your friend is interested in large scale macro econometric models involving perhaps more than a thousand equations. The software one would like to use might involve managing the model database, estimating the model and simulating the model. If the model involves rational expectations t

[R] bug in multcomp?

2007-11-07 Thread Robert Cribbie
I am running a linear model with achiev as the outcome and major as my iv (5 levels). The lm statement runs fine, but for the glht command I get the following error. I noted that someone else asked the same question a while back but received no reply. I am hoping someone might know what is happ

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread Bert Gunter
In R "array" would mean a matrix, not a data frame. Also, let's name the frame "cc" as "c" is the name of a commonly used function, and so should be avoided as the name for an object. In any case, a straightforward translation using indexing seems simplest: sum(cc[cc[,"a"] <= 5.25 & cc[,"a"] >= 3,

[R] normalizing data for low kurtosis

2007-11-07 Thread Kat Willmore
To run my data in another program my data cannot exceed a kurtosis of 0.8. I'm wondering if there is a package that can determine if the kurtosis for a trait is equal to or greater than 0.8 and then determine the appropriate normalizing methods to reduce the kurtosis to less than 0.8. I would als

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread markleeds
There's probably a shorter way but below works and doesn't require the starting points to be in the a column. startindex<-3 endindex<-5.25 start<-tail(which(c$a<=startindex),1) end<-tail(which(c$a<=endindex),1) sum(c$b[start:end]) >Hello, > >A stupid question: > >I have an array with two colum

[R] Aggregate with non-scalar function

2007-11-07 Thread Mike Nielsen
R-Helpers, I'm sorry to have to ask this -- I've not used R very much in the last 8 or 10 months, and I've gotten rusty. I have the following (ff2 is a subset of a much, much larger dataset): > ff2 hostName user sys idle obsTime 10142 fred 0.4 0.5 98.0 2007-11-01 02:02:18

Re: [R] R as a programming language

2007-11-07 Thread Bert Gunter
>> (Will someone here please write an O'Reilly's "Programming in R"? :) Someone already has ... see Venable and Ripley's S PROGRAMMING. **However** R is more than a general purpose programming language: it is a programming language specifically designed for data analysis -- including statistical

[R] Save as postScrips latest R version

2007-11-07 Thread Camila Estevam
Hi, I was using the 2.4.1 R version and I had no problem saving my plots as postScript. Now that I have installed the latest version 2.6.0 I can not save any plot as postScript. When I try the following message appears: Erro: Invalid font type Além disso: Warning messages: 1: font family not foun

Re: [R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Wollkind, Steven
You don't need to loop. You can just do pfit$coefficients[is.na(pfit$coefficients)] <- 0 Steve Wollkind Associate Analyst Geode Capital Management, LLC 1 Post Office Square / 28th Floor / Boston, MA 02109 [EMAIL PROTECTED] Tel: (617) 392-8991 Fax: (617) 476-6389 This e-mail, and any attac

Re: [R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
I found this solution but it must another one much more "R-friendly" ? for (a in 1:9) { if (is.na(pfit$coefficients[[a]])) (pfit$coefficients[[a]]<-0) } Again thank you in advance for explainations concerning NA, Ptit Bleu. -- View this message in context: http://www.nabble.com/Can-I-replace-N

[R] SE of mean using subsampling bootstrap

2007-11-07 Thread Anil
I have been trying to get an example of R statements for estimating SE of mean using Subsampling bootstrap. Could someone help me? Thanks Anil [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
Hello, I'm trying to fit some points with a 8-degrees polynom (result of lm is stored in pfit). In most of the case, it is ok but for some others, some coefficients are "NA". I don't really understand the meaning of these "NA". And the problem is that I can't perform a derivation (pderiv<-as.fun

Re: [R] Graphics devices: windows() and x11() vs default

2007-11-07 Thread Wollkind, Steven
Ah ha! I wasn't aware of the getOption("device") call before. It appears that as soon as I load the cairoDevice library my default device gets set to Cairo, which explains why the Cairo device behavior matches what I was seeing before. This is now purely a cairo device issue, so I will pursue it

[R] Can I replace NA by 0 (if yes, how) ?

2007-11-07 Thread Ptit_Bleu
Hello, I'm trying to fit some points with a 8-degrees polynom (result of lm is stored in pfit). In most of the case, it is ok but for some others, some coefficients are "NA". I don't really understand the meaning of these "NA". And the problem is that I can't perform a derivation (pderiv<-as.fun

Re: [R] histogramme

2007-11-07 Thread Henrique Dallazuanna
Hi, Perhaps: par(mfrow=c(2,2)) hist(as.numeric(as.character(B[,1])),col="lightblue", border="pink") hist(as.numeric(as.character(A[,1])),col="yellow", border="pink") or hist(as.numeric(as.character(B[,1])),col="lightblue", border="pink") par(new=T) hist(as.numeric(as.character(A[,1])),col="yell

Re: [R] Graphics devices: windows() and x11() vs default

2007-11-07 Thread Martin Maechler
> "WS" == Wollkind, Steven <[EMAIL PROTECTED]> > on Wed, 7 Nov 2007 09:01:24 -0500 writes: WS> I'm noticing some differences between making an explicit WS> call to windows() to generate a graphics device and WS> going with whatever R gives you when you just start WS> pl

[R] histogramme

2007-11-07 Thread elyakhlifi mustapha
Hello, I can plot histogrammes but I want to know how can I do to plot 2 histogrammes at the same time (in the same window). hist(as.numeric(as.character(B[,1])),col="lightblue", border="pink") hist(as.numeric(as.character(A[,1])),col="yellow", border="pink") thanks. _

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread John Kane
d <- subset(c, c$a > 3 & c$a < 5.25 ) sum(d[,2]) --- [EMAIL PROTECTED] wrote: > Hello, > > A stupid question: > > I have an array with two columns, the first "a" > acting as my index in 0.25 steps, the second one "b" > the column of interest. How can i sum up "b" only > for a specified window i

Re: [R] Algorithms for coincidences

2007-11-07 Thread Thomas Lumley
On Tue, 6 Nov 2007, Greg Snow wrote: > A paper that may help you: > > "Methods for Studying Coincidences", Persi Diaconis; Frederick > Mosteller. Journal of the American Statistical Association, vol 84, no. > 408 (Dec., 1989), 853-861. The pbirthday()/qbirthday() functions use the approximations

Re: [R] dates

2007-11-07 Thread John Kane
http://finzi.psych.upenn.edu/R/library/base/html/format.Date.html might help as a start. --- marciarr <[EMAIL PROTECTED]> wrote: > > Dear R users, > I am just starting with R and am currently needing > a lot of help! Sorry if > I disturb you and thank you for your answers!!! > Here goes my qu

[R] mixed model testing

2007-11-07 Thread Irene Mantzouni
Is there a formal way to prove the need of a mixed model, apart from e.g. comparing the intervals estimated by lmList fit? For example, should I compare (with AIC ML?) a model with seperately (unpooled) estimated fixed slopes (i.e.using an index for each group) with a model that treats this par

[R] partially sum variable of a dataframe

2007-11-07 Thread mdgi
Hello, A stupid question: I have an array with two columns, the first "a" acting as my index in 0.25 steps, the second one "b" the column of interest. How can i sum up "b" only for a specified window in "a" (as the window command for time series) a=seq(0,10,0.25) b=runif(41) c=data.frame(a,b)

Re: [R] R as a programming language

2007-11-07 Thread Duncan Murdoch
On 11/7/2007 8:17 AM, Alexy Khrabrov wrote: > On Nov 7, 2007, at 4:13 PM, Duncan Murdoch wrote: > >>> And, still no option processing as in GNU long options, or python >>> or ruby's optparse. >>> What's the semantics of parameter passing -- by value or by >>> reference? >> >> By value. > > T

[R] Graphics devices: windows() and x11() vs default

2007-11-07 Thread Wollkind, Steven
I'm noticing some differences between making an explicit call to windows() to generate a graphics device and going with whatever R gives you when you just start plotting, which raises the question of just what the nature of the default device is. I've had a hard time researching this so far, so I'

Re: [R] partially sum variable of a dataframe

2007-11-07 Thread jim holtman
sum(c$b[(c$a > 3) & (c$a < 5.25)]) On 11/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > A stupid question: > > I have an array with two columns, the first "a" acting as my index in 0.25 > steps, the second one "b" the column of interest. How can i sum up "b" only > for a specifi

Re: [R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
On Nov 7, 2007, at 4:13 PM, Duncan Murdoch wrote: >> And, still no option processing as in GNU long options, or python >> or ruby's optparse. >> What's the semantics of parameter passing -- by value or by >> reference? > > By value. Thanks Duncan! So if I have a huge table t, and the idea w

Re: [R] R as a programming language

2007-11-07 Thread Gabor Grothendieck
Most of these have been answered but here are a few additional options. On Nov 7, 2007 7:46 AM, Alexy Khrabrov <[EMAIL PROTECTED]> wrote: > > Is there anything less ugly than > > print(paste("x=",x,"y=",y)) > > library(gsubfn) > a <- 1; b <- 2 > fn$cat("a = $a b = $b\n") a = 1 b = 2 See gsubfn h

Re: [R] Using R for large econometric models

2007-11-07 Thread Doran, Harold
One approach econometricians use with linear models is to demean the data in order to reduce the computational burden. This can be done using the ave() function. But, this is still difficult because, in my experience, you still need to build a model matrix that must be demeaned and that model matri

Re: [R] Linear Regression

2007-11-07 Thread Prof Brian Ripley
Doesn't lm(fquamsci ~ ., data=a) work? It normally does for a list a, so there would seem to be something special about your example if it does not. E.g. library(MASS) attach(hills) a <- list(dist=dist, climb=climb, time=time) detach() lm(time ~ ., data=a) (Maybe 'a' is not actually a list b

Re: [R] color2D.matplot

2007-11-07 Thread Phillip Aldridge
Hi Jim, Thanks for the suggestion I will try it as I do find color2D.matplot is a bit more versatile. I have however, since pasting my message, carried on playing and found out that that doing the following actually works as well: > fg = read.table("flagenes.txt", row.names=1) > fg1=as.mat

[R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
Greetings -- coming from Python/Ruby perspective, I'm wondering about certain features of R as a programming language. Say I have a huge table t of the form run ord unitwords new 1 1 69391013641 1 2 275 1001518 1 3 33141008

Re: [R] Indexing, and using an empty string as a name

2007-11-07 Thread Charilaos Skiadas
Sorry, I meant to reply to the whole list. I can totally understand the list's policy of not defaulting to "reply to the list", but I keep forgetting it in practice (since I am in a couple of other lists with less traffic, where the default is to reply to the list. Haris Skiadas Department

Re: [R] Linear Regression

2007-11-07 Thread Henrique Dallazuanna
Try this: data(tcm, package="tseries") mod <- lm(tcm[,"tcm1y"]~., data=tcm[,- which(dimnames(tcm)[[2]]=="tcm1y")]) On 07/11/2007, livia <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > > I would like to a linear regression with the following code. > lm(a[,"fquamsci"]~., data=a) > > a is a list

Re: [R] color2D.matplot

2007-11-07 Thread Jim Lemon
wragbag wrote: > I am a true R novice aonly using it for this function ;) > > I am trying to use color2D.matplot to form a image of my data using the > following conditions > > color2D.matplot(fi1, c(dr), c(dg), c(db), nslices=7, ylab='Species', > xlab="gene", show.legend=TRUE) where fi1 is my ma

[R] Linear Regression

2007-11-07 Thread livia
Hello everyone, I would like to a linear regression with the following code. lm(a[,"fquamsci"]~., data=a) a is a list with class "mts" "ts" , and "fquamsci" is the name of the response variable in a. I would like to do a linear regression of "fquamsci" to the rest of the variables. But it tur

  1   2   >