Re: [R] xts dates spacings

2009-10-02 Thread devol
Please also find below an example of what I meant (and sorry that I forgot to do it before) > class(thedata) [1] "xts" "zoo" > thedata thecolumn 2009-09-24 18:44:00 -60.34653 2009-09-24 18:45:00 -70.34653 2009-09-24 19:10:00 389.65347 2009-09-24 19:13:00 526.18462 2009-09

[R] Time Series

2009-10-02 Thread Kon Knafelman
Hi, Im trying to perform a time series analysis on financial data. Im going on the assumption that it follows the random walk, and therefore am fitting an ARIMA process via the following code fit<-arima(exchange,order=c(0,1,0)), and then analysing the tsdiag. Is there a more efficient way of

Re: [R] getting variables based on name

2009-10-02 Thread William Doane
This turns out to be quite easy... Given: > head(data) inst a1 a2 a3 a4 a5 a6 a7 a8 escore 11 1 1 0 1 1 0 0 0 4 21 0 1 0 0 0 0 0 0 1 31 1 0 0 1 0 1 1 1 2 41 0 1 0 0 0 1 0 0 1 You can use grep on the names of the columns in d

Re: [R] Multiple time series and their names

2009-10-02 Thread Gabor Grothendieck
zoo objects can have one column with a heading and convert back faithfully to ts: > library(zoo) > as.zoo(x)[, 1, drop = FALSE] Juan 1(1) -0.37415224 1(2) -0.30875111 1(3) -0.02617545 1(4) -0.45053564 2(1) 0.15173749 2(2) 1.38545761 2(3) 2.11594058 2(4) -0.84970010 3(1) -0.05944844

[R] Multiple time series and their names

2009-10-02 Thread David Stoffer
Suppose I have multiple time series with names for each one, for example, x <- ts(matrix(rnorm(30,0,1),10,3), names=c("Juan", "Tuey", "Trey"), frequency=4) So now, as I start to explore these series, if I do everything at once, the names stay attached to the series. For example, plot(x) # gives

[R] Problem using with panel.average in Lattice package

2009-10-02 Thread Mark Dalphin
Hi, I'm having a problem getting the panel.average function to work as I expect it to in a lattice plot. I wish to draw lines between the averages of groups of y-values at specific x-values. I have created a dataset below which is similar to my real data. I also show an example of using panel.loe

Re: [R] loop problem

