[R] errors with compilation

2008-12-09 Thread Jason Tan
Hi, i'm trying to compile R on a Cray XT3 using pgi/7.2.1 - CNL (compute node linux) The R version is 2.8.0 this is the option -enable-R-static-lib=yes --disable-R-shlib CPICFLAGS=fpic FPICFLAGS=fpic CXXPICFLAGS=fpic SHLIB_LDFLAGS=shared --with-x=no SHLIB_CXXLDFLAGS=shared --disable-BLAS-shli

Re: [R] errors with compilation

2008-12-09 Thread Prof Brian Ripley
On Tue, 9 Dec 2008, Jason Tan wrote: thanks. i noticed a syntax error. a missing semi colon. Which, as I said, was corrected weeks ago. any idea about the error below? Yes: you need to ensure that dynamic libraries are used on x86_64 Linux. That's something specific to your setup: standar

[R] ANCOVA

2008-12-09 Thread Samuel Okoye
Hello,   Could you please help me in the following question: I have 16 persons 6 take 0.5 mg, 6 take 0.75 mg and 4 take placebo! Can I use the ANCOVA and t-test in this case? Is it possible in R?   Thank you in advance, Samuel [[alternative HTML version deleted]] ___

Re: [R] error from running WinBUGS in R

2008-12-09 Thread Uwe Ligges
Anamika Chaudhuri wrote: Has anyone ever seen an error like this from running WinBUGS in R '> modelCompile(numChains=2) # compile model with 1 chain error for node p[3421] of type GraphLogit.Node node vetor contains undefined elements No, but the error comes from WinBUGS dire

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

2008-12-09 Thread Uwe Ligges
ekwaters wrote: I am a pretty new R user, I am running the latest linux version on xandros, updated with some extra debian packages, and I also run the latest windows version, but prefer linux. I am having trouble downloading "bayesm", it won't do it all from any of the sites on the web, I res

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

2008-12-09 Thread Uwe Ligges
Hard to help without seeing the actual files. Anyway, this is a BUGS question rather than an R question, because the error comes from the BUGS interpreter. Hence wrong mailing list. Best wishes, Uwe Ligges Anamika Chaudhuri wrote: I am using a random intercept model with SITEID as random

Re: [R] R and Scheme

2008-12-09 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > I've read in many places that R semantics are based on Scheme semantics. As > a long-time Lisp user and implementor, I've tried to make this more precise, > and this is what I've found so far. I've excluded trivial things that > aren't basic semantic issues: support for

Re: [R] R and Scheme

2008-12-09 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > There is no equivalent to set-car!/rplaca (not even pairlists and > expressions). For example, r<-pairlist(1,2); r[[1]]<-r does not create a > circular list. And in general there doesn't seem to be substructure sharing > at the semantic level (though there may be in the i

Re: [R] for loop query

2008-12-09 Thread Claudia Beleites
Hi, > Why isn't my loop incrementing i - the outer loop to 2 and then resetting > j=3? It is. It runs out of bounds with j > 26 > Am I missing something obvious? > > for (i in 1:25) > + { > + for (j in i+1:26) You miss parentheses. i + 1 : 26 is i + (1 : 26) as the

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Mark Difford
Hi Harsh, >> I looked for other R packages that allow me to do variable reduction >> without considering a dependent variable. Have look at package subselect. This has an implementation of the genetic algorithm, along with some other methods. It should do what you want. Regards, Mark. Harsh-

Re: [R] display matrix on graphics device

2008-12-09 Thread Jim Lemon
[EMAIL PROTECTED] wrote: Folks, Is there a way to print a matrix in tabular form onto the graphics device? I want to create a display consisting of graphs and tables, so that I can do something like: windows() opar = par(mfrow = c(3, 2)) library(plotrix) library(PerformanceAnalytics) radial

[R] Sorry, I have attached the data - Here is the code that causes wavCWTPeaks error

2008-12-09 Thread mauede
-Messaggio originale- Da: [EMAIL PROTECTED] Inviato: mar 09/12/2008 13.52 A: stephen sefick; Francesco Masulli; Stefano Rovetta Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Oggetto: Here is the code that causes wavCWTPeaks error aats <- create.signalSeries(aa, pos=list(fro

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Frank E Harrell Jr
Harsh wrote: Hello All, I am trying to carry out variable reduction. I do not have information about the dependent variable, and have only the X variables as it were. In selecting variables I wish to keep, I have considered the following criteria. 1) Percentage of missing value in each column/var

[R] for loop query

2008-12-09 Thread Gerard M. Keogh
Hi all, apologies if this is obvious - but I can't see it and would appreciate some quick help! the matrix mhouse is 26x3 and I'm computing odds ratios. The simple code below "should" compute the odds vector for every pair (325) i.e. 26C2 in cols 1 and 2. On the first i=1 outer loop the inner j

[R] Pre-model Variable Reduction

2008-12-09 Thread Harsh
Hello All, I am trying to carry out variable reduction. I do not have information about the dependent variable, and have only the X variables as it were. In selecting variables I wish to keep, I have considered the following criteria. 1) Percentage of missing value in each column/variable 2) Varian

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Gabor Grothendieck
See: ?prcomp ?princomp On Tue, Dec 9, 2008 at 5:34 AM, Harsh <[EMAIL PROTECTED]> wrote: > Hello All, > I am trying to carry out variable reduction. I do not have information > about the dependent variable, and have only the X variables as it > were. > In selecting variables I wish to keep, I have

