[R] Registry problem when loading RMySQL

2008-12-09 Thread Gerald van der Grijn
Hi all, I am exploring the possibility of using R in my meteorological verification project. I have installed R on my Windows (XP) desktop machine and have also installed the RMySQL and verification packages. However, I run into problems when I try to load RMySQL. I get the following error:

Re: [R] Logical inconsistency

2008-12-09 Thread Mark Difford
And here one is very much inclined to chirp in and say, "A matchless Wacek strikes again." Regards, and thanks to all for a most entertaining (and enlightening) thread. Wacek Kusnierczyk wrote: > > Patrick Connolly wrote: >> On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote: >> >>

Re: [R] problem with Vista

2008-12-09 Thread Peter Dalgaard
vincenzo landi wrote: Hello, I want to import a txt table into R but the software give me this message. I have windows vista. Errore in file(file, "r") : cannot open this connection Besides: Warning message: In file(file, "r") : Â cannot open file 'C:/Users/Vincenzo/Desktop/prova/prova.txt': N

[R] Odp: problem with Vista

2008-12-09 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 09.12.2008 11:10:49: > Hello, > I want to import a txt table into R but the software give me this message. I > have windows vista. > > > Errore in file(file, "r") : cannot open this connection > Besides: Warning message: > In file(file, "r") : > Â cannot open f

Re: [R] Significance of slopes

2008-12-09 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 09.12.2008 23:21:17: > Hi Christian, > please give always reproducible code, > so we can see what have done > and give you the best answer. > > lm function, generally > as in this example form lm man page ( ?lm) > > > > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83

Re: [R] bayesm package not downloading via any mirror or repository

2008-12-09 Thread Prof Brian Ripley
On Tue, 9 Dec 2008, ekwaters wrote: OK still no luck, when, as you say it is clear that the package IS available. It really doesn't seem to matter what mirror I use and they can't all be down. I can install other packages such as LearnBayes, VCD etc with no issues, so can't be blocked at my end

Re: [R] R and Scheme

2008-12-09 Thread Peter Dalgaard
Johannes Huesing wrote: Stavros Macrakis <[EMAIL PROTECTED]> [Wed, Dec 10, 2008 at 04:59:25AM CET]: So I conclude that what is really meant by "R semantics are based on Scheme semantics" is "R has functions as first-class citizens and a correct implementation of lexical scope, including upwards

Re: [R] == operand

2008-12-09 Thread Ben Bolker
Renny Li wrote: > > Hi, >   > I am trying to compare two values using "==" operand, please take a look > of the following example (I copied ALL what I did here without deleting > any line) >   >>    bb<-1 >> cc<-50 >> cc==abs(bb+52) > [1] FALSE >> C<-53 >> C<-53 >> c<-53 >> cc==abs(bb+52) > [1]

Re: [R] R and Scheme

2008-12-09 Thread Johannes Huesing
Stavros Macrakis <[EMAIL PROTECTED]> [Wed, Dec 10, 2008 at 04:59:25AM CET]: > So I conclude that what is really meant by "R semantics are based on Scheme > semantics" is "R has functions as first-class citizens and a correct > implementation of lexical scope, including upwards funarg". > One othe

[R] recursive term