2009-10-02 Thread David Winsemius
On Oct 2, 2009, at 7:34 AM, crenial30 wrote: Thanks a lot David for your answer. I am sorry for being so minimal. I wanted to produce a list/vector/table consisting each vector produced from this code len<-20 for (n1 in seq(0,(len-1),by=1)){ f <- R_event[R_event > (rx[1]+ n1*300)& R_even

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
Oops, missed a square bracket: ttx1[order(-ttx1[,"obs"]),] -Peter Ehlers P Ehlers wrote: You don't need to attach. But you do need to mention what kind of object ttx1 is. I had (foolishly) assumed that it was dataframe, but I see that it's a matrix. So try this: ttx1[order(-ttx1[,"obs"),] -

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
You don't need to attach. But you do need to mention what kind of object ttx1 is. I had (foolishly) assumed that it was dataframe, but I see that it's a matrix. So try this: ttx1[order(-ttx1[,"obs"),] -Peter Ehlers Hyo Lee wrote: Ok. I just figured out what the problem was. I had to attach()

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread jim holtman
You probably need to read a little more about R and learn the difference between matrix and dataframes. You need to do the following since ttx1 is a matrix: sortedx1=ttx1[order(-ttx1[, 'obs']),] On Fri, Oct 2, 2009 at 9:37 PM, Hyo Lee wrote: > Ok. I just figured out what the problem was. > I ha

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread Hyo Lee
Ok. I just figured out what the problem was. I had to attach() the data. ** x1=data1[,,2] tx1=t(x1) *ttx1 *= cbind(tx1 , obs=1:nrow(tx1)) --> this is how ttx1 was made; and of course, in ttx1, there is a variable called 'obs'. I had to attach(ttx1) first before I use this: *sortedx1=ttx1[order(-ob

Re: [R] caret package for time series applications

2009-10-02 Thread zubin
Max, thx for the reply, i am amazed at the caret package.. very nice okay, for time series, i think i can include a dummy variable for each time period and try to remove the time effect, less 1 dummy, like one does for seasonality. maybe that will work, if anyone has any suggestions on how to

Re: [R] Tabulating using arbitrary numbers of factors

2009-10-02 Thread jim holtman
try 'reshape': > require(reshape) > # add a column to accumulate on > tmp$inc <- 1 > recast(tmp, f1 + f2 + f3 ~ ., sum) Using f1, f2, f3 as id variables f1 f2f3 (all) 1MaleWhite 0-20 3 2MaleWhite 21-40 4 3MaleWhite 41-60 2 4MaleWhite 61

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread Hyo Lee
Thanks.. but not working... > sortedx1=ttx1[order(-ttx1$obs),] Error in ttx1$obs : $ operator is invalid for atomic vectors On Fri, Oct 2, 2009 at 8:47 PM, P Ehlers wrote: > Try > > sortedx1=ttx1[order(-ttx1$obs),] > > (and ask yourself where obs lives) > > -Peter Ehlers > > Hyo Lee wrote: >

[R] posting contrib documentation

2009-10-02 Thread Sharma, Dhruv
Hi, how do i post a document to contrib documentation in R? is there an email i can send the document as an attachment to? thanks DS [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread P Ehlers
Try sortedx1=ttx1[order(-ttx1$obs),] (and ask yourself where obs lives) -Peter Ehlers Hyo Lee wrote: Hi guys, I need your help. I'm trying to sort the data by the variable "obs". This is how I tried to sort the data below. The problem is, I have a variable name "obs"; this is.. a counter va

Re: [R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread jim holtman
Are you really sure you have 'obs'? What does 'str(obs)' show? What about 'ls()'? On Fri, Oct 2, 2009 at 8:19 PM, Hyo Lee wrote: > Hi guys, > I need your help. > I'm trying to sort the data by the variable "obs". > This is how I tried to sort the data below. > > The problem is, I have a variabl

Re: [R] how to fill out the empty spots when using rbind or cbind?

2009-10-02 Thread jim holtman
I will take a guess at what you want since you did not program an example of your data or output desired: > a <- 1:4 > b <- 1:6 > # get error message > cbind(a,b) a b [1,] 1 1 [2,] 2 2 [3,] 3 3 [4,] 4 4 [5,] 1 5 [6,] 2 6 Warning message: In cbind(a, b) : number of rows of result is not a mu

[R] How to deal with this :" object ' obs' not found.

2009-10-02 Thread Hyo Lee
Hi guys, I need your help. I'm trying to sort the data by the variable "obs". This is how I tried to sort the data below. The problem is, I have a variable name "obs"; this is.. a counter variable. something like _n_ in SAS. I do not know why it is not working. I even tried a similar example in UC

Re: [R] how to fill out the empty spots when using rbind or cbind?

2009-10-02 Thread Daniel Malter
Fill the respective "empty" spots in the vectors with NAs. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von tke...@msn.com Gesendet: Fr

Re: [R] randomizing groups

2009-10-02 Thread Jason Priem
Duh. I just figured out that though I was getting a warning, it was still doing the split anyway. Sorry for the dumb question. -jason Jason Priem wrote: I have a list of participants in a study, identified by number. I want to randomly sort them into an arbitrary number of groups. split(sam

[R] how to fill out the empty spots when using rbind or cbind?

2009-10-02 Thread tkedch
I have uneven vectors I want to use cbind or rbind to combine them into a matrix. Is there a way to make it so that R would not return error msg saying they're uneven? Thanks. Edward Chen Email: tke...@msn.com Cell Phone: 510-371-4717 [[alt

Re: [R] Re cursive regression

2009-10-02 Thread spencerg
There is a huge literature on time series analysis with many functions and contributed packages in R, including many different ways "to estimate a recursive model". If you are working with "asset returns", I suggest you start with Diethelm Würtz, Yohan Chalabi, William Chen, Andrew

Re: [R] How to use Subpopulation data?

2009-10-02 Thread David Winsemius
On Oct 2, 2009, at 2:39 PM, KABELI MEFANE wrote: Dear Mr Winsemius I am sorry to have offended any of you by the mistakes i made. The package i loaded is sampling and there was an unwanted comma between size c(20, )and the bracket. What i wanted was to calculate the sum of H in a sample

Re: [R] randomizing groups

2009-10-02 Thread David Winsemius
On Oct 2, 2009, at 4:36 PM, Jason Priem wrote: I have a list of participants in a study, identified by number. I want to randomly sort them into an arbitrary number of groups. split(sample(1:96, 96), 1:16) almost does it, but it only works where the division is even. Any ideas? Thanks!

[R] [Fwd: Re: randomizing groups]

2009-10-02 Thread Jason Priem
Duh. I just figured out that though I was getting a warning, it was still doing the split anyway. Sorry for the dumb question. -jason Jason Priem wrote: I have a list of participants in a study, identified by number. I want to randomly sort them into an arbitrary number of groups. split(samp

[R] (no subject)

2009-10-02 Thread C. Maranto
Dear R Community, I am running GLM's within the "MASS" library. My data are overdispersed and I am accounting for the overdispersion by using an ANOVA 'F' test instead of ANOVA 'Chisq'. You will have to forgive me because I am new at this, but I am not sure if R is conducting an ANOVA 'F' te

Re: [R] Re gression line w/ residuals - tuning the plot

2009-10-02 Thread Primoz PETERLIN
Many thanks to both who replied, Ulrike and Petr. Indeed, some playing with the margin-sizing options solved my problem. All the best, Primož 2009/9/29 Ulrike Groemping : > > Hello Primoz, > > with traditional graphics, you may want to use par (?par), options like mar, > mai, oma etc. may be inte

[R] aggregate data into an array

2009-10-02 Thread Juliane Struve
Dear list,   I would like to aggregate CVTimeDiff by Fish_ID and Trip and put the result into myarray,i.e. for the example below Trip 1,9 and Fish_ID 1646 I would like to obtain mean= (0.8104876+1.3676631)/2 and put it into myarray[1] .   mydataframe   Trip Fish_ID CVTimeDiff 1    1,9 1

[R] randomizing groups

2009-10-02 Thread Jason Priem
I have a list of participants in a study, identified by number. I want to randomly sort them into an arbitrary number of groups. split(sample(1:96, 96), 1:16) almost does it, but it only works where the division is even. Any ideas? Thanks! Jason Priem, Doctoral Student, School of Information

Re: [R] How to use Subpopulation data?

2009-10-02 Thread Peter Ehlers
Kabeli, You seem to be doing your best to avoid working your way through some introductory documentation like An Introduction to R, which is sitting right there on your computer. So let's try to take it slowly, one step at a time. #1. generate a vector of values to work with. (forget the matrix

Re: [R] Tabulating using arbitrary numbers of factors

2009-10-02 Thread Erik Iverson
Andrew, Is this what you're looking for? Most likely a more elegant solution exists... but maybe this is good enough. ## BEGIN R SAMPLE CODE ## sample data frame, 3 factors tmp <- data.frame(f1 = sample(gl(2, 50, labels = c("Male", "Female"))), f2 = sample(gl(4, 25, labels =

[R] trouble with html() in Hmisc

2009-10-02 Thread Liviu Andronic
Dear all On my system html() conversion of a `latex()' object fails. Follows a dummy example: > require(Hmisc) > data(Angell) > .object <- cor(Angell[,1:2], use="complete.obs") > tmp <- latex(.object, cdec=c(2,2), title="") > class(tmp) [1] "latex" > html(tmp) /tmp/RtmprfPwzw/file7e72f7a7.tex:9: Wa

[R] Tabulating using arbitrary numbers of factors

2009-10-02 Thread Andrew Spence
Dear R-help, First of all, thank you VERY much for any help you have time to offer. I greatly appreciate it. I would like to write a function that, given an arbitrary number of factors from a data frame, tabulates the number of occurrences of each unique combination of the factors. Cleary,

[R] error using frailty term

2009-10-02 Thread Mary Slaughter
Trying to fit a model using the Surv() with a frailty term but get the following cryptic error message: -- Error in frailty.brent(sqrt(x), y, lower = 0) : Ties for max(y), I surrender Calls: runplots ... coxpenal.fit -> e

Re: [R] plot scale

2009-10-02 Thread Greg Snow
Here is a different approach: This example uses the default plotting device, but should work the same with postscript or any other device. Just set the size of the paper to a standard size, or a large enough size to fit your largest plot: dev.new() tmp <- par('plt') scale <- 5 x <- runif(100,

[R] xts dates spacings

2009-10-02 Thread devol
Hello! Please help - can't find any options how to remove very big spaces between two dates containing intraday prices plotted by plot.xts. It looks like the following: on the left side of the plot window is the first bunch of points, the same is for the right hand side and a long line connecti

Re: [R] RE xcel foreground and background server

2009-10-02 Thread ryusuke
I have installed, its workable in frontground mode while but background mode, may I know how do I activate background mode? Thanks Irina Ursachi wrote: > > Dear all, > > I have a question regarding background and foreground server in RExcel: > Can somebody explain the main difference between t

Re: [R] text mining

2009-10-02 Thread Corey Dow-Hygelund
Your problem lies in the use of system.file. This command looks in the folder location of tm for specific folders. See ?system.files. Basically, for the document example, it assigning txt to the directory string like "C:/Program Files (x86)/R/R-2.9.0/library/tm/texts/txt" Then the DirSource(txt)

Re: [R] How to use Subpopulation data?

2009-10-02 Thread KABELI MEFANE
Dear Mr Winsemius   I am sorry to have offended any of you by the mistakes i made. The package i loaded is sampling and there was an unwanted comma between size c(20, )and the bracket. What i wanted was to calculate the sum of H in a sample not in the original dataframe. If i do sum(H) i get th

Re: [R] plot scale

2009-10-02 Thread Ryan
> > Hi, > > Is there a way to set the scale of a plot (i.e. number of axis units > per centimeter) when you output it to postscript? If not, how am I > supposed to plot graphs with different axis limits to the same scale? > They just get resized to fit the paper so that graphs which show a > smal

[R] Weibull survival regression model with different shape parameters

2009-10-02 Thread Nicolas RODE
Dear R users, I'm trying to fit a parametric survival model using the survreg function with a Weibull distribution. I'm studying the time to death of individuals from different families and I would like to fit different shape parameters (ie 1/scale in R) for each of the families. I looked it up in

Re: [R] .Rprofile file

2009-10-02 Thread Marianne Promberger
> I want to use the .RProfile to set defaults such as text editor. Is > this a file I need to create? Also, where should I put it? I tend to > create .RData files for different projects, putting each in a different > Windows (Vista) folder. Is one .Rprofile file created that any > ins

Re: [R] loop problem

2009-10-02 Thread crenial30
Thanks a lot David for your answer. I am sorry for being so minimal. I wanted to produce a list/vector/table consisting each vector produced from this code len<-20 for (n1 in seq(0,(len-1),by=1)){ f <- R_event[R_event > (rx[1]+ n1*300)& R_event <= (rx[1] + 300*(n1+1))] //create list for each va

[R] text mining

2009-10-02 Thread PDXRugger
The following code is derived from a paper titled "Text Mining Infrastructure in R" (http://www.jstatsoft.org/v25/i05/paper). The example below seems to load some default documents for analysis, some sort of latin document. I cannot for the life of me figure out to load my own document let alone

Re: [R] split-apply question

2009-10-02 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of hadley wickham > Sent: Friday, October 02, 2009 6:07 AM > To: jim holtman > Cc: r-help@r-project.org; Kavitha Venkatesan > Subject: Re: [R] split-apply question > > On Fri, Oct

Re: [R] nls not accepting control parameter?

2009-10-02 Thread Peter Ehlers
Hello Rainer, I think that your problem is with trying to fit a logistic model to data that don't support that model. Removing the first two points from your data will work (but of course it may not represent reality). The logistic function does not exhibit the kind of minimum that your data sugg

Re: [R] confint fails in quasibinomial glm: dims do not match

2009-10-02 Thread Peter Ehlers
Chad, (inline below) joris meys wrote: Confint doesn't work if you have a multi-dimensional dependent variable. Well, it will work, but not for the quasibinomial family. The simple solution would seem to be to change your response from the matrix cbind(,) to the vector alive/sum(alive+red) a

Re: [R] Normal distribution

2009-10-02 Thread Greg Snow
See fortune(234) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Noela Sánchez > Sent: Thursday, October 01,

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread Gabor Grothendieck
Here is a slightly simpler version of the strapply solution with a short string at the end: > strapply("abcdefghijk", ".{1,3}")[[1]] [1] "abc" "def" "ghi" "jk" On Fri, Oct 2, 2009 at 8:20 AM, Gabor Grothendieck wrote: > That part wasn't specified so we can't say what the required behavior > is i

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread Stefan Th. Gries
This should do what you want: x<-"abcdefghijkl" strsplit(x, "(?<=...)", perl=T) HTH, STG -- Stefan Th. Gries --- University of California, Santa Barbara http://www.linguistics.ucsb.edu/faculty/stgries __ R-he

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread Gabor Grothendieck
I was thinking of startup code in your C:\Program Files\R\R-2.9.2\etc\Rprofile.site file or other startup R file that you provided. See ?Startup On Fri, Oct 2, 2009 at 12:01 PM, FMH wrote: > Yes, i noticed there are few Windows start up programs, shown by the > EasyCleaner software. > > Cheers

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread FMH
Yes, i noticed there are few Windows start up programs, shown by the EasyCleaner software. Cheers   - Original Message From: Gabor Grothendieck To: FMH Cc: stephen sefick ; Sent: Fri, October 2, 2009 4:50:52 PM Subject: Re: [R] How to speed up R with version 2.9.2? Its under 5 seco

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread Sundar Dorai-Raj
Another possibility is a very large .RData file in the directory where you're starting R. You can try Rgui --no-restore (I don't have windows, so I'm not sure if this an option with RGui, though I know it is with R.) --sundar On Fri, Oct 2, 2009 at 8:50 AM, Gabor Grothendieck wrote: > Its unde

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread Gabor Grothendieck
Its under 5 seconds on my Vista laptop. Do you have any startup files? If Rgui --vanilla is much faster then your startup files are the problem. On Fri, Oct 2, 2009 at 11:45 AM, FMH wrote: > Thank you for your answer. I'm using Win XP with 2GB RAM in memory. > > Cheers > Fir > > > > - Ori

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread Erik Iverson
Sorry, original replied to wrong post... Do you happen to have a large .Rdata file that is being loaded, or something in your .Rprofile? Try searching for a file with that name. Or start R with a --vanilla and see if that helps... > -Original Message- > From: r-help-boun...@r-project

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread FMH
Thank you for your answer. I'm using Win XP with 2GB RAM in memory. Cheers Fir - Original Message From: stephen sefick To: FMH Cc: r-help@r-project.org Sent: Fri, October 2, 2009 4:38:10 PM Subject: Re: [R] How to speed up R with version 2.9.2? You're fine, but please do read the po

Re: [R] decision trees using the Hellinger distance rather than

2009-10-02 Thread Erik Iverson
Do you happen to have a large .Rdata file that is being loaded, or something in your .Rprofile? Try searching for a file with that name. Or start R with a --vanilla and see if that helps... > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]

Re: [R] How to speed up R with version 2.9.2?

2009-10-02 Thread stephen sefick
You're fine, but please do read the posting guide. What OS etc. Where you doing anything else on the computer? Is this a RAM limitation? I have 2.9.2 running on two flavours of linux, mac os x and windows all 2.9.2 and there doesn't seem to be a problem. regards, Stephen On Fri, Oct 2, 2009 at

[R] decision trees using the Hellinger distance rather than

2009-10-02 Thread Rajarshi Guha
Hi, while working with decision trees and unbalanced data, I came across the use of the Hellinger distance as an alternative to information gain [1,2], when dealing with skewed data. Does anybody know of R implementations of this approach to decision trees? Thanks, [1] http://www.cse.nd.edu/Repor

[R] How to speed up R with version 2.9.2?

2009-10-02 Thread FMH
Dear All, I'm sorry if my question does not suit with this R group. I have recently installed R software with version 2.9.2, but i found the program took almost 1 minute as soon as it was opened, before it can be used. However, the previous version 2.9.1 only take few seconds after the menu bar

[R] ggplot2: proper use of facet_grid inside a function

2009-10-02 Thread Bryan Hanson
Hello Again R Folk: I have found items about this in the archives, but I’m still not getting it right. I want to use ggplot2 with facet_grid inside a function with user specified variables, for instance: p <- ggplot(data, aes_string(x = fac1, y = res)) + facet_grid(. ~ fac2) Where data, fac

Re: [R] Robust ANOVA with variance heterogeneity

2009-10-02 Thread Kjetil Halvorsen
On Fri, Oct 2, 2009 at 8:45 AM, David Winsemius wrote: > There are multiple routes to "robust" statistics, but the quick answer to > this question is probably friedman.test I don't think friedman.test is robust to variance heterogeneity. It is only robust to non-normality. Kjetil > > I seem t

Re: [R] Rd files, \itemize in \value

2009-10-02 Thread Duncan Murdoch
On 10/2/2009 9:05 AM, Gábor Csárdi wrote: Dear All, how can I create a list in the \value{} section of an Rd file? The things I have tried: 1. \value{ text text \item more text \item even more } *** Syntax error: \item in /- \item more text \item even more\- 2. \value{ text text

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of jim holtman > Sent: Friday, October 02, 2009 5:09 AM > To: Gabor Grothendieck > Cc: r-help@r-project.org; J Chen > Subject: Re: [R] break up a string into strings with a fixed le

Re: [R] How to select a subset

2009-10-02 Thread Steve Lianoglou
Hi, On Oct 2, 2009, at 10:47 AM, Hyo Lee wrote: Hi guys, I need your help. I would like to select a subset from a dataset. This is the dimension of the dataset. dim(data1) [1] 72 36 1916 so, it's like.. there are 1916 of 72 * 36 matrix. ==> looks like 72 * ( 36*1916 ) ** *1)* And I

Re: [R] svDialogs

2009-10-02 Thread Tubin
Download the package to your hard drive from here: http://cran.r-project.org/web/packages/svDialogs/ Then install directly using install.packages (for instructions on doing this, type ?install.packages) Just tried it, worked fine for me. Hi there, I was using Open/Save-dialogs from the packa

[R] How to select a subset

2009-10-02 Thread Hyo Lee
Hi guys, I need your help. I would like to select a subset from a dataset. This is the dimension of the dataset. > dim(data1) [1] 72 36 1916 so, it's like.. there are 1916 of 72 * 36 matrix. ==> looks like 72 * ( 36*1916 ) ** *1)* And I would like to select the first 72*36 matrix. This is h

Re: [R] svDialogs

2009-10-02 Thread Philippe Grosjean
Hello, Now, the *bundle* SciViews has disappeared from CRAN, but the *package* svDialogs is still there. Best, Philippe ..<°}))>< ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems )

Re: [R] How to use Subpopulation data?

2009-10-02 Thread David Winsemius
On Oct 1, 2009, at 6:06 AM, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H <- matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type

Re: [R] svDialogs

2009-10-02 Thread Tubin
Did you ever get a response on this? I have been having a similar problem. Thanks, Sarah antje-4 wrote: > > Hi there, > > I was using Open/Save-dialogs from the package svDialogs (SciViews). But > now > the package has dissapeared? How do I have to set up my R-installation to > further use

Re: [R] How to use Subpopulation data?

2009-10-02 Thread KABELI MEFANE
Thank you very much!!   To trouble you again: I cannot do the sum and i have looked at several package since startng with this problem. I have a very large code just to do simple random, normal stratified sampling with proportional allocation and Dollar stratification with Neyman allocation usin

Re: [R] Fetch large sized file from SQL

2009-10-02 Thread Corrado
I think you can specify the number of rows to be loaded at a time. It was quite a while ago. Try reading ?sqlQuery ?odbcConnect I have loaded quite large tables. On Friday 02 October 2009 14:59:59 Dr. Alireza Zolfaghari wrote: > But the problem is that the dataframe size in sql is large, there

Re: [R] confint fails in quasibinomial glm: dims do not match

2009-10-02 Thread joris meys
Confint doesn't work if you have a multi-dimensional dependent variable. Kind regards Joris On Fri, Oct 2, 2009 at 4:29 AM, smith_cc wrote: > > I am unable to calculate confidence intervals for the slope estimate in a > quasibinomial glm using confint(). Below is the output and the package info

Re: [R] Fetch large sized file from SQL

2009-10-02 Thread Dr. Alireza Zolfaghari
But the problem is that the dataframe size in sql is large, therefore odbc can sqlQuery() can not handel it. On Fri, Oct 2, 2009 at 2:14 PM, Corrado wrote: > You can try using RODBC, it allows you to connect to databases using the > ODBC > driver. > > I had some difficulties using it with the po

Re: [R] Legend

2009-10-02 Thread David Winsemius
On Oct 2, 2009, at 9:46 AM, Ashta wrote: I have more than three lines in one and I want to add a legend for each line abline( m1, col = 'red' ) ablime( m2, col = 'blue' ) abline( m3, col = 'purple' ) How can I add a legend? . Is it also possible to increase the thickness of the lines?

Re: [R] Legend

2009-10-02 Thread Gábor Csárdi
On Fri, Oct 2, 2009 at 3:46 PM, Ashta wrote: > I have more than three lines in one  and I want to add a legend  for each > line > > abline( m1, col = 'red' ) > ablime( m2, col = 'blue' ) > abline( m3, col = 'purple' ) > > How can I add a legend? . Surprisingly, it is the legend() function. See ?l

[R] Legend

2009-10-02 Thread Ashta
I have more than three lines in one and I want to add a legend for each line abline( m1, col = 'red' ) ablime( m2, col = 'blue' ) abline( m3, col = 'purple' ) How can I add a legend? . Is it also possible to increase the thickness of the lines? Thanks [[alternative HTML version delete

Re: [R] Fetch large sized file from SQL

2009-10-02 Thread Corrado
You can try using RODBC, it allows you to connect to databases using the ODBC driver. I had some difficulties using it with the postgresSQL driver in the past, because of some apparent incompatibility with the native postrgesSQL ODBC driver. I think the problem where solved by the new ODBC dri

Re: [R] Problem with dist (bug?)

2009-10-02 Thread Corrado
Dear list, here is the code that generates the problem: library(proxy) scot<-read.csv("scot.csv",header=TRUE) scot24_climate<-scot24[,1105:1109] # Scotland dist_scot24_climate<- dist(scot24_climate,method="correlation",diag=TRUE,upper=TRUE) max(dist_scot24_climate) is 1.9. I do not think it

Re: [R] split-apply question

2009-10-02 Thread hadley wickham
On Fri, Oct 2, 2009 at 4:24 AM, jim holtman wrote: > try this: > >> x <- read.table(textConnection("x1  x2  x3 > + A   1    1.5 > + B   2    0.9 > + B   3    2.7 > + C   7    1.8 > + D   7    1.3"), header=TRUE) >> closeAllConnections() >> do.call(rbind, lapply(split(seq(nrow(x)), x$x1), function(

[R] Rd files, \itemize in \value

2009-10-02 Thread Gábor Csárdi
Dear All, how can I create a list in the \value{} section of an Rd file? The things I have tried: 1. \value{ text text \item more text \item even more } *** Syntax error: \item in /- \item more text \item even more\- 2. \value{ text text \item{more text} \item{even more} } This g

Re: [R] inverse currying

2009-10-02 Thread baptiste auguie
After some more digging (grep "alist" R-devel/ ), I've come up with this, tools:::as.alist.symbol("x") sugar = function(fun, id = "id"){ ff <- formals(fun) if( id %in% names(ff)) stop(paste(id, "is part of args(fun)")) new.arg <- tools:::as.alist.symbol(id) formals(fun) <- c(unlist(ff),

[R] Fetch large sized file from SQL

2009-10-02 Thread Dr. Alireza Zolfaghari
Hi List, Does any one know what package I need to use in order to fetch/get a large sized dataframe from SQL? I have already used sqldf package which is good for fetching large sized csv files. Thanks Alireza [[alternative HTML version deleted]] __

Re: [R] split-apply question

2009-10-02 Thread Henrique Dallazuanna
You can use aggregate: aggregate(x[,c('x2','x3')], x['x1'], min) On Fri, Oct 2, 2009 at 12:43 AM, Kavitha Venkatesan wrote: > Hi, > > I have a data frame that looks like this: > >>x > > x1  x2  x3 > A   1    1.5 > B   2    0.9 > B   3    2.7 > C   7    1.8 > D   7    1.3 > > I want to "group" by

Re: [R] Robust ANOVA with variance heterogeneity

2009-10-02 Thread David Winsemius
There are multiple routes to "robust" statistics, but the quick answer to this question is probably friedman.test I seem to remember a CRAN Task View on the area of Robust Statistics. -- David Winsemius On Oct 2, 2009, at 3:05 AM, Maike Luhmann wrote: Dear list members, I am looking for a

Re: [R] split-apply question

2009-10-02 Thread David Winsemius
As is typical with R there are often other ways. Here is another approach that determines the rows of interest with tapply and min, converts those minimums into logical "targets" with %in%, and extracts them from "x" using indexing: x[x$x2 %in% tapply(x$x2, x$x1, min), ] x1 x2

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread Gabor Grothendieck
That part wasn't specified so we can't say what the required behavior is in that case; however, if a non-multiple of 3 were possible and if the short string is to be emitted at the end then we can just add to the regular expression: > library(gsubfn) > s <- paste(letters, collapse = "") > strappl

Re: [R] help with regexp mass substitution

2009-10-02 Thread Gabor Grothendieck
dot (.) matches anything so be sure to escape it so that it only matches a literal dot in your regular expression. On Fri, Oct 2, 2009 at 5:39 AM, Luca Braglia wrote: > Hello * > > i have to rename a lot of variables, and, given that they have regular name > constructs, I would like to use regex

Re: [R] help with regexp mass substitution

2009-10-02 Thread jim holtman
You need perl=TRUE: gsub("^col(\\d{1,2}).(\\d{1,2}).(\\d{1,2})", "dom\\3.rig\\2.col\\1", varnames, perl=TRUE) [1] "id.quest""txt.1.3" "dom3.rig1.col1" "dom3.rig1.col2" "dom3.rig1.col3" "dom3.rig1.col4" "dom3.rig1.col5" [8] "txt.2.3" "dom3.rig2.col1" "dom3.rig2.col2"

Re: [R] plot subscript text and percentage symbol in graph label axis

2009-10-02 Thread baptiste auguie
try this, plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~"%")) baptiste 2009/10/2 e-letter : > Readers, > > I am unable to plot a label consisting of both subscript text and > percentage (%) symbol: > > x<-(1:10) > y<-(200:191) > plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread jim holtman
But it misses the last set if not a multiple of the subset length: > library(gsubfn) > s <- "abcdefghijklm" > > # no 'm' > strapply(s, "...")[[1]] [1] "abc" "def" "ghi" "jkl" > On Fri, Oct 2, 2009 at 7:58 AM, Gabor Grothendieck wrote: > Try this: > >> library(gsubfn) >> s <- "abcdefghijkl" > >>

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread Gabor Grothendieck
Try this: > library(gsubfn) > s <- "abcdefghijkl" > strapply(s, "...")[[1]] [1] "abc" "def" "ghi" "jkl" On Fri, Oct 2, 2009 at 5:36 AM, J Chen wrote: > > dear all, > > I have some very long strings and would like to break up each long string > into multiple strings with a fixed length, e.g. to

Re: [R] How to get duplicated items in a vector?

2009-10-02 Thread jim holtman
Try this: > x=c(rep(1,3),rep(3,2)) > x [1] 1 1 1 3 3 > duplicated(x) | duplicated(x, fromLast=TRUE) [1] TRUE TRUE TRUE TRUE TRUE > On Thu, Oct 1, 2009 at 10:42 PM, Peng Yu wrote: > Hi, > >> x=c(rep(1,3),rep(3,2)) >> x > [1] 1 1 1 3 3 >> duplicated(x) > [1] FALSE  TRUE  TRUE FALSE  TRUE >> > >

Re: [R] Robust ANOVA with variance heterogeneity

2009-10-02 Thread John Fox
Dear Maike, You could use the Anova() function in the car package with a heteroscedasticity-consistent coefficient covariance matrix (via the argument white.adjust=TRUE). Regards, John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On >

Re: [R] Please Help me!

2009-10-02 Thread jim holtman
try this: (?try) name_c<-Sys.glob("C:/Documents and Settings/lma/My Documents/habitdata/*/calllog/*") for (i in 1:length(name_c)){ log1<-try(readLines(name_c[i])) if (inherits(log1, 'try-error')) next # skip if error write.table(Temps, file=paste("C:/Documents and Setting

Re: [R] break up a string into strings with a fixed length

2009-10-02 Thread jim holtman
try this: > a <- paste(letters, collapse='') > # partitions into lengths of 4 > indx <- seq(1, nchar(a), 4) > a.p <- sapply(indx, function(x) substring(a, x, x+3)) > > a.p [1] "abcd" "efgh" "ijkl" "mnop" "qrst" "uvwx" "yz" > On Fri, Oct 2, 2009 at 5:36 AM, J Chen wrote: > > dear all, > > I have

[R] plot subscript text and percentage symbol in graph label axis

2009-10-02 Thread e-letter
Readers, I am unable to plot a label consisting of both subscript text and percentage (%) symbol: x<-(1:10) y<-(200:191) plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~%)) Error: syntax error, unexpected ERROR in "plot(x~y,ylab=expression(~degree~C),xlab=expression(x~%)" It seems that

[R] Please Help me!

2009-10-02 Thread Tammy Ma
Hi, R-users, I have a problem: Because there are few files which can't be readed into R completely, so on the following subsequence programme, I use write.table, which creates the "NA" files for those incomplete files autimatically. I don't want those NA files. My programes formats looks like:

[R] help with regexp mass substitution

2009-10-02 Thread Luca Braglia
Hello * i have to rename a lot of variables, and, given that they have regular name constructs, I would like to use regexps. Here's a dump of my head(names(df)) varnames <- c("id.quest", "txt.1.3", "col1.1.3", "col2.1.3", "col3.1.3", "col4.1.3", "col5.1.3", "txt.2.3", "col1.2.3", "col2.2.3", "

  1   2   >