[R] display matrix on graphics device

2008-12-09 Thread murali . menon
Folks, Is there a way to print a matrix in tabular form onto the graphics device? I want to create a display consisting of graphs and tables, so that I can do something like: windows() opar = par(mfrow = c(3, 2)) library(plotrix) library(PerformanceAnalytics) radial.plot(...) radial.plot(...)

Re: [R] for loop query

2008-12-09 Thread Robin Hankin
Hi start simple! Work out *each* row combined with *each* row, to give (in your case) a 26-by-26 matrix. Only after you have got this working, start thinking about making it run faster [eg by only evaluating the upper triangular entries] To do a nested loop, do M <- matrix(0,n,n) for(i in

[R] (senza oggetto)

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

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Hans W. Borchers
Harsh gmail.com> writes: > > Hello All, > I am trying to carry out variable reduction. I do not have information > about the dependent variable, and have only the X variables as it > were. > ... > I looked for other R packages that allow me to do variable reduction > without considering a depend

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Ravi Varadhan
Principal components analysis does "dimensionality reduction" but NOT "variable reduction". However, Jolliffe's 2004 book on PCA does discuss the problem of selecting a subset of variables, with the goal of representing the internal variation of original multivariate vector as well as possible (se

[R] Selecting rows that are the same in separate data frames

2008-12-09 Thread ppaarrkk
I want to compare two matrices or data frames and select or get an index for those rows which are the same in both. I have tried the following : a = matrix ( 1:10, ncol = 2 ) a b = matrix ( c ( 2,3,4,7,8,9 ), ncol = 2 ) b a[a==b] a = as.data.frame ( matrix ( 1:10, ncol = 2 ) ) a b =

[R] Need help optimizing/vectorizing nested loops

2008-12-09 Thread tyler
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. `dat` is a dataframe of samples from a regular grid. The first two columns are the spatial coordinates of the samples, the remaining 20 columns

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Harsh
Thank you everyone. The idea really is for me to get the variables themselves from a super-set of all variables. x1 -numeric continuous x2 -numeric continuous x3 - numeric Factor with 2 levels x4 -Character Factor with 10 levels x5 - numeric continuous x6 - numeric integer Variable Reduction metho

Re: [R] R and Scheme

2008-12-09 Thread Luke Tierney
On Tue, 9 Dec 2008, Wacek Kusnierczyk wrote: Stavros Macrakis wrote: I've read in many places that R semantics are based on Scheme semantics. As a long-time Lisp user and implementor, I've tried to make this more precise, and this is what I've found so far. I've excluded trivial things that a

[R] motif search

2008-12-09 Thread Alessia Deglincerti
Hi, I am very new to R and wanted to know if there is a package that, given very long nucleotide sequences, searches and identifies short (7-10nt) motifs.. I would like to look for enrichment of certain motifs in genomic sequences. I tried using MEME (not an R package, I know), but the onli

Re: [R] Data Analysis Functions in R

2008-12-09 Thread Dirk Eddelbuettel
On Mon, Dec 08, 2008 at 09:34:35PM -0800, Feanor22 wrote: > > Hi experts of R, > > Are there any functions in R to test a univariate series for long memory > effects, structural breaks and time reversability? > I've found for ARCH effects(ArchTest), for normal (Shapiro.test, > KS.test(comparing w

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Mark Difford
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. (One of its authors was

Re: [R] Sorry, I have attached the data - Here is the code that causes wavCWTPeaks error

2008-12-09 Thread stephen sefick
I'm stumped. On Tue, Dec 9, 2008 at 7:53 AM, <[EMAIL PROTECTED]> wrote: > > -Messaggio originale- > Da: [EMAIL PROTECTED] > Inviato: mar 09/12/2008 13.52 > A: stephen sefick; Francesco Masulli; Stefano Rovetta > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Oggetto: Here

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread bartjoosen
I'm not sure what you want, but take a look at ?merge and %in% ppaarrkk wrote: > > I want to compare two matrices or data frames and select or get an index > for those rows which are the same in both. I have tried the following : > > > > > > > a = matrix ( 1:10, ncol = 2 ) > a > > b = ma

[R] R: Sorry, I have attached the data - Here is the code that causes wavCWTPeaks error

2008-12-09 Thread mauede
Maxima are found if I prolong the 1-cycle time series on both sides, appaently no matter which values I use. The following sequence works fine: aal <- rep (aa[1], length(aa)) aar <- rep (aa[length(aa)], length(aa)) aa3 <- c(aal,aa,aar)

[R] problem with Vista

2008-12-09 Thread vincenzo landi
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': No such file or director

Re: [R] Logical inconsistency

2008-12-09 Thread emma jane
Many thanks for your help, perhaps I should have set my query in context ! I'm simply calculating an indicator variable [0,1] based on the whether the difference between two measured variables is > 1 or <=1. I understand the FAQ about floating point arithmetic, but am still puzzled that it

[R] Here is the code that causes wavCWTPeaks error

2008-12-09 Thread mauede
aats <- create.signalSeries(aa, pos=list(from=0.0, by=0.033)) aa.cwt <- wavCWT(aats) x11 (width=10,height=12) plot (aats,main=paste(insig," Cycle: ",j,sep="")) aa.maxtree <- wavCWTTree (aa.cwt, type="maxima") aa.mintree <- wavCWTTree (aa.cwt, type="minima") aa.maxpeak <- wavCWTP

Re: [R] ANCOVA

2008-12-09 Thread Greg Snow
ANCOVA usually is used when you have a numerical covariate that you want to adjust for, your description does not include any, so a regular anova (aov function) can be used. If you do have 1 or more covariates to adjust for, then it can be thought of as a regression problem (ANCOVA is a special

Re: [R] How to add accuracy, sensitivity, specificity to logistic regression output?

2008-12-09 Thread Jorge Ivan Velez
Dear Pufft, You might interested in the lroc function in the epicalc [1] package and the ROCR [2] package itself. [1] http://cran.r-project.org/web/packages/epicalc/index.html [2] http://cran.r-project.org/web/packages/ROCR/index.html HTH, Jorge On Mon, Dec 8, 2008 at 11:39 PM, pufftissue pu

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread Jorge Ivan Velez
Dear Simon, Try this: # Index -- FALSE, TRUE sapply(1:nrow(a),function(x) all(a[x,]%in%b)) # Rows of a that are in b which(sapply(1:nrow(a),function(x) all(a[x,]%in%b))) # Reporting a[sapply(1:nrow(a),function(x) all(a[x,]%in%b)),] HTH, Jorge On Tue, Dec 9, 2008 at 9:57 AM, ppaarrkk <[EMA

[R] Bootstrap a GLM model with Poisson family

2008-12-09 Thread Joana Vicente
Hello! Anyone can help me to know how to do a bootstrap evaluation analysis to a GLM with family=Poisson? I have some R codes but they were coded only for family=binomial... thanks a lot Joana Vicente .·. CIBIO - Centro de Investigação em Biodiversidade e Recursos Genéticos. Faculdade de Ciên

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread ppaarrkk
Thanks for reply. What I want is the equivalent of this : xxx = 1:10 which(xxx %in% c(2,5)) ...but where there is more than one criterion for matching. which (b %in% a) in the code I included does nothing (not surprisingly). I'm not sure that I can use merge, because I want the whole of

Re: [R] Selecting rows that are the same in separate data frames

2008-12-09 Thread Henrique Dallazuanna
Try this: 1) Rows: merge(as.data.frame(a), as.data.frame(b), sort = FALSE) 2) Index: merge(cbind(as.data.frame(a), Idx = 1:nrow(a)), as.data.frame(b), sort = FALSE)$Idx On Tue, Dec 9, 2008 at 12:57 PM, ppaarrkk <[EMAIL PROTECTED]> wrote: > > I want to compare two matrices or data frames and s

[R] creating standard curves for ELISA analysis

2008-12-09 Thread 1Rnwb
Hello R guru's I am a newbie to R, In my research work I usually generate a lot of ELISA data in form of absorbance values. I ususally use Excel to calculate the concentrations of unknown, but it is too tedious and manual especially when I have 100's of files to process. I would appreciate some h

Re: [R] Logical inconsistency

2008-12-09 Thread Greg Snow
Some (possibly all) of those numbers cannot be represented exactly, so there is a chance of round off error whenever you do some arithmetic, sometimes the errors cancel out, sometimes they don't. Consider: > print(8.3-7.3, digits=20) [1] 1.001 > print(11.3-10.3, digits=20) [1] 1 So

Re: [R] motif search

2008-12-09 Thread anna freni sterrantino
Hi Alessia, you may want to post this kind of question on Bioc mailing list, is more appropriate. http://www.bioconductor.org/docs/mailList.html About your question , I'm not 100% sure, but check if Biostrings pkg can do what you need to do. http://www.bioconductor.org/workshops/2008/Seattle

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

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

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,

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

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

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

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

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

[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

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

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

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

[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

[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

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

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

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

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

[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

[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

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/

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

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

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

[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

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

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

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

  1   2   >