Re: [R] removing missing values from a matrix

2009-10-02 Thread Amit Kumar
Thanks! It worked! There is another problem I want to subset the matrix 'red' in following manner: dim(red) 23688 164 a=red[1:23688,1:4] b=red[1:23688,5:8] c=red[1:23688,9:12] .. .. z=red[1:23688,161:164] If there any efficient way to do

Re: [R] Minimum and blanks

2009-10-02 Thread Chris Li
Thanks Joris and Peter. Sorry for not giving enough details. I have tried your suggestions and the problem is solved. Thank you. :) JorisMeys wrote: The minimum of a character vector is returned according to the unicode or ascii code values, but I guess that's not what Chris is looking

[R] What did I do wrong? Bootstrap with glm

2009-10-02 Thread Chunhao Tu
Hi R users, I just play with a small data set (from SAS) by using the boot with glm. But I don't know what I did wrong. Would someone please give me a hint? require(boot) carc-read.table(file=C:\\Documents and Settings\\admin\\Desktop\\drug.txt,header=T) carc n cc car age 1 500 42 S

Re: [R] changing number of axis

2009-10-02 Thread Dan Kortschak
Thanks for that again. That almost works, except that lines are drawn between non-empty bins (in various degrees of diagonality), so absent points (important here) don't show clearly. It's not a huge issue, so I might leave it, unless there is a simple way around this. cheers Dan On Tue,

[R] plot ᵒ C in graph axis label

