[R] trellis/lattice: How to plot 4 panels with the same x-scale but different y-scales?

2010-05-05 Thread Marius Hofert
Dear R experts, I have four plots I would like to plot attached to each other (in panels). All plots have the same x-scale, but different y-scales. The example below shows pretty much what I would like to have, except that for the two plots in the "second column" (of this 2x2 plot-matrix), I wo

Re: [R] help on compile r-2.10.0 on 64 bit window

2010-05-05 Thread Prof Brian Ripley
On Wed, 5 May 2010, zach Li wrote: Hi, I tried to compile R-2.10.0 src on 64 bit window. That is not supported, and I have no idea why you think it would be. (Working) support for 64-bit Windows (sic) was added well after 2.10.0 was released. After install Rtools and wingw-w64 compile

Re: [R] Retrieve regular expression groups

2010-05-05 Thread Gabor Grothendieck
Yes, you have to wrap it in a function but note that gsubfn does have facilities to make wrapping something in a function easier. If a function call is preceded by fn$ then a function in the arguments can be specified using a formula notation. For example, first we define NAify which forms a list

Re: [R] concatenate values of two columns

2010-05-05 Thread kMan
Dear n.vialma, Good question! Your columns are of type factor(). Watch out for strange things with coercion (and so much for the 3 minute reply)! In this solution, you need a pre-allocated vector to store the results, and your approach is different depending on the data type you want the resulting

Re: [R] Converting dollar value (factors) to numeric

2010-05-05 Thread Wang, Kevin (SYD)
Hi Phil and all those who replied, Thanks heap! Yes it worked to a certain extent. However, if I have the following case: > x <- c("$135,359.00", "$135359.00", "$1,135,359.00") > y <- sub('\\$','',as.character(x)) > cost <- as.numeric(sub('\\,','',as.character(y))) Warning message: NAs introduce

Re: [R] Hierarchical factors

2010-05-05 Thread David Winsemius
I think you are perhaps unintentionally obscuring two issues. One is whether R might have the statistical functions to deal with such an arrangement, and here "mixed models" would be the phrase you ought to be watching for, while the other would be whether it would have pre- written data man

Re: [R] Retrieve regular expression groups

2010-05-05 Thread OKB (not okblacke)
Gabor Grothendieck wrote: > Note that X and FUN are also arguments to sapply > >> args(sapply) > function (X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE) > NULL > > so the sapply construct in your post has the effect of applying c > to tmp, pats and strapply so the output you observe is correct

[R] extracting coordinates from SpatialPolygonsDataFrame using slot functions

2010-05-05 Thread Jeff Hamann
In converting some older code: ## builds an OWIN to generate a set of points on a grid within the OWIN object: bdry <- read.shape( "../../data/boundary.shp" ) outline.verts <- bdry$Shapes[[2]]$verts[1:bdry$Shapes[[2]]$Pstart[2],] outline.order <- nrow( outline.verts ) : 2 bdry.poly <- vector( 2, m

Re: [R] Error messages with psm and not cph in Hmisc

2010-05-05 Thread Frank E Harrell Jr
On 05/05/2010 11:29 AM, David Foreman wrote: While sm4.6ll<-fit.mult.impute(Surv(agesi, si)~partner+ in.love+ pubty+ FPA+ strat(gender),fitter = cph, xtrans = dated.sexrisk2.i, data = dated.sexrisk2, x=T,y=T,surv=T, time.inc=16) runs perfectly using Hmisc, Design and mice under R11 run via Sciv

Re: [R] handling nulls while reading mainframe file

2010-05-05 Thread Michael Steven Rooney
Thanks. Once I have my cleaned up raw vector, I need to convert to characters using the ebcdic code page. I could first convert it to characters using rawToChar() (which will give me garbled ascii), and then convert that to ebcdic using iconv(). If anyone knows of a more direct solution, let me kno

Re: [R] Memory issue

2010-05-05 Thread kMan
Dear Alex, Has manual garbage collection had any effect? Sincerely, KeithC. -Original Message- From: Alex van der Spek [mailto:do...@xs4all.nl] Sent: Wednesday, May 05, 2010 3:48 AM To: r-help@r-project.org Subject: [R] Memory issue Reading a flat text file 138 Mbyte large into R with

Re: [R] help on compile r-2.10.0 on 64 bit window