2008-12-09 Thread Roslina Zakaria
Hi,   I would like to write a function for this formula: F(a,b,c,z)=1+(ab)/(1!c)+ +(a(a+1)b(b+1))/(2!c(c+1))+ +(a(a+1)(a+2)b(b+1)(b+2))/(3!c(c+1)(c+2))+…   I wrote this function but not sure what is not right:   hypergeo_sum <- function (a,b,c,z,n) { for (i in 1:n)   { aa <- 1+(a*b*z)/c   aa[i] <

Re: [R] subset point data set by distance ranges

2008-12-09 Thread Charles C. Berry
On Tue, 9 Dec 2008, David M Warner wrote: Greetings I'm using R 2.8 with recent (last month) versions of the packages I need to use at present. I'm interested in examining hierarchical spatio-temporal patterns in a data set. The data consist of 94 points (X, Y, UTM coordinates) at

Re: [R] Better way to find distances between points in a set?

2008-12-09 Thread Charles C. Berry
The 'better way' to do almost anything starts with a reading of the _posting guide_, which reminds you to Do your homework before posting [Reasons whyfor deleted]] * Do help.search("keyword") and apropos("keyword") with different keywords (type thi

Re: [R] exporting rast from R to GRASS

2008-12-09 Thread Dylan Beaudette
On Tue, Dec 9, 2008 at 6:03 PM, Thybério Luna Freire <[EMAIL PROTECTED]> wrote: > Hi, everybody! > i created a imagem by kriging using geoR package. I imported points > from GRASS("zn", after converted to geodata "zn_geo"), the border > "zn_border" and a raster mask. Then i interpolated the points

Re: [R] How can I draw bars

2008-12-09 Thread Steven McKinney
Hi Raymond, You might be able to get the plots you want with the 'cytoband' material provided in the Bioconductor package "SNPchip". Check out the SNPchip data set 'cytoband' and the plot function "plotCytoband" for ideas. This material is used e.g. in Bioconductor package "VanillaICE" to add a

Re: [R] R and Scheme

2008-12-09 Thread Stavros Macrakis
Thanks for the various thoughtful replies to my post "R and Scheme", where I wondered what exactly people meant when they said that R semantics were based on Scheme semantics. R clearly has Scheme-like semantics for its function objects, which are first-class objects and correctly implement static

Re: [R] How can I draw bars

2008-12-09 Thread stephen sefick
arrows and I don't remember what package, but I will see if I can remember. On Tue, Dec 9, 2008 at 3:02 PM, Raymond Balise <[EMAIL PROTECTED]> wrote: > I need to make a graphic to show problems on different parts of > chromosomes (think of a graphic showing the number of frayed threads > as colors

Re: [R] RCurl::postForm() -- how does one determine what the names are of each form element in an online html form?

2008-12-09 Thread Felix Andrews
2008/12/10 Tony Breyal <[EMAIL PROTECTED]>: > Dear R-Help, > > I am looking into using the Open Calais web service (http:// > sws.clearforest.com/calaisViewer/) for text mining purposes. I would > like to use R to post text into one of the forms on their website. > > In package RCurl, there is a fu

Re: [R] ARMA

2008-12-09 Thread Gad Abraham
Raphael Saldanha wrote: Hi! Is there any package or function on R to ARMA models (Box & Jenkins, without sazonality and trend) with resources to automatic identification for p and q ? Have a look at auto.arima() from the forecast package http://cran.ms.unimelb.edu.au/web/packages/forecasting/

[R] subset point data set by distance ranges

2008-12-09 Thread David M Warner
Greetings I'm using R 2.8 with recent (last month) versions of the packages I need to use at present. I'm interested in examining hierarchical spatio-temporal patterns in a data set. The data consist of 94 points (X, Y, UTM coordinates) at which catch rates for a fish were

[R] exporting rast from R to GRASS

2008-12-09 Thread Thybério Luna Freire
Hi, everybody! i created a imagem by kriging using geoR package. I imported points from GRASS("zn", after converted to geodata "zn_geo"), the border "zn_border" and a raster mask. Then i interpolated the points by kriging and created a raster image. Now, i need export this image back to GRASS to u

Re: [R] expected variable name error pos 98349 WInBUGS in R

2008-12-09 Thread Anamika Chaudhuri
I did run the same model in WinBUGS, letting WinBUGS generate initials but now it gives me the error 'data value already given to this quantitiy' using a sample dataset and the cursor blinks in the highlighted section. list(NAUSEA=c(1,0,0,0,0,1,1,1,0,1,1,0),SITEID=c(1,1,1,1,1,1,2,2,2,2,2,2), n.sit

Re: [R] calculating large factorials

2008-12-09 Thread Gabor Grothendieck
Use lfactorial to calculate log factorial. On Tue, Dec 9, 2008 at 7:55 PM, <[EMAIL PROTECTED]> wrote: > > > Hi > I was wondering if there is a way to compute factorials >170 in R i have a > formula including factorials of nearly 1 i know in python and i think c++ > there is a big number libra

[R] calculating large factorials

2008-12-09 Thread rfulton
Hi I was wondering if there is a way to compute factorials >170 in R i have a formula including factorials of nearly 1 i know in python and i think c++ there is a big number library is there something like this in R? Thanks - The University of Glasgow, charity number SC004401 __

Re: [R] Error: protect () : protection stack overflow

2008-12-09 Thread Bert Gunter
Apparently the former, as I got the same error in R2.7.1 on Windows. Matbe relevant info(?): $platform [1] "i386-pc-mingw32" $arch [1] "i386" $os [1] "mingw32" $system [1] "i386, mingw32" -- Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf

Re: [R] Power calculations where two samples are of unequal size

2008-12-09 Thread Chuck Cleland
On 12/9/2008 6:32 PM, Farrel Buchinsky wrote: > I have used the function power.t.test() (power calculations for one > and two sample t tests) but have noted that it handles the samples as > being the same size. How does one handle sample sizes that are > different. In other words how does one handl

Re: [R] == operand

2008-12-09 Thread Gustavo Carvalho
Hello, You assigned 53 to c, not cc. Also, take a look at this: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f On Tue, Dec 9, 2008 at 9:36 PM, Renny Li <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to compare two values using "==" operand, p

Re: [R] == operand

2008-12-09 Thread hadley wickham
On Tue, Dec 9, 2008 at 5:36 PM, Renny Li <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to compare two values using "==" operand, please take a look of > the following example (I copied ALL what I did here without deleting any line) > >>bb<-1 >> cc<-50 >> cc==abs(bb+52) > [1] FALSE >> C<-53

Re: [R] bayesm package not downloading via any mirror or repository

2008-12-09 Thread ekwaters
OK still no luck, when, as you say it is clear that the package IS available. It really doesn't seem to matter what mirror I use and they can't all be down. I can install other packages such as LearnBayes, VCD etc with no issues, so can't be blocked at my end. My latest output: > install.package

[R] Error: protect () : protection stack overflow

2008-12-09 Thread Bricklemyer, Ross S
I am attempting to create a formula using as.formula for a PLS analysis. I have used the code below successfully, but in a previous R version and with many fewer predictors. Any help getting all of these predictors into one formula would be greatly appreciated. TC.fmla <- as.formula(paste("TC

Re: [R] Transforming a string to a variable's name? help me newbie...

2008-12-09 Thread tsunhin wong
Thank you all! :) Can I "walk through" the my.data structure without knowing the name of particular dataframe in it? Such as: for(i in 1:length(my.data)) myprocess(my.data[i]) ? If it is possible, then this is going to save the work of using paste(). Thanks! On Tue, Dec 9, 2008 at 6:45 PM, Anton

Re: [R] Transforming a string to a variable's name? help me newbie...

2008-12-09 Thread Antonio, Fabio Di Narzo
> names(my.data) gives you the vector of 'names' of the list, which should be a good, compact overview of the list contents. > str(my.data) gives also streamlined information about each component of the list, i.e. also what variables are there (names and types), how many observations, etc. To disse

[R] Better way to find distances between points in a set?

2008-12-09 Thread Carl Witthoft
I was playing around a bit to see how I could find the two points in a set of points (or ordered pairs) furthest from each other. Here's what I did: 1) created a Nrow by 2col matrix, so each row contains an x,y coordinate pair. 2) fed the matrix to a nested mapply (cv is my matrix): mapply(

[R] == operand

2008-12-09 Thread Renny Li
Hi,   I am trying to compare two values using "==" operand, please take a look of the following example (I copied ALL what I did here without deleting any line)   >    bb<-1 > cc<-50 > cc==abs(bb+52) [1] FALSE > C<-53 > C<-53 > c<-53 > cc==abs(bb+52) [1] FALSE      I am expecting to see a

Re: [R] Polar coordinates - contour plots

2008-12-09 Thread Bert Gunter
I believe the latter for base R, as the standard contour plotting depends on internal (fortran, I think) code that works only for rectangular coordinates.Should be only a few lines of fiddling though (exercise left to reader). Try RSiteSearch("polar coordinates", restr="func") to see what mig

Re: [R] Power calculations where two samples are of unequal size

2008-12-09 Thread Stephan Kolassa
Hi Farrel, I usually simulate in cases like this - pick the effect size and distributions you conjecture, simulate your data 10,000 times and look how often t.test() gets you a significant difference. Good luck, Stephan Farrel Buchinsky schrieb: I have used the function power.t.test() (powe

Re: [R] French IRC channel and mailing list ?

2008-12-09 Thread Julien Barnier
Hi Baptiste, > In my personal opinion, I see little overall benefit from such an > approach. For one thing, a major strength of the R mailing list is the > large number of very knowledgeable persons. A mailing list with only a > few 10s of users will never provide as good a support as you can find

[R] Power calculations where two samples are of unequal size

2008-12-09 Thread Farrel Buchinsky
I have used the function power.t.test() (power calculations for one and two sample t tests) but have noted that it handles the samples as being the same size. How does one handle sample sizes that are different. In other words how does one handle unbalanced designs. Farrel Buchinsky _

Re: [R] Transforming a string to a variable's name? help me newbie...

2008-12-09 Thread tsunhin wong
I did really want to find make the suggestion work... it is going to save my time... I worked on trying to put all dataframes into a list() by: ###start of file rm(list=ls()) setwd("/Users/John/Programs/R") load("Expt108Master2008.Rdata") nms <- ls(pattern=".data") my.data <- list() for(i in nms)

[R] Polar coordinates - contour plots

2008-12-09 Thread Todor Kondic
Hello, I have data for contour plot which is given in polar coordinates. Is there a straightforward way to plot in polar coordinates in R, or do i need to fiddle with transformations and then to sort the x and y vectors to be in ascending order as required by contour function and relatives? Cheer

[R] Help with subtitle for Barplot

2008-12-09 Thread Li, Shaorong
<> <> <> I attached the R code, data and plot. I am wondering why I couldn't get subtitle showing up under each plot even though I didn't get any error message. Thanks for help in advance, Shaorong Sample NKa1b_2 NKa1c_2 NKAa3_2 NKAb1_1 Group 1556-0.14928982 -0.146699076-0.022

Re: [R] Transforming a string to a variable's name? help me newbie...

2008-12-09 Thread tsunhin wong
Greg, I found your suggestion very efficient! And I tried testing it, however, it didn't work: ###start of file rm(list=ls()) setwd("/Users/John/Documents/Research/Experiments/expt108/") ##test out 3 files only nms <- c("019-v1-msa1.data","019-v1-msa2.data","019-v1-msa3.data") my.data <- list()

[R] controlling axes in plot.cuminc (cmprsk library)

2008-12-09 Thread Amy Krambrink
Dear R-help list members, I am trying to create my own axes when plotting a cumulative incidence curve using the plot.cuminc function in the CMPRSK library. The default x-axis places tick marks and labels at 0, 20, 40, 60, and 80 (my data has an upper limit of 96), whereas I want them at my ow

Re: [R] Significance of slopes

2008-12-09 Thread anna freni sterrantino
Hi Christian, please give always reproducible code, so we can see what have done and give you the best answer. lm function, generally as in this example form lm man page ( ?lm) > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) >ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.3

Re: [R] Significance of slopes

2008-12-09 Thread anna freni sterrantino
Hi Christian, please give always reproducible code, so we can see what have done and give you the best answer. lm function, generally as in this example form lm man page ( ?lm) > trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) >ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.3

Re: [R] glm error message when using family Gamma(link="inverse")

2008-12-09 Thread Charles C. Berry
On Tue, 9 Dec 2008, John Sorkin wrote: It appears that I have sinned and for this I surely will wear sack cloth and grovel until my period of penitence is fulfilled. I update R and my problem remains. Please see code snippet (as per posting guidelines) below R 2.8.0 windows XP summary(data

Re: [R] R Graphics Device margins

2008-12-09 Thread tkeitt
Metcalfe, John wrote: > > Hello, > I am relatively new to R and am using it to run Classification and > Regression Tree analysis. My only issue at this point is that numbers are > always cut off on the lower nodes. I've tried changing the margins with > > mai=c(0, 0.5, 0.5, 0) but this has no

[R] assign()ing within apply

2008-12-09 Thread Thompson, David (MNR)
Hello, I'm trying to convert a character column in several dataframes to lower case. ### # # Sample data and 'spp' column summaries: # dput(ban.ovs.1993[sample(row.names(ban.ovs.1993), 20), 1:4]) ban.ovs.93 <- structure(list(oplt = c(43L, 43L, 38L, 26L, 35L, 8L, 39L, 1L, 34L, 50L, 10L, 29L, 31L,

[R] Significance of slopes

2008-12-09 Thread Christian Arnold
Hello R community, I have a question regarding correlation and regression analysis. I have two variables, x and y. Both have a standard deviation of 1; thus, correlation and slope from the linear regression (which also must have an intercept of zero) are equal. I want to probe two particular

Re: [R] Can elastic net do binary classification?

2008-12-09 Thread Max Kuhn
There are at least two options. There is the sparseLDA package that was written by the author of "Sparse Discriminant Analysis". The paper can be found at http://www-stat.stanford.edu/~hastie/Papers/sda_line.pdf The initial version of the package is here: http://www2.imm.dtu.dk/pubdb/views/

Re: [R] Logical inconsistency

2008-12-09 Thread Wacek Kusnierczyk
Patrick Connolly wrote: > On Mon, 08-Dec-2008 at 02:05AM +0800, Berwin A Turlach wrote: > > |> G'day Wacek, > |> > |> On Sat, 06 Dec 2008 10:49:24 +0100 > |> Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > |> > |> [] > |> > >> there is, in principle, no problem in having a high-level language

Re: [R] glm error message when using family Gamma(link="inverse")

2008-12-09 Thread John Sorkin
It appears that I have sinned and for this I surely will wear sack cloth and grovel until my period of penitence is fulfilled. I update R and my problem remains. Please see code snippet (as per posting guidelines) below R 2.8.0 windows XP > summary(data$AAMTCAREJ) Min. 1st Qu. Median

Re: [R] How to get Greenhouse-Geisser epsilons from anova?

2008-12-09 Thread Peter Dalgaard
Skotara wrote: Dear John and Peter, thank you both very much for your help! Everything works fine now! John, Anova also works very fine. Thank you very much! However, if I had more than 2 levels for the between factor the same thing as mentioned occured. The degrees of freedom showed that Anov

[R] How can I draw bars

2008-12-09 Thread Raymond Balise
I need to make a graphic to show problems on different parts of chromosomes (think of a graphic showing the number of frayed threads as colors along different parts of a worn out rope). I want to draw bars going from left to right across a page and color different parts of the bars in different sh

Re: [R] R and Scheme

2008-12-09 Thread Wacek Kusnierczyk
Luke Tierney wrote: > On Tue, 9 Dec 2008, Wacek Kusnierczyk wrote: > >> Stavros Macrakis wrote: >>> >>> R does not have continuations or call-with-current-continuation or >>> other >>> mechanisms for implementing coroutines, general iterators, and the >>> like. >>> >> >> there is callCC, for exampl

Re: [R] chron - when seconds data not included

2008-12-09 Thread Tubin
Works like a charm! Thanks. Gabor Grothendieck wrote: > > On Mon, Dec 8, 2008 at 11:52 PM, Tubin <[EMAIL PROTECTED]> wrote: >> >> I have date and time data which looks like this: >> >> [,1] [,2] >> [1,] "7/1/08" "9:19" >> [2,] "7/1/08" "9:58" >> [3,] "7/7/08" "15:47" >> [4,] "7/8/

[R] TIFF capability in R 2.8.0

2008-12-09 Thread Michael Rhead Enion
Hi, I installed R 2.8.0 (binary - dmg) for Mac 10.5.5 (Macbook Pro). It seems to have broken tiff output. From the R console, capabilities() reports TIFF is not installed. And when I run CairoTIFF(), it throws an error -- TIFF not compiled. CarioTIFF() worked in R 2.7.2. Is this a bug

[R] RCurl::postForm() -- how does one determine what the names are of each form element in an online html form?

2008-12-09 Thread Tony Breyal
Dear R-Help, I am looking into using the Open Calais web service (http:// sws.clearforest.com/calaisViewer/) for text mining purposes. I would like to use R to post text into one of the forms on their website. In package RCurl, there is a function called postForm(). This sounds like it would do t

Re: [R] opening multiple connections at once

2008-12-09 Thread Rout, Subrat
Best Regards, Subrat Rout CNSI, Gaithers Dr. (240) 399 2472 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] How to get Greenhouse-Geisser epsilons from anova?

2008-12-09 Thread John Fox
Dear Nils, > -Original Message- > From: Skotara [mailto:[EMAIL PROTECTED] > Sent: December-09-08 12:21 PM > To: John Fox > Cc: 'Peter Dalgaard'; r-help@r-project.org > Subject: Re: [R] How to get Greenhouse-Geisser epsilons from anova? > > Dear John and Peter, > > thank you both very muc

Re: [R] difftime

2008-12-09 Thread Gabor Grothendieck
I guess its the same problem as this (run after your code): > as.POSIXct(a, tz = "") [1] NA > as.POSIXct(b, tz = "") [1] NA > difftime(b, a, units="days") Time difference of NA days If you explicitly specify the tz as "GMT" then it works as expected: > as.POSIXct(a, tz = "GMT") [1] "1999-10-08 0

Re: [R] glm error message when using family Gamma(link="inverse")

2008-12-09 Thread Prof Brian Ripley
On Tue, 9 Dec 2008, John Sorkin wrote: R 2.5 Please 1) do as the posting guide asks, and quote version numbers accurately. 2) do as the posting guide asks, and update *before* posting. That's too old a version to support here. windows XP I am getting an error from glm() that I don't under

Re: [R] French IRC channel and mailing list ?

2008-12-09 Thread baptiste auguie
A few personal thoughts on this: I recently joined a newly created R user group on google < http://groups.google.co.uk/group/gur-ugr > that started with a similar impulse. In my personal opinion, I see little overall benefit from such an approach. For one thing, a major strength of the R ma

Re: [R] Replacing tabs with appropriate number of spaces

2008-12-09 Thread Gabor Grothendieck
That's a clever use of gsubfn. Here is a very minor simplification using the same code but representing it in formula notation and sprintf: gsubfn('([^\t]+)\t', ~ sprintf("%s%*s", x, 8-nchar(x)%%8, " "), tmp) On Tue, Dec 9, 2008 at 12:51 PM, Greg Snow <[EMAIL PROTECTED]> wrote: > This is basica

[R] glm error message when using family Gamma(link="inverse")

2008-12-09 Thread John Sorkin
R 2.5 windows XP I am getting an error from glm() that I don't understand. Any help or suggestions would be appreciated. N.B. 1<=AAMTCAREJ<=327900 > summary(data$AAMTCAREJ) Min. 1st Qu. Median Mean 3rd Qu. Max. 1.0404.3 1430.0 6567.0 5457.0 327900.0 > fitglm<-g

Re: [R] Need help optimizing/vectorizing nested loops

2008-12-09 Thread tyler
Charles C. Berry writes: > On Tue, 9 Dec 2008, tyler wrote: > > > I'm analyzing a large number of large simulation datasets, and I've > > isolated one of the bottlenecks. Any help in speeding it up would be > > appreciated. > > Cast the neighborhoods as an indicator matrix, then use matrix

Re: [R] extract the digits of a number

2008-12-09 Thread Gabor Grothendieck
Actually what you have is not so bad. Here is a variation which has one fewer nested (...) > as.numeric(strsplit(as.character(mynumber),"")[[1]]) [1] 1 0 0 1 > # or > # Try strapply in gsubfn: > library(gsubfn) > mynmber <- 1001 > strapply(as.character(mynumber), ".", as.numeric)[[1]] [1] 1 0 0

Re: [R] R Graphics Device margins

2008-12-09 Thread Prof Brian Ripley
Without the reproducible example asked for it is hard to tell, but ?text.rpart did say ...: Graphical parameters may also be supplied as arguments to this function (see 'par'). As labels often extend outside the plot region it can be helpful to specify 'xpd = TRUE'. Mig

Re: [R] package plm

2008-12-09 Thread Giovanni Petris
If nobody answered to your question before, you probably have to formulate it differently, trying to give some context and possibly providing a small example, as requested by the posting guides. Resending your question unchanged multiple times is not going to help. Questions about contributed pac

Re: [R] difftime

2008-12-09 Thread Prof Brian Ripley
In the absence of any of the information requested in the posting guide, all we can say is that this works for other people (e.g. on both Mac OS X and Fedora 8 for me). Apart from the usual info, we would need to know your timezone. On Tue, 9 Dec 2008, eric lee wrote: Hi. I'm trying to take

Re: [R] no implicit call of the print function within loops?

2008-12-09 Thread Greg Snow
The general rule is that when you type something at the command line and that something returns a value, if you do not tell it what to do with the value, and the value has not been made invisible, then the value is printed. If you do: > tmp <- eval(exp) You will not see the output printed sinc

[R] package plm

2008-12-09 Thread Andrea Ferroni
Dear R help, I use the package plm e the function plm() to analyse a panel data and estimate a dynamic model. Can I estimate a model without intercept? Thanks, Andrea Ferroni __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Can elastic net do binary classification?

2008-12-09 Thread Jack Luo
Hi, List The elastic net package (by Hastie and Zou at Stanford) is used to do regularization and variable selection, it can also do regression. I am wondering if it can perform binary classification (discrete outcome). Anybody having similar experience? Many thanks, -Jack [[alternative

Re: [R] Re sampling with index

2008-12-09 Thread Henrique Dallazuanna
Try this: x[x$ind %in% sample(x$ind, 3),] On Tue, Dec 9, 2008 at 3:19 PM, legendy <[EMAIL PROTECTED]> wrote: > > Hallo, All, > > I have a question needs your help. > I just want get a sample with the original index. For example, I have a > dataset, > > ind x > 139 > 224 > 315 > 4

Re: [R] extract the digits of a number

2008-12-09 Thread Greg Snow
I don't know if this is cleaner or not, but here is another way: > mynumber <- 1001 > floor( mynumber/(10^(nchar(mynumber):1 -1))) %% 10 [1] 1 0 0 1 > mynumber <- 12345678 > floor( mynumber/(10^(nchar(mynumber):1 -1))) %% 10 [1] 1 2 3 4 5 6 7 8 > mynumber <- 9753086421 > floor( mynumber/(10^(nchar

Re: [R] extract the digits of a number

2008-12-09 Thread Henrique Dallazuanna
Try this also: library(gsubfn) strapply(as.character(mynumber), "[0-9]", simplify = as.numeric) On Tue, Dec 9, 2008 at 3:48 PM, Gustavo Carvalho <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > wrote: > Hello, > > Anyone knows how can I do this in a cleaner way? > > mynumber = 1001 > as.numeric(unlist(st

Re: [R] extract the digits of a number

2008-12-09 Thread Christos Hatzis
An alternative that works for any base (other than 10) is the following: > library(sfsmisc) > digitsBase(1001, 10) Class 'basedInt'(base = 10) [1:1] [,1] [1,]1 [2,]0 [3,]0 [4,]1 -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On

[R] R Graphics Device margins

2008-12-09 Thread Metcalfe, John
Hello, I am relatively new to R and am using it to run Classification and Regression Tree analysis. My only issue at this point is that numbers are always cut off on the lower nodes. I've tried changing the margins with mai=c(0, 0.5, 0.5, 0) but this has not so far worked. Any suggestions woul

[R] XYPLOT Help

2008-12-09 Thread Zhou, James
This may be an easy question for most of you, but any prompt clues/hints/examples would be really appreciated. My dataset includes a various number of records (by time points) for a variable by subject. I use xyplot to plot line/symbol graphs of the variable at each available time point by eac

[R] Re sampling with index

2008-12-09 Thread legendy
Hallo, All, I have a question needs your help. I just want get a sample with the original index. For example, I have a dataset, ind x 139 224 315 475 561 After resample, I want to get a new dataset like this (with the original index) ind x 315 561 139 Thank y

[R] keep function in stepAIC

2008-12-09 Thread Xin Shi
Dear: Does anyone use keep function in stepAIC command? If so, could you give an example? I try to use this function to choose some variables in all of possible models. Many Thanks! Xin [[alternative HTML version deleted]] __ R-he

[R] no implicit call of the print function within loops?

2008-12-09 Thread Mark Heckmann
Dear R-users, I wonder why some functions produce output when they are called (I suppose due to an implicit call of the print function) but within a loop they do not: attach(anscomce) exp <- parse(text= "lm(x1 ~ y1)") eval(exp) Here the print() function seems to be called implicitly. If I do the

Re: [R] Replacing tabs with appropriate number of spaces

2008-12-09 Thread Greg Snow
This is basically your approach, but automated a bit more than you describe: library(gsubfn) tmp <- strsplit('one\ttwo\nthree\tfour\n12345678\t910\na\tbc\tdef\tghi\n','\n')[[1]] tmp2 <- gsubfn('([^\t]+)\t', function(x) { ln <- nchar(x) nsp <- 8-(ln %% 8) sp <- paste( rep(' ', nsp), colla

Re: [R] How to display y-axis labels in Multcomp plot

2008-12-09 Thread Metconnection
Thanks Kingsford... that does the trick perfectly! Simon -- View this message in context: http://www.nabble.com/How-to-display-y-axis-labels-in-Multcomp-plot-tp20904977p20919920.html Sent from the R help mailing list archive at Nabble.com. __ R-help@

Re: [R] difftime

2008-12-09 Thread Henrique Dallazuanna
Perhaps you are getting warning messages from difftime like this: "Warning messages: 1: In structure(.Internal(as.POSIXct(x, tz)), class = c("POSIXt", "POSIXct"), : unable to identify current timezone 'V': please set environment variable 'TZ' 2: In structure(.Internal(as.POSIXct(x, tz)), class

[R] extract the digits of a number

2008-12-09 Thread Gustavo Carvalho
Hello, Anyone knows how can I do this in a cleaner way? mynumber = 1001 as.numeric(unlist(strsplit(as.character(mynumber),""))) [1] 1 0 0 1 Thanks in advance, Gustavo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] Need help optimizing/vectorizing nested loops

2008-12-09 Thread bartjoosen
Hello, how about changing the last loop to an apply? time.test2 <- function(dat) { cen <- dat grps <- 5 n.rich <- numeric(grps^2) n.ind <- 1 for(i in 1:grps) for (j in 1:grps) { n.cen <- numeric(ncol(cen) - 2) neighbours <- expand.grid(X=(j-1):(j+1), Y=(i-1):(i

[R] difftime

2008-12-09 Thread eric lee
Hi. I'm trying to take the difference in days between two times. Can you point out what's wrong, or suggest a different function? When I try the following code, The following code works fine: a <- strptime(1911100807,format="%Y%m%d%H",tz="GMT") b <- strptime(1911102718,format="%Y%m%d%H",tz="GM

Re: [R] Need help optimizing/vectorizing nested loops

2008-12-09 Thread Charles C. Berry
On Tue, 9 Dec 2008, tyler wrote: Hi, I'm analyzing a large number of large simulation datasets, and I've isolated one of the bottlenecks. Any help in speeding it up would be appreciated. Cast the neighborhoods as an indicator matrix, then use matrix multiplications: system.time(tmp <- t

[R] Was Logical inconsistency - algorithm portability

2008-12-09 Thread John C Nash
The "logical inconsistency" thread has wandered a bit and discussion now veers towards portability of algorithms. On that subject, I have off-list been sharing ideas about the existence of functions to ensure optimizing compilers do not corrupt logical tests in numerical methods. Apparently the "vo

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Mark Difford
Hi Frank, >> If anyone knows of better references for this please let me know. Many thanks: I was not aware of the Witten paper. If I turn up anything else I will be sure to let you know. Best Regards, Mark. Frank E Harrell Jr wrote: > > Mark Difford wrote: >> Hi All, >> >> I beg to differ

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Frank E Harrell Jr
Mark Difford wrote: Hi All, I beg to differ with Ravi Varadhan's perspective. While it is true that principal component analysis does not itself do variable selection, it is an important method for pointing the way to what to select. This is what the methods in the subselect package rely on. (On

Re: [R] How to get Greenhouse-Geisser epsilons from anova?

2008-12-09 Thread Skotara
Dear John and Peter, thank you both very much for your help! Everything works fine now! John, Anova also works very fine. Thank you very much! However, if I had more than 2 levels for the between factor the same thing as mentioned occured. The degrees of freedom showed that Anova calculated it

Re: [R] Replacing tabs with appropriate number of spaces

2008-12-09 Thread hadley wickham
On Tue, Dec 9, 2008 at 10:39 AM, Dennis Fisher <[EMAIL PROTECTED]> wrote: > Colleagues, > > Platform: OS X (but issue applies to all platforms) > Version: 2.8.0 > > I have a mixture of text and data that I am outputting via R to a pdf > document (using a fixed-width font). The text contains tabs t

[R] ARMA

2008-12-09 Thread Raphael Saldanha
Hi! Is there any package or function on R to ARMA models (Box & Jenkins, without sazonality and trend) with resources to automatic identification for p and q ? Regards, Raphael Saldanha Brazil [[alternative HTML version deleted]] __ R-help@r-

Re: [R] Bootstrap a GLM model with Poisson family

2008-12-09 Thread Daniel Malter
Hi, if you already have code for the binomial, can you not just replace family=binomial by family=Poisson in the code? Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

Re: [R] Applying min to numeric vectors

2008-12-09 Thread Jorge Ivan Velez
Dear Brigid, Try: pmin(a,b) HTH, Jorge On Tue, Dec 9, 2008 at 11:58 AM, Brigid Mooney <[EMAIL PROTECTED]> wrote: > I was surprised this morning, that it seems as though the min() function > does not work as *I* anticipated when given vector arguments. > > For example: > a <- 1:10 > b <- c(r

Re: [R] Applying min to numeric vectors

2008-12-09 Thread Henrique Dallazuanna
Try this: pmin(a, b) On Tue, Dec 9, 2008 at 2:58 PM, Brigid Mooney <[EMAIL PROTECTED]> wrote: > I was surprised this morning, that it seems as though the min() function > does not work as *I* anticipated when given vector arguments. > > For example: > a <- 1:10 > b <- c(rep(1, times=5), rep(10,

[R] Applying min to numeric vectors

2008-12-09 Thread Brigid Mooney
I was surprised this morning, that it seems as though the min() function does not work as *I* anticipated when given vector arguments. For example: a <- 1:10 b <- c(rep(1, times=5), rep(10, times=5)) Result: > min(a,b) 1 What I actually wanted was a term by term minimum, i.e.: ifelse(a<=b, a, b

[R] Replacing tabs with appropriate number of spaces

2008-12-09 Thread Dennis Fisher
Colleagues, Platform: OS X (but issue applies to all platforms) Version: 2.8.0 I have a mixture of text and data that I am outputting via R to a pdf document (using a fixed-width font). The text contains tabs that align columns properly with a fixed-width font in a terminal window. Howev

[R] [R-pkgs] SFA tools moved from micEcon to frontier

2008-12-09 Thread Arne Henningsen
Dear R users, I would like to inform you that everything of the "micEcon" package that is related to Stochastic Frontier Analysis (SFA) has been moved to the "frontier" package, because this is a more appropriate place for the functions "front41WriteInput", "front41ReadOutput", and "front41Est"

  1   2   >