2009-10-02 Thread e-letter
Readers, I have tried to use a plotmath command to add the temperature degree sign (i.e. ᵒ C) to the axis label of a graph: x-(1:10) y-(200:191) plot(x~y,ylab=expression(*degree~C)) Error: syntax error, unexpected '*', expecting ',' in plot(x~y,ylab=expression(* According to plotmath manual,

Re: [R] Compress (gzip) a pdf device

2009-10-02 Thread Rainer M Krug
On Thu, Oct 1, 2009 at 7:26 PM, Martin Renner martin.ren...@stonebow.otago.ac.nz wrote: try pdftk. Not quite on the fly but should do the trick. (I saw this on this list a little while ago) pdftk compresses the pdf internally - it is still a pdf, can be opened as a pdf, and is not an

Re: [R] plot ᵒ C in graph axis label

2009-10-02 Thread baptiste auguie
Hi, You cannot start with a * in expression(). Try this, plot(x~y,ylab=expression(~degree~C)) or even, as a short-cut, plot(x~y,ylab=~degree~C) HTH, baptiste 2009/10/2 e-letter inp...@gmail.com: Readers, I have tried to use a plotmath command to add the temperature degree sign (i.e. ᵒ

Re: [R] Compress (gzip) a pdf device

2009-10-02 Thread Gábor Csárdi
Rainer, if you are willing to patch the R source, then a solution might be the R connection patch, see http://wiki.r-project.org/rwiki/doku.php?id=developers:r_connections_api It is a bit outdated, but with a little work I could use it for R 2.9.2 and works fine. Best, Gabor On Fri, Oct 2, 2009

[R] Robust ANOVA with variance heterogeneity

2009-10-02 Thread Maike Luhmann
Dear list members, I am looking for an alternative function for a two-way ANOVA in the case of variance heterogeneity. For one-way ANOVA, I found oneway.test(), but I didn't find anything alike for two-way ANOVA. Does anyone have a suggestion? Thank you! Maike Luhmann Freie Universität Berlin

Re: [R] Compress (gzip) a pdf device

2009-10-02 Thread Rainer M Krug
On Fri, Oct 2, 2009 at 9:02 AM, Gábor Csárdi csa...@rmki.kfki.hu wrote: Rainer, if you are willing to patch the R source, then a solution might be the R connection patch, see http://wiki.r-project.org/rwiki/doku.php?id=developers:r_connections_api It is a bit outdated, but with a little

[R] nls not accepting control parameter?

2009-10-02 Thread Rainer M Krug
Hi I want to change a control parameter for an nls () as I am getting an error message step factor 0.000488281 reduced below 'minFactor' of 0.000976562. Despite all tries, it seems that the control parameter of the nls, does not seem to get handed down to the function itself, or the error

[R] plot scale

2009-10-02 Thread Ben Kenward
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 smaller number of

Re: [R] Unable to install lme4

2009-10-02 Thread Patrick Connolly
On Thu, 01-Oct-2009 at 10:13AM -0700, jamesmcc wrote: | | This is the first time I've encountered R having difficulty with package and | R version compatibility. I cant believe no one has fixed generally so that | your version of R can get the latest package appropriate to that version. | How

Re: [R] plot ᵒ C in graph axis label

2009-10-02 Thread Duncan Mackay
Hi If you use a Microsoft OS and you just want to do a °C in the text there is the alternative of using ASCII Just press the keys Alt-248. Have used it for a number of years with success. Also applies to other characters and without having to go to plotmath etc You just need to be careful of

[R] Problem with dist (bug?)

2009-10-02 Thread Corrado
Dear list, using package proxy. In one situation, the dissimilarity between two vectors based on method=correlation returns a value of 1.9. That should not happen, should it? The correlation is normally the cos() of the angle between the two vectors That dissimilarity Any clue?

Re: [R] How to use Subpopulation data?

2009-10-02 Thread Bernardo Rangel Tura
On Fri, 2009-10-02 at 00:42 +, KABELI MEFANE wrote: Thanks But it seems like you don't get my problem.Do you mean that there is something wrong with the code as it seems like what you are doing is suggesting different ways to write a code. Will i get to use the variable that have

Re: [R] Normal distribution

2009-10-02 Thread Colin Millar
A quick google on 'normality test' (no quotes) gives http://en.wikipedia.org/wiki/Normality_test. This gives you a few more tests than the KS test. Cheers, Colin. Steve Lianoglou wrote: Hi, I think you can also use a qq-plot to do the same, no? You won't get a statistic score + p.value,

Re: [R] plot scale

2009-10-02 Thread Duncan Murdoch
On 02/10/2009 4:07 AM, Ben Kenward wrote: 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

Re: [R] plot scale

2009-10-02 Thread Ben Kenward
On Fri, Oct 2, 2009 at 11:10 AM, Duncan Murdoch murd...@stats.uwo.ca wrote: I don't think there's a simple way to specify the exact relationship, but you can do it with some work. Thanks Duncan. That's what I was beginning to suspect, nice to have confirmation, even if it will mean a bit of

Re: [R] plot scale

2009-10-02 Thread baptiste auguie
Hi, It looks like lattice or ggplot2 might make this easier, but I'm not entirely sure I understood the problem, short of an example. Best, baptiste 2009/10/2 Duncan Murdoch murd...@stats.uwo.ca: On 02/10/2009 4:07 AM, Ben Kenward wrote: Hi, Is there a way to set the scale of a plot (i.e.

Re: [R] removing missing values from a matrix

2009-10-02 Thread jim holtman
Here is one way to do it. BTW 'a'-'z' won't work because there are 41 splits. Use a list instead: red - matrix(seq(23688 * 164), nrow=23688, ncol=164) # create indices indx - split(1:164, cut(1:164, 41)) # now split matrix newMatrix - lapply(indx, function(x) red[, x]) str(newMatrix)

Re: [R] aproximate a titration kurve to the measure data.

2009-10-02 Thread Bernardo Rangel Tura
On Thu, 2009-10-01 at 10:18 -0700, awayguy wrote: yes, halo thank you. my measure data: v2 - c(0, 2, 4, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 10, 12, 14) ph2 - c(12.10, 11.94, 11.68, 11.11, 10.91, 10.74, 10.47, 9.71, 7.1, 4.24, 3.3, 3.08, 2.98, 2.86, 2.33, 2.11, 1.98) with

Re: [R] removing missing values from a matrix

2009-10-02 Thread Amit Kumar
Thanks! Jim It solved my problem. Best Amit On Fri, Oct 2, 2009 at 11:19 AM, jim holtman jholt...@gmail.com wrote: Here is one way to do it.  BTW 'a'-'z' won't work because there are 41 splits.  Use a list instead: red - matrix(seq(23688 * 164), nrow=23688, ncol=164) # create indices indx

Re: [R] split-apply question

2009-10-02 Thread jim holtman
try this: x - read.table(textConnection(x1 x2 x3 + A 11.5 + B 20.9 + B 32.7 + C 71.8 + D 71.3), header=TRUE) closeAllConnections() do.call(rbind, lapply(split(seq(nrow(x)), x$x1), function(.row){ + x[.row[which.min(x$x2[.row])],] + })) x1 x2 x3 A A 1

[R] problems with kzft

2009-10-02 Thread Markus Häge
Hello there after I became familiar with R and Design of Experiments, I tried to make a fourier transform with kzft but failed. I don't understand kzft.pdf right. I tried: t-1:1000 x-cos(2*pi*(1/100)*t) kzft.x1-kzft(x,200,1,0.005) x1-2*Re(kzft.x1$tf[,2]) //Is it Re because it's complex? What

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

2009-10-02 Thread J Chen
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 break up abcdefghijkl into abc, def, ghi, jkl I tried a couple of commands but was not successful. Any help will be appreciated. Best, Jimmy -- View this

[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, col3.2.3, col4.2.3,

[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] 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 %

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 jiaxuan.c...@mdc-berlin.de wrote: dear all, I have

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

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] 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 pengyu...@gmail.com 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] 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 jiaxuan.c...@mdc-berlin.de 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,

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 ggrothendi...@gmail.com wrote: Try this: library(gsubfn) s - abcdefghijkl

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 inp...@gmail.com: Readers, I am unable to plot a label consisting of both subscript text and percentage (%) symbol: x-(1:10) y-(200:191)

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.questtxt.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 dom3.rig2.col3

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 brag...@poleis.eu wrote: Hello * i have to rename a lot of variables, and, given that they have regular name constructs, I would

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 = ) strapply(s,

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 x3

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 an

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 kavitha.venkate...@gmail.com 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

[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] 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), new.arg)