2010-05-05 Thread Orvalho Augusto
Hello! Unless you really need 2.10 there is 2.11 and the good news is we have now 64bit R binary for windows. Good luck Caveman On Thu, May 6, 2010 at 3:53 AM, zach Li wrote: > > Hi, > > > > I tried to compile R-2.10.0 src on 64 bit window. After install Rtools and > wingw-w64 compiler and put

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread Gabor Grothendieck
Yes, you could bring it up on the R-sig-mac or file a bug report. On Wed, May 5, 2010 at 10:11 PM, steven mosher wrote: > Thnks, > perhaps we should report it > > On Wed, May 5, 2010 at 4:52 PM, Gabor Grothendieck > wrote: >> >> I am using Vista.  Another thing to try is strapply using the tcl >

Re: [R] Hierarchical factors

2010-05-05 Thread Marshall Feldman
Thanks for sharing this, Ista. I've come to the conclusion that R doesn't have what I'm looking for, either in the base or the packages. Although your examples are insightful, the examples we've been discussing are deliberately easier than what one would expect in most serious applications. Im

Re: [R] any function in R similar to the "scan" function in SAS?

2010-05-05 Thread David Winsemius
On May 5, 2010, at 9:17 PM, Gabor Grothendieck wrote: You can read from a character vector as if it were a file like this: x <- c("1-2", "3-4", "5-6") read.table(textConnection(x), sep = "-", col.names = c("one", "two")) one two 1 1 2 2 3 4 3 5 6 On Wed, May 5, 2010 at 12:45 P

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
Thnks, perhaps we should report it On Wed, May 5, 2010 at 4:52 PM, Gabor Grothendieck wrote: > I am using Vista. Another thing to try is strapply using the tcl > engine (assuming you do have tcltk capabilities) and the R engine. On > Vista R 2.11.0 patched I get the same result: > > > capabili

Re: [R] readLines with space-delimiter?

2010-05-05 Thread kMan
One line at a time! That must have taken forever! Do you happen to know how many lines you could read in at once & still have enough room to work with? Sincerely, KeithC. -Original Message- From: Seth [mailto:sjmy...@syr.edu] Sent: Tuesday, May 04, 2010 11:05 PM To: r-help@r-project.org

[R] help on compile r-2.10.0 on 64 bit window

2010-05-05 Thread zach Li
Hi, I tried to compile R-2.10.0 src on 64 bit window. After install Rtools and wingw-w64 compiler and put it the first of my PATH variable, but i got the following error when i tried to compile. Anything I missed? thank you. x86_64-w64-mingw32-gcc -std=gnu99 -I../include -I. -I../extra

Re: [R] readLines with space-delimiter?

2010-05-05 Thread kMan
Dear Seth, If this were my project, I would likely use something besides readLines(). Have you looked into read.table() or scan()? They'll separate based on your delimiter on input so you do not need to do post processing. #example file txt2<-cbind(c("A","cat","ran","over","the"),c("brown","fox."

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
Thanks, Steve and David! svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", kernel="radial", cost=bestc, gamma=bestg, cross=10, probability=TRUE) It works this time! On Wed, May 5, 2010 at 6:24 PM, Changbin Du wrote: > Thanks Steve! > > I will try and let you know how i

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
Thanks Steve! I will try and let you know how it comes. On Wed, May 5, 2010 at 6:07 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi Changbin, > > On Wed, May 5, 2010 at 6:46 PM, Changbin Du wrote: > > svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", >

Re: [R] handling nulls while reading mainframe file

2010-05-05 Thread jim holtman
Try using readBin and 'raw' x <- readBin('yourFile', 'raw', n=1e6) You can then scan 'x' and replace NULLs (I assume they are 0x00) with whatever you want. > str(x) raw [1:10] 00 00 22 00 ... > x [1] 00 00 22 00 00 00 00 00 00 00 > x[x == as.raw(0)] <- as.raw(0xab) > x [1] ab ab 22 ab ab ab a

Re: [R] any function in R similar to the "scan" function in SAS?

2010-05-05 Thread Gabor Grothendieck
You can read from a character vector as if it were a file like this: > x <- c("1-2", "3-4", "5-6") > read.table(textConnection(x), sep = "-", col.names = c("one", "two")) one two 1 1 2 2 3 4 3 5 6 On Wed, May 5, 2010 at 12:45 PM, karena wrote: > > I am wondering if there is any fu

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread Steve Lianoglou
Hi Changbin, On Wed, May 5, 2010 at 6:46 PM, Changbin Du wrote: > svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", > kernel="radial", cost=bestc, gamma=bestg, cross=10) # model fitting > > svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) # > find t

Re: [R] stopping emails

2010-05-05 Thread Erik Iverson
Steve Hempell wrote: I would like to stop recieving all the emails from R-Help. I cannot get back to the preference page given when I first registered. How do I stop the e-mails? It's in the footer of all emails from the list. https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] stopping emails

2010-05-05 Thread Steve Hempell
I would like to stop recieving all the emails from R-Help. I cannot get back to the preference page given when I first registered. How do I stop the e-mails? Steve H :[ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread David Meyer
Dear Changbin, that looks odd indeed - can you cast your example in a reproducible one so I can track this down (or at least send me the data offline?) Thanks David Changbin Du wrote: svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", kernel="radial", cost=bestc, gamma=b

[R] How could I get the percent of variance explained by each axis if I use prcomp to predict new dataset?

2010-05-05 Thread Liu, Feng
Dear list, I am trying to use a PCA to predict new dataset, I know how to get the variance explained for the original PCA, but how could I get the percent of variance explained by each axis for this new PCA ordination? Thanks a lot. x1 <- matrix(rnorm(30), 6, 5) x2 <- matrix (rnorm(40), 8,

[R] testInstalledBasic question

2010-05-05 Thread Jim Price
Hi, I'm currently in the process of writing an R-installation SOP for my company. As part of that process I'm using the recommendations from the 'R Installation and Administration' document, section 3.2, "Testing an installation". This is done on an XP machine, using the latest binary of 2.11.0.

[R] P values

2010-05-05 Thread level
How do u calculated p values for a z test.. so far i ve done this A = read.table("cw3_data.txt") xbar = mean(A) s = 1 n = 20 mu = 0 z.test = (xbar-mu)/(s/sqrt(n)) p.value = pnorm(abs(z.test)) error = qnorm(0.99)*s/sqrt(n) left = xbar - error right = xbar + error and have got values off of i

[R] Expressing z & t test data in a graph

2010-05-05 Thread level
How do u do this? -- View this message in context: http://r.789695.n4.nabble.com/Expressing-z-t-test-data-in-a-graph-tp2131604p2131604.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz

[R] simple on point bisserial correlation

2010-05-05 Thread Dmitry Gospodaryov
Dear developers of R-project, I have such data height of male persons 181, 178, 182, 160, 187, 193, 184, 184, 175, 178, 184, 184, 174, 185, 175 height of female persons 164, 165, 160, 174, 167, 161, 164, 165, 169, 175, 165, 155, 172, 164, 172, 166, 160, 159, 158, 173 I want to determine if height

Re: [R] any function in R similar to the "scan" function in SAS?

2010-05-05 Thread Phil Spector
Karena - You can use strsplit combined with sapply to do what you want: three = c('1-2','3-4','5-6') ss = strsplit(three,'-') one = sapply(ss,function(x)x[1]) two = sapply(ss,function(x)x[2]) one [1] "1" "3" "5" two [1] "2" "4" "6" You might want to use as.numeric to convert them back to

Re: [R] advice?

2010-05-05 Thread Eric
Download the trial version of UltraEdit (windows only) to open, inspect and edit the file. Rename columns as needed. Set a long Tab stop, Find/replace your delimiters to tabs (^t) and use column mode to remove unneeded columns. You can also split the file and check if loading in increments help.

Re: [R] melt, remove rows with common id if NA encountered in value

2010-05-05 Thread jim holtman
try this: > x <- read.table(textConnection("SP variable value + 425 CoolidgeLoad 6.044483e+07 + 425 CoolidgeLoad 5.314102e+07 + 425 CoolidgeLoad 5.287761e+07 + 425 CoolidgeLoad 4.592003e+07 + 425 CoolidgeLoad 4.314002e+07 + 425 CoolidgeLoad NA + 425 CoolidgeLoad NA

[R] T-test & for loop

2010-05-05 Thread level
I have been set a question which i understand statistically but my inability with R is preventing me from finishing it.. My question is that we to calculate the frequency of Type 1 errors starting with x = rnorm(10, 0.1, 1) then doing a t-test seeing whether you reject the null hypothesis (Ho

[R] randomForest: predictor importance (for regressions)

2010-05-05 Thread Dimitri Liakhovitski
I have a question about predictor importances in randomForest. Once I've run randomForest and got my object, I get their importances: rfresult$importance I also get the "standard errors" of the permutation-based importance measure: rfresult$importanceSD I have 2 questions: 1. Because I am dealin

[R] Which column in randomForest importances (for regression) is MSE and which IncNodePurity

2010-05-05 Thread Dimitri Liakhovitski
I've run the function randomForest with importance=T. All my variables (predictors and the dependent variable) are numeric. rf<-randomForest(formula, data=mydata, importance=T, etc.) my results object "rf" contains predictor importances: rf$importance I am seeing two columns: %IncMSE IncNo

[R] Error messages with psm and not cph in Hmisc

2010-05-05 Thread David Foreman
While sm4.6ll<-fit.mult.impute(Surv(agesi, si)~partner+ in.love+ pubty+ FPA+ strat(gender),fitter = cph, xtrans = dated.sexrisk2.i, data = dated.sexrisk2, x=T,y=T,surv=T, time.inc=16) runs perfectly using Hmisc, Design and mice under R11 run via Sciviews-K, with library(Design) library(mice) ds2

Re: [R] any function in R similar to the "scan" function in SAS?

2010-05-05 Thread Erik Iverson
karena wrote: I am wondering if there is any function in R that is similar to the "scan" function in SAS. I have a data.frame which has two columns as the following: one two 1 2 3 4 5 6 I used the "paste" function to create the third column: three <- paste(one,'-',two,sep="") so

Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-05 Thread Tao Shi
Thanks, Gabor!  So, there is no way I can change some graphic parameters in 'matplot' to get this? I forgot to mention that I purposely use type="b", so I know where the missing data are.  With imputed data, either using "b" or "l", there is no way to keep track of NAs.  Plus, in my real

Re: [R] converting an objects list

2010-05-05 Thread Anthony Fristachi
Jim, Thank you very much for your prompt reply. This does exactly what I needed. There is a steep learning curve going from SAS to R. I had tried this approach before but did not include the "get" argument. I had never seen that used that before. Tony

[R] polar.plot text labels for data points

2010-05-05 Thread Tali
Hello All. I am using polar.plot from the {plotrix} library to visualize individual coral colonies, dying, growing, etc through time. These coral colonies, that I visit annually happen to be delineated by a circular plot underwater; hence polar.plot is the best way to visualize my data. (I.e. Th

[R] What is the default nPerm for regression in randomForest?

2010-05-05 Thread Dimitri Liakhovitski
Could not find it in ?randomForest. Thank you for your help! -- Dimitri Liakhovitski Ninah.com dimitri.liakhovit...@ninah.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] question about 'write.table'

2010-05-05 Thread karena
Thank both of you guys!! -- View this message in context: http://r.789695.n4.nabble.com/question-about-write-table-tp2126309p2131165.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.c

[R] any function in R similar to the "scan" function in SAS?

2010-05-05 Thread karena
I am wondering if there is any function in R that is similar to the "scan" function in SAS. I have a data.frame which has two columns as the following: one two 1 2 3 4 5 6 I used the "paste" function to create the third column: three <- paste(one,'-',two,sep="") so the data.frame

Re: [R] Creating Crosstabs using a sparse table

2010-05-05 Thread r...@merrittnet.org
Thanks David I will do that -Original Message- From: David Winsemius To: merrittr Cc: r-help@r-project.org Subject: Re: [R] Creating Crosstabs using a sparse table Date: Wed, 5 May 2010 10:18:32 -0400 Mailer: Apple Mail (2.936) On May 4, 2010, at 7:57 PM, merrittr wrote: > > Hi all >

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread Gabor Grothendieck
I am using Vista. Another thing to try is strapply using the tcl engine (assuming you do have tcltk capabilities) and the R engine. On Vista R 2.11.0 patched I get the same result: > capabilities()[["tcltk"]] [1] TRUE > strapply(test, "\\d{5}", c, engine = "tcl")[[1]] [1] "88958" > strapply(test

[R] how to display the value of each data points on the levelplot

2010-05-05 Thread zhenjiang xu
Hi R users, How can I display the corresponding value inside each little square of level plot plotted by the following code? > data(Cars93, package = "MASS") > cor.Cars93 <- cor(Cars93[, !sapply(Cars93, is.factor)], use = "pair") > levelplot(cor.Cars93, aspect = 1, scales = list(x = list(rot = 90)

[R] What is the best way to have "R" output tables in an MS Word format?

2010-05-05 Thread Tao Shi
Hi Max, It looks like most of answers were towards to the statisticians you work with (i.e. R -> Word).  For yourself, if you just worry about converting the PDF reports from your statisticians to Word, here is another link with a more comprehensive review besides the two online apps Prof. Ha

Re: [R] Limitations on R code file

2010-05-05 Thread Jorge Ivan Velez
Hi James, I ran all your code on a fresh R session (64 bit, OS X 10.6.0) and got no errors. I suspect what Steve suggests is true: your computer is running out of memory. Have you tried running it on a 64 bit machine? Here is my sessionInfo(): R version 2.11.0 (2010-04-22) x86_64-apple-darwin9.

[R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", kernel="radial", cost=bestc, gamma=bestg, cross=10) # model fitting svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) # find the probability, but can not find. attr(svm.pred, "probabilities") > attr(

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
with a fresh restart test<-"88958Abcdsef67.8S68.9\nW26m" > > test [1] "88958Abcdsef67.8S68.9\nW26m" > sub(".*(\\d{5}).*", "\\1", test) [1] "" > sub(".*([0-9]{5}).*", "\\1", test) [1] "88958" > test2<-"aaa12345W" > sub(".*(\\d{5}).*", "\\1", test2) [1] "W" > > sub("

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
MAC bug? On Wed, May 5, 2010 at 3:20 PM, David Winsemius wrote: > > On May 5, 2010, at 5:35 PM, Gabor Grothendieck wrote: > > Here are two ways to extract 5 digits. >> >> In the first one \\1 refers to the portion matched between the >> parentheses in the regular expression. >> >> In the second

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
Hmm. I have R11 just downloaded fresh. I'll reload a new session..and revert. I will note that I've had trouble with \\d which is why I was using [0-9] MAC here. On Wed, May 5, 2010 at 3:00 PM, Gabor Grothendieck wrote: > That's not what I get: > > > > test<-"88958Abcdsef67.8S68.9\nW26m" > > s

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread David Winsemius
On May 5, 2010, at 5:35 PM, Gabor Grothendieck wrote: Here are two ways to extract 5 digits. In the first one \\1 refers to the portion matched between the parentheses in the regular expression. In the second one strapply is like apply where the object to be worked on is the first argument (a

Re: [R] Limitations on R code file

2010-05-05 Thread Steve Lianoglou
Hi James, On Wed, May 5, 2010 at 5:28 PM, wrote: > I would like to run R code from a file that is generated from other source. > The file consists of some variables and formulas/equations such as > > Variables = log(100) > ##Other variable definitions > VariablesWithLongNames = 2*3*log(12345678)

[R] melt, remove rows with common id if NA encountered in value

2010-05-05 Thread emorway
forum, After melting a data.frame I get some 18,000+ rows (some rows below). I want to filter/remove all rows that have an "SP" & "variable" value in common with a row containing "NA" in the value column. So in the example rows below, all rows with SP=425 & variable=CoolidgeLoad would be remove

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread Gabor Grothendieck
That's not what I get: > test<-"88958Abcdsef67.8S68.9\nW26m" > sub(".*(\\d{5}).*", "\\1", test) [1] "88958" > R.version.string [1] "R version 2.10.1 (2009-12-14)" I also got the above in R 2.11.0 patched as well. On Wed, May 5, 2010 at 5:55 PM, steven mosher wrote: >  test > [1] > "88958Abcdse

Re: [R] FUN argument to return a vector in aggregate function

2010-05-05 Thread David Winsemius
On May 5, 2010, at 5:32 PM, utkarshsinghal wrote: Extending my question further, I want to apply different FUN arguments on three fields and the "by" argument also contains more than one field. For example: set.seed(100) d = data.frame(a=sample(letters[1:2], 20 ,replace = T ),b = sam

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
test [1] "88958Abcdsef67.8S68.9\nW26m" > sub(".*(\\d{5}).*", "\\1", test) [1] "" > sub(".*([0-9]{5}).*","\\1",test) [1] "88958" > I think the "wrote: > Here are two ways to extract 5 digits. > > In the first one \\1 refers to the portion matched between the > parentheses in the regular expressi

Re: [R] Dynamic clustering?

2010-05-05 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Erik Iverson > Sent: Wednesday, May 05, 2010 2:33 PM > To: Ralf B > Cc: r-help@r-project.org > Subject: Re: [R] Dynamic clustering? > > Hello, > > Ralf B wrote: > > Are there R

Re: [R] installing a package in linux

2010-05-05 Thread Vojtěch Zeisek
There are a lot of R packages available in Ubuntu's repositories. Just search for R-* or r-cran-* within Your favorite package manager. It it the easiest way. :-) Best regards, Vojtěch Zeisek Dne St 5. května 2010 17:03:22 Tengfei Yin napsal(a): > Hi > > The weird part in this case is that, if

Re: [R] Dynamic clustering?

2010-05-05 Thread Achim Zeileis
On Wed, 5 May 2010, Ralf B wrote: Are there R packages that allow for dynamic clustering, i.e. where the number of clusters are not predefined? Yes. I have a list of numbers that falls in either 2 or just 1 cluster. Here an example of one that should be clustered into two clusters: two <- c

Re: [R] FUN argument to return a vector in aggregate function

2010-05-05 Thread Gabor Grothendieck
Try this: do.call("rbind", by(d, d[1:2], function(x) with(x, data.frame(x[1, 1:2], `mean c` = mean(c), `sum d` = sum(d), `has X` = "X" %in% e, check.names = FALSE or this (which uses 1 or 0 to mean TRUE or FALSE in the last column): > library(sqldf) # see http://sqldf.googlecode.com > sqldf

Re: [R] Has Anyone created any good R wallpapers ?

2010-05-05 Thread Erik Iverson
Paul wrote: I was googling around today to see if anyone had created any R wallpapers, given some of the amazing graphics that can be created with R I'd like to display the capabilities for others. I didn't come up with much. Don't know what you mean by 'wallpaper'. This site has a bunch

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
Thanks I was looking at that package and reading your mails in the archive. I think my tiny mind got twisted in the regexp.. On Wed, May 5, 2010 at 2:35 PM, Gabor Grothendieck wrote: > Here are two ways to extract 5 digits. > > In the first one \\1 refers to the portion matched between the > pare

Re: [R] extracting a matched string using regexpr

2010-05-05 Thread Gabor Grothendieck
Here are two ways to extract 5 digits. In the first one \\1 refers to the portion matched between the parentheses in the regular expression. In the second one strapply is like apply where the object to be worked on is the first argument (array for apply, string for strapply) the second modifies i

Re: [R] Dynamic clustering?

2010-05-05 Thread Erik Iverson
Hello, Ralf B wrote: Are there R packages that allow for dynamic clustering, i.e. where the number of clusters are not predefined? I have a list of numbers that falls in either 2 or just 1 cluster. Here an example of one that should be clustered into two clusters: two <- c(1,2,3,2,3,1,2,3,400,3

Re: [R] Avoiding for-loop for splitting vector into subvectorsbasedon positions

2010-05-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap > Sent: Wednesday, May 05, 2010 12:59 PM > To: Joris Meys; jim holtman > Cc: R mailing list > Subject: Re: [R] Avoiding for-loop for splitting vector into > subvec

Re: [R] FUN argument to return a vector in aggregate function

2010-05-05 Thread utkarshsinghal
Extending my question further, I want to apply different FUN arguments on three fields and the "by" argument also contains more than one field. For example: set.seed(100) d = data.frame(a=sample(letters[1:2],20,replace=T),b=sample(3,20,replace=T),c=rpois(20,1),d=rbinom(20,1,0.5),e=rep(c("X","Y")

Re: [R] Latex and Stangle()

2010-05-05 Thread Ruihong Huang
Hi Silvano, I think you can enable automatic line breaking of long lines by \lstinputlisting[language=R, breaklines=true]{Relatorio.R} Best, Ruihong On 05/05/2010 11:12 PM, Silvano wrote: Ruihong it very interesting, but the lines was very long. Thanks, --

[R] Limitations on R code file

2010-05-05 Thread guox
I would like to run R code from a file that is generated from other source. The file consists of some variables and formulas/equations such as Variables = log(100) ##Other variable definitions VariablesWithLongNames = 2*3*log(12345678)+10^4 + Variables Equations=log(VariablesWithLongNames)+Variabl

Re: [R] ordering data frame

2010-05-05 Thread Erik Iverson
phoebe kong wrote: Hi all, I have problem in ordering data frame. Could anyone help me? x [,1] [,2] [,3] [1,] "A" "1" "2" [2,] "G" "3" "2" [3,] "E" "2" "3" y [,1] [,2] [,3] [1,] "G" "3" "3" [2,] "A" "3" "3" [3,] "E" "3" "3" Are these really data.frames? They looks

[R] Dynamic clustering?

2010-05-05 Thread Ralf B
Are there R packages that allow for dynamic clustering, i.e. where the number of clusters are not predefined? I have a list of numbers that falls in either 2 or just 1 cluster. Here an example of one that should be clustered into two clusters: two <- c(1,2,3,2,3,1,2,3,400,300,400) and here one th

[R] extracting a matched string using regexpr

2010-05-05 Thread steven mosher
Given a text like I want to be able to extract a matched regular expression from a piece of text. this apparently works, but is pretty ugly # some html test<-"88958Abcdsef67.8S68.9\nW26m" # a pattern to extract 5 digits > pattern<-"[0-9]{5}" # regexpr returns a start point[1] and an attribute "ma

[R] ordering data frame

2010-05-05 Thread phoebe kong
Hi all, I have problem in ordering data frame. Could anyone help me? > x [,1] [,2] [,3] [1,] "A" "1" "2" [2,] "G" "3" "2" [3,] "E" "2" "3" > y [,1] [,2] [,3] [1,] "G" "3" "3" [2,] "A" "3" "3" [3,] "E" "3" "3" I would like to order data frame x by the order of column 1 of d

[R] Has Anyone created any good R wallpapers ?

2010-05-05 Thread Paul
I was googling around today to see if anyone had created any R wallpapers, given some of the amazing graphics that can be created with R I'd like to display the capabilities for others. I didn't come up with much. Anyone else come up with anything. Paul.

Re: [R] Read data from .csv file as a matrix

2010-05-05 Thread Tao Shi
Vincent, The root of this problem seems to be that you don't fully understand the differences between matrix and data.frame.  Read up on them and you'll know how to solve this problem. For now: as.matrix(temp[,-1]) or temp = read.csv("Weather.csv", sep=",", row.names=1) temp1 <- as.matrix(t

Re: [R] Using statistical test to distinguish two groups

2010-05-05 Thread Ralf B
Thank you for both your help saving me a a lot of time searching for the right technique. I have another question regarding clustering: My data set occasionally has only one cluster, meaning that clustering is not required in these occasional cases. Example: list <- c(767, 773, 766, 772, 778, 77

Re: [R] Jonckheere-Terpstra test using coin package?

2010-05-05 Thread Dale Steele
Using coin ... answer provided by Prof. Hothorn. control <- c(40, 35, 38, 43, 44, 41) rough <- c(38, 40, 47, 44, 40, 42) accurate <- c(48, 40, 45, 43, 46, 44) pieces <- list(control, rough, accurate) n <- c(6, 6, 6) grp <- as.ordered(factor(rep(1:length(n),n))) library("coin") library("multcomp"

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread vincent.deluard
YES IT WORKED!!! Many thanks JiHO Vincent Deluard vincent.delu...@trimtabs.com Global Equity Strategist, CFA Charter Award Pending TrimTabs Investment Research 40 Wall Street, 28th Floor New York, NY 100

Re: [R] ggplot2's geom_errorbar legend

2010-05-05 Thread hadley wickham
Hi Giovanni, The basic idea is: classiclimits <- aes(x=x[1:100],ymax = classiccis[1:100,e,p, ymin=classiccis[1:100,e,p,2], colour = "classic") ownlimits <- aes(x=x[1:100]+0.4,ymax = owncis[1:100,e,p,1], ymin=owncis[1:100,e,p,2], colour = "own") rbootlimits <- aes(x=x[1:100]+0.8,ymax = rbootcis

Re: [R] Avoiding for-loop for splitting vector into subvectorsbased on positions

2010-05-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Joris Meys > Sent: Tuesday, May 04, 2010 2:02 PM > To: jim holtman > Cc: R mailing list > Subject: Re: [R] Avoiding for-loop for splitting vector into > subvectorsbased on positi

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread David Winsemius
On May 5, 2010, at 3:49 PM, JiHO wrote: I tried as.matrix but it did not help. as.matrix() won't work because a matrix requires everything in it to be of the same type (number, character, logical etc.). You do not have only numbers in your data.frame, so it will convert everything to characte

Re: [R] OLS Regression diagnostic measures check list - what to consider?

2010-05-05 Thread Liviu Andronic
On 5/5/10, Tal Galili wrote: > Although this is a great list, I am wondering if there is any newer methods > that are overlooked, or important consideration to take into account that > are not described in that page. > Two on-line resources would be "REGRESSION DIAGNOSTICS" by John Fox [1] and

Re: [R] Read data from .csv file as a matrix

2010-05-05 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of vincent.deluard > Sent: Wednesday, May 05, 2010 12:34 PM > To: r-help@r-project.org > Subject: [R] Read data from .csv file as a matrix > > > Hi R-users, > > > I have a csv fi

Re: [R] help overlay scatterplot to effects plot

2010-05-05 Thread Greg Snow
We cannot reproduce your example, don't have the data (or don't know where it is if we do) and where did the allEffects function come from? If this just makes a regular plot using base graphics and not messing with the user coordinates, then you can just use the points function to add additional

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread JiHO
> I tried as.matrix but it did not help. as.matrix() won't work because a matrix requires everything in it to be of the same type (number, character, logical etc.). You do not have only numbers in your data.frame, so it will convert everything to character strings. If you try as.matrix(temp[,-1])

Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-05 Thread Gabor Grothendieck
Try this: library(zoo) matplot(na.approx(b), type = "l") On Wed, May 5, 2010 at 2:30 PM, Tao Shi wrote: > > Hi list, > > I know that points involving NAs are not plotted in 'matplot', but when I > plot them as lines, I still want the lines to connect all the points (i.e. > not broken where the

Re: [R] Read data from .csv file as a matrix

2010-05-05 Thread Erik Iverson
Hello, I have a csv file that contains weather observation (rows) by days (in columns). I open using: temp = read.csv("Weather.csv", sep=",") and read: X X1.Jan X2.Jan X3.Jan X4.Jan 1 Min 2 3 4 1 2 Max 6 10 8 6 3 F

[R] Read data from .csv file as a matrix

2010-05-05 Thread vincent.deluard
Hi R-users, I have a csv file that contains weather observation (rows) by days (in columns). I open using: > temp = read.csv("Weather.csv", sep=",") and read: X X1.Jan X2.Jan X3.Jan X4.Jan 1 Min 2 3 4 1 2 Max 6 10 8

Re: [R] read.table or read.csv without row index?

2010-05-05 Thread vincent.deluard
Hi, I have the same problem as Wong. I have a csv file that contains weather observation (rows) by days (in columns). I open using: > temp = read.csv("Weather.csv", sep=",") and read: X X1.Jan X2.Jan X3.Jan X4.Jan 1 Min 2 3 4 1 2 Max 6

[R] Confidence interval around a mean count (poisson based?)

2010-05-05 Thread JiHO
Hello all, I am observing animals in a behavioural arena and recording their distance from a specific point at regular time intervals (large enough so that I can assume two successive positions are independent from each other). Each animal provides a complete histogram of distances which reflects

[R] Re : Re: Re: aregImpute (Hmisc package) : error in matxv(X, xcof)...

2010-05-05 Thread Marc Carpentier
Very useful code to investigate not only my problem ! I'll use it and keep it in mind for future works. Thank you very much for your help. And of course for the rest : packages, open-courses... among others ! Very helpful too. (Sorry for the wide dataset. I thought it would be attached and maybe

Re: [R] Unexpected call to "require"

2010-05-05 Thread Gabor Grothendieck
Its coming from the Hmisc startup. For example, in a clean session (R --vanilla) try this: library(survival) library(Hmisc) Replacing the above call with this will suppress it: suppressPackageStartupMessages(library(Hmisc)) To track it down: debug(message) and then run your scrip

Re: [R] concatenate values of two columns

2010-05-05 Thread Marshall Feldman
On 5/5/2010 6:00 AM, n.via...@libero.it wrote: Dear list, I'm trying to concatenate the values of two columns but im not able to do it: i have a dataframe with the following two columns: X VAR1 VAR2 1 2 2 1 3

[R] Unexpected call to "require"

2010-05-05 Thread Dennis Fisher
Colleagues I am executing a length script in R (20K lines). At one point, it returns: > Loading required package: tcltk > Loading Tcl/Tk interface ... done > Loading required package: Hmisc > Loading required package: survival > Loading required package: stats > Loading required package: graphics

[R] 'matplot' for matrix with NAs: broken lines

2010-05-05 Thread Tao Shi
Hi list, I know that points involving NAs are not plotted in 'matplot', but when I plot them as lines, I still want the lines to connect all the points (i.e. not broken where there are NAs).  Please see the example below.  How can I achieve this in 'matplot'?  If I can't, any good alternatives

Re: [R] OLS Regression diagnostic measures check list - what to consider?

2010-05-05 Thread Greg Snow
First a note, while that is a nice list, I think it needs a disclaimer about only running tests that answer a meaningful question for the data/problem being studied. If all those tests are run on datasets, I would be most suspicious of those datasets which passed all the tests. Also, failing s

  1   2   >