[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

Re: [R] split-apply question

2009-10-02 Thread hadley wickham
On Fri, Oct 2, 2009 at 4:24 AM, jim holtman jholt...@gmail.com 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),

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 should

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

[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

Re: [R] Legend

2009-10-02 Thread Gábor Csárdi
On Fri, Oct 2, 2009 at 3:46 PM, Ashta sewa...@gmail.com 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()

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] 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 ct...@york.ac.uk wrote: You can try using RODBC, it allows you to connect to databases using the ODBC driver. I had some difficulties using it

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 smith...@yahoo.com wrote: I am unable to calculate confidence intervals for the slope estimate in a quasibinomial glm using confint(). Below is the output and

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,

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

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 these

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

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

[R] How to select a subset number of dimensions matter

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

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

Re: [R] How to select a subset number of dimensions matter

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] 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 length

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

Re: [R] Robust ANOVA with variance heterogeneity

2009-10-02 Thread Kjetil Halvorsen
On Fri, Oct 2, 2009 at 8:45 AM, David Winsemius dwinsem...@comcast.net 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.

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

[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

[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]

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

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 FMH
Thank you for your answer. I'm using Win XP with 2GB RAM in memory. Cheers Fir - Original Message From: stephen sefick ssef...@gmail.com To: FMH kagba2...@yahoo.com 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?

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:

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 kagba2...@yahoo.com wrote: Thank you for your answer. I'm using Win XP with 2GB RAM in memory. Cheers Fir

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

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 ggrothendi...@gmail.com To: FMH kagba2...@yahoo.com Cc: stephen sefick ssef...@gmail.com; Sent: Fri, October 2, 2009 4:50:52 PM Subject: Re:

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 kagba2...@yahoo.com wrote: Yes, i noticed there are few Windows start up programs, shown by the EasyCleaner

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 __

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 ggrothendi...@gmail.com wrote: That part wasn't specified so we can't say what the required

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

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

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 2, 2009

[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] 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 values

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

[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

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 smaller

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

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] 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 them?

[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

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

[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 -

[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] 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: Warning:

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 =

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

[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

[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

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 groemp...@bht-berlin.de: Hello Primoz, with traditional graphics, you may want to use par (?par), options like mar, mai,

[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'

  1   2   >