[R] How to arrange the GUI's in window in tcltk package???

2012-08-24 Thread punitha
Hi, I am new to R, I need your help. I have been said to create a GUI in R, I started using Tcltk package which was very easy to learn and code, but i am unable to arrange the GUI's in proper order in the window they are always arranged one below the other, please can anyone hel

Re: [R] kernlab | ksvm error

2012-08-24 Thread Reza Salimi-Khorshidi
Dear Uwe, I appreciate that if you let me know why, when using the attached file, the following script (two lines) doesn't work once in 10s of times. Best, Reza svm.pol4 <- ksvm(class.labs ~ ., data = train.data, prob.model = T, scale = T, kernel = "polydot") svm.pol.prd4 <- predict(svm.pol4, tra

Re: [R] mgcv package, problems with NAs in gam

2012-08-24 Thread Bert Gunter
Grace: Confession: I loved that error message! -- and it seems pretty clear to me. What does "to no avail" mean -- in particular, what happened when you changed your NA's to 0? Presumably you did not get the same error message, again, but something else, right? What else? Modulo the above vague

[R] extract vector elements of unknown range

2012-08-24 Thread Sepp Tannhuber
Dear all, I have two vectors   x <- c(1:20)   y <- c(1,5,10,14) Now I would like to extract   x[ (y[n] + 2):(y[n+1] - 1) ] for all elements except last one in y. This means I want to have   x[ c( (y[1]+2):(y[2]-1), (y[2]+2):(y[3]-1), (y[3]+2):(y[4]-1) ) ] How is this possible if y is a vector of

[R] Turning of source echo

2012-08-24 Thread darnold
HI, I have this code: BAGA <- c(10,20,20,30,30,30,30,40, 40,40,40,50,50,50,50,50, 60,60,60,60,60,70,70,70, 70,80,80,80,90,90,100) BAGB <- c(10,10,10,10,10,20,20,20, 20,30,30,30,40,40,50,60, 70,70,80,80,80,90,90,90, 90,100,100,100,100

[R] remove column

2012-08-24 Thread Kate Dresh
*Hi all,* I'm trying to filter a file through the columns. This file below is a example of my data frame. My true data frame has seven hundred thousand columns and 500 hundred lines. I need to identify and to remove all columns that all elements equal a number 1. In this my case, columns were de

Re: [R] plot curve on surface

2012-08-24 Thread David Winsemius
On Aug 24, 2012, at 2:34 AM, Michael Meyer wrote: Greetings, I would like to plot a curve (in color red) on a surface in a 3D plot. Say x <- as.vector(seq(-1,1,0.2)) dim(x) <- c(length(x),1) y <- as.vector(seq(-1,1,0.2)) dim(y) <- c(1,length(y)) z <- x%*%y # (x_

Re: [R] date

2012-08-24 Thread R. Michael Weylandt
Three steps: 1) as.character to get character representation 2) as.POSIXct to convert to time 3) julian() or strptime() to get Julian date. Read the docs (esp on part 2 and 3) to get the format strings just right. Cheers, Michael On Aug 24, 2012, at 10:30 PM, Veerappa Chetty wrote: > Hi, >

[R] date

2012-08-24 Thread Veerappa Chetty
Hi, I have dates as follows: 1/4/2006 0:00:00 AM It is a factor at present. How do I find out the day of the week from this? How do I convert to Julian date format? Thanks. Chetty -- Professor of Family Medicine Boston University Tel: 617-414-6221, Fax:617-414-3345 emails: chett...@gmail.com,vc

Re: [R] PHP escapeshellcmd() equivalent

2012-08-24 Thread Yihui Xie
You probably mean shQuote(). Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Fri, Aug 24, 2012 at 3:17 PM, Roebuck,Paul L wrote: > On 8/24/12 2:59 PM, "R. Michael Weylandt" > wrote: > >> On

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hah - I guess I didn't mean I understood it in full as I expect I will run into it again without anticipating it. But, now that I know the "old adage" I will look there first when I run into a problem. Also, I used the square root of machine precision instead - thanks for that, too. Thank you, t

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
On Fri, Aug 24, 2012 at 7:29 PM, Jennifer Sabatier wrote: > AHHH I GOT IT!! > > And I *think* I understand about floating point arithmetic.. Well then you're doing much better than the rest of us: it's quite a difficult subject and only gets trickier as you think about it more. (N

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
AHHH I GOT IT!! And I *think* I understand about floating point arithmetic.. In this case vn$PM.DIST.TOT is the sum of proportions. So, it should be anywhere 0 and 1. In our case, if it's anything other than 1 when vn$PM.EXP is greater than 0 then it means something is wrong wi

Re: [R] SparseM buglet

2012-08-24 Thread Roger Koenker
Sam, Thanks for pointing this out, but I have to point out in turn that this isn't a SparseM function, it is part of the package e1071, maintained by David Meyer. Roger Roger Koenker rkoen...@illinois.edu On Aug 24, 2012, at 3:07 PM, Sam Steingold wrote: > read.matrix.csr does not close

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Peter Ehlers
I see that you got other responses while I was composing an answer. Your 'example.csv' did come through for me, but I still can't replicate your PM.DIST_flag variable. Specifically, observations 30, 33, 36 and 40 are wrong. I agree with Rui, that there's something else going on. The data you've s

Re: [R] RJSONIO/rjson maximum depth?

2012-08-24 Thread Noia Raindrops
Hi, You missed a close bracket. node4:{ ... nodeDef:{ node4:{ ... # need a close bracket here } }, -- Noia Raindrops noia.raindr...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] mgcv package, problems with NAs in gam

2012-08-24 Thread grace
Hi there, I'm using presence-absence data in a gam (i.e. 0 or 1 as values) I am trying to run a gam with 'dummy covariates' i.e. 1~1 unfortunately my model: * model<-gam(1~1, data=bats, family=negbin)* keeps putting out: * Error in gam(1 ~ 1, data = bats, family = negbin) : Not enough (non-NA

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hi Michael, Thanks for letting me know how to post data. I will try to upload it that way in a second. I can usually use code to make a reproducible dataset but this time with the ifelse behaving strangely (perhaps, it's probably me) I didn't think I could do it easily so I figured I would just

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Oh, sorry, I first though you couldn't post data to the list, but then I thought I remembered other people doing so, so I tried to post it. Here is a copy. Thanks, Jen On Fri, Aug 24, 2012 at 5:49 PM, Rui Barradas wrote: > No data arrived to me. > > Rui Barradas > Em 24-08-2012 22:46, Jennifer

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
On Fri, Aug 24, 2012 at 4:50 PM, R. Michael Weylandt wrote: > On Fri, Aug 24, 2012 at 4:46 PM, Jennifer Sabatier > wrote: >> Hi Michael, >> >> No, I never use attach(), exactly for the reasons you state. To do >> due diligence I did a search of code for the function and it didn't >> come up (I w

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
On Fri, Aug 24, 2012 at 4:46 PM, Jennifer Sabatier wrote: > Hi Michael, > > No, I never use attach(), exactly for the reasons you state. To do > due diligence I did a search of code for the function and it didn't > come up (I would have been shocked because I never us it!). > > Now that real data

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Rui Barradas
No data arrived to me. Rui Barradas Em 24-08-2012 22:46, Jennifer Sabatier escreveu: Hi Michael, No, I never use attach(), exactly for the reasons you state. To do due diligence I did a search of code for the function and it didn't come up (I would have been shocked because I never us it!). N

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hi Michael, No, I never use attach(), exactly for the reasons you state. To do due diligence I did a search of code for the function and it didn't come up (I would have been shocked because I never us it!). Now that real data is up, does your suggestion still apply? I am reading it now. Thanks

[R] RJSONIO/rjson maximum depth?

2012-08-24 Thread Theodore Van Rooy
Hi All, has anyone run into maximum depth of nested JSON arrays in either rjson or RJSONIO ? I seem to be able to get up to 10 depth levels without problem, but crossing over to 11 either causes an error or fails to load the nodes properly. with RJSONIO I tried: a = fromJSON('data/myJSON.json',

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
Off the wall / wild guess, do you use attach() frequently? Not entirely sure how it would come up, but it tends to make weird errors like this occur. M On Fri, Aug 24, 2012 at 4:36 PM, Jennifer Sabatier wrote: > Hi Rui, > > Thanks so much for responding but I think with my HTML problem the vn >

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hi Rui, Thanks so much for responding but I think with my HTML problem the vn data you made must not be the same. I tried running your code on the data (I uploaded a copy) and I got the same thing I had before. Jen On Fri, Aug 24, 2012 at 5:28 PM, Rui Barradas wrote: > > 165114 1 0 0 0 0 417

Re: [R] Hosted R

2012-08-24 Thread Roebuck,Paul L
On 8/24/12 4:02 PM, "Matthew K. Hettinger" wrote: > I looked in the archives and couldn't find anything that really > addressed my question so here it is - > > Does anyone know of any web sites/environments that hosts R for free, > web-based, multi-user access to the R engine. My apologies if th

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
BTW - no one else who has replied to this topic was snobby or unfriendly and I thank you very much for trying to help me. It's just Bert is not the first to respond to my request for help as such. As someone looking forward to becoming an advanced R programmer in my statistical work it is discour

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Rui Barradas
Hello, Michael's standard guess, FAQ 7.31, was also mine, but is wrong. The error is in Jennifer's flag column, not the result of her ifelse. (!) x <- scan(what="character", text=" PM.EXP PM.DIST.TOT PM.DIST_flag 0 0 0 0 0 0 0 0 0 177502 1 0 31403 1 0 0 0 0 1100549 1 0 38762 1 0 0 0

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hi Peter, I'm really sorry, I thought I was in plain text. I don't use any formatting in my emails and in Gmail the HTML looks the same as plain text. Anyway, I've attached the data (I didn't think we could do that but I am frequently wrong). I say many cases because this is just a subset of >3

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Bert, I will thank you not to condescend to me, as I am too damn old (40) to be treated that way. You didn't even offer a solution to my problem. You only came to chastise me with regards to your assumptions about me, which is very annoying. While I am at the beginner level of R, I am not an idi

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Peter Ehlers
On 2012-08-24 13:22, Jennifer Sabatier wrote: Hi R-Helpers, I don't think I need to post a dataset for this question but if I do, I can. Anyway, I am having a lot of trouble with the ifelse command. Here is my code: vn$PM.DIST_flag <- ifelse( (vn$PM.EXP > 0.0) & (vn$PM.DIST.TOT != 1.0), 1, 0

[R] Hosted R

2012-08-24 Thread Matthew K. Hettinger
I looked in the archives and couldn't find anything that really addressed my question so here it is - Does anyone know of any web sites/environments that hosts R for free, web-based, multi-user access to the R engine. My apologies if the question is too simplistic for this forum. The reason I

Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread William Dunlap
Another strategy is to sort by month, id, and, in reverse order, distance and select the rows that start each month/id run. This can be much faster than the other ways when there are lots of month/id combinations. f1 <- function (DATA) { stopifnot(is.data.frame(DATA), a

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Bert Gunter
... and if Michael is correct, there is a lesson here: Think of how much time and aggravation you would have saved yourself if you had FIRST made an effort to read the docs. The FAQ's are there for a reason. As is An Introduction to R, which also should be read before posting on this list. If Mich

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Oops, sorry, I thought I was in plain text. I can't tell the difference because I use so little formatting in my emails. Try this (a truncated version since I have to hand space everything): PM.EXP PM.DIST.TOT PM.DIST_flag 0 00 6417 1

Re: [R] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
On Fri, Aug 24, 2012 at 3:22 PM, Jennifer Sabatier wrote: > Hi R-Helpers, > > I don't think I need to post a dataset for this question but if I do, I > can. Anyway, I am having a lot of trouble with the ifelse command. > You probably should have: dput() makes it super easy as well. > Here is my

[R] ifelse problem - bug or operator error

2012-08-24 Thread Jennifer Sabatier
Hi R-Helpers, I don't think I need to post a dataset for this question but if I do, I can. Anyway, I am having a lot of trouble with the ifelse command. Here is my code: vn$PM.DIST_flag <- ifelse( (vn$PM.EXP > 0.0) & (vn$PM.DIST.TOT != 1.0), 1, 0 ) And here is my output that doesn't make ANY

Re: [R] PHP escapeshellcmd() equivalent

2012-08-24 Thread Roebuck,Paul L
On 8/24/12 2:59 PM, "R. Michael Weylandt" wrote: > On Fri, Aug 24, 2012 at 2:48 PM, Roebuck,Paul > wrote: >> [Redirected from R-Devel...] >> >> Not that I recall running across such, but does R (or CRAN package) >> provide something equivalent to PHP's escapeshellcmd() function >> to escape she

Re: [R] Please help....normalization by the median of some control genes

2012-08-24 Thread Roebuck,Paul L
On 8/23/12 7:37 AM, "David Lyon" wrote: > Can someone show me some code to do normalization by the median of some > control genes for the example below? > Many Many Thanks in advance > > > This strategy selects a subset of genes (called ³control genes²) and makes the > median of their data distri

[R] SparseM buglet

2012-08-24 Thread Sam Steingold
read.matrix.csr does not close the connection: > library('SparseM') Package SparseM (0.96) loaded. > read.matrix.csr(foo) ... Warning message: closing unused connection 3 (foo) > -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://

Re: [R] PHP escapeshellcmd() equivalent

2012-08-24 Thread R. Michael Weylandt
I don't know PHP, but what does escapeshellcmd() provide over and above what system() / system2() do? Cheers, Michael On Fri, Aug 24, 2012 at 2:48 PM, Roebuck,Paul L wrote: > [Redirected from R-Devel...] > > Not that I recall running across such, but does R (or CRAN package) > provide something

[R] 2 (related) problems with RODBC in 64 bit Windows

2012-08-24 Thread Ivan Alves
Hi all, I am encountering an RODBC problem in R 2.15.1 in windows 64 bit which I do not encountered in the same set up in windows 32 bit (the latest binary version of RODBC in both cases from the same depository gotten by install.packages(‘RODBC’), Oracle ODBC client software installed in 64 an

Re: [R] if then in R versus SAS

2012-08-24 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Marc Schwartz > Sent: Friday, August 24, 2012 12:06 PM > To: ramoss > Cc: r-help@r-project.org > Subject: Re: [R] if then in R versus SAS > > > On Aug 24, 2012, at 1:03 PM, ramos

[R] PHP escapeshellcmd() equivalent

2012-08-24 Thread Roebuck,Paul L
[Redirected from R-Devel...] Not that I recall running across such, but does R (or CRAN package) provide something equivalent to PHP's escapeshellcmd() function to escape shell job control, wildcards, etc? __ R-help@r-project.org mailing list https://st

Re: [R] if then in R versus SAS

2012-08-24 Thread Marc Schwartz
On Aug 24, 2012, at 1:03 PM, ramoss wrote: > I am new to R and I have the following SAS statements: > > if otype='M' and ocond='1' and entry='a.Prop' then MOC=1; > else MOC=0; > > How would I translate that into R code? > > Thanks in advance See ?ifelse and ?Logic, both of which are covere

[R] if then in R versus SAS

2012-08-24 Thread ramoss
I am new to R and I have the following SAS statements: if otype='M' and ocond='1' and entry='a.Prop' then MOC=1; else MOC=0; How would I translate that into R code? Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/if-then-in-R-versus-SAS-tp4641225.html Sent

Re: [R] POSIXct-coerced NA's not considered NA by is.na()

2012-08-24 Thread Alexander Shenkin
Thanks for your reply, Jim. On 8/24/2012 12:14 PM, jim holtman wrote: > I think your first problem is the coersion done by 'c' when you are > mixing objects of various types: you have POSIXct and character. Yes, that's something I may have confounded. Still, the warning I'm getting is "In as.POSI

Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread Peter Ehlers
Here's another pretty straightforward solution, using the plyr pkg: DF <- data.frame(id, month, distance, bearing) # variables as defined in the OP require(plyr) DF1<-ddply(DF, .(id,month), summarize, maxdist = max(distance), maxbearing = bearing[which.max(distance)]) Peter

Re: [R] Concatenating data frames in R versus SAS

2012-08-24 Thread ramoss
I used summary <-rbind.fill(agency,prop) & it worked like a charm. Thanks everyone. -- View this message in context: http://r.789695.n4.nabble.com/Concatenating-data-frames-in-R-versus-SAS-tp4641138p4641219.html Sent from the R help mailing list archive at Nabble.com. _

[R] read/write data in libsvm format

2012-08-24 Thread Sam Steingold
How do I read/write libsvm data into/from R? The libsvm format is sparse data like [ :]* e.g., 1 10:3.4 123:0.5 34567:0.231 0.2 22:1 456:03 The "foreign" library does not seem to provide the necessary functionality. Any suggestions? Code? Thanks! http://stackoverflow.com/questions/12112558/

Re: [R] apply a function separately on each element of a list

2012-08-24 Thread Rui Barradas
Hello, Your example doesn't run, lmList needs a 'data' argument. set.seed(8109) d <- rep(1:10, each=10) x <- rnorm(100) e <- rnorm(100) y <- 2*x + e dat <- data.frame(x=x, y=y, d=d, e=e) model <- lmList(y ~ x | d, data = dat) predict(model) To the op: if you already have the larger data.farme

Re: [R] POSIXct-coerced NA's not considered NA by is.na()

2012-08-24 Thread jim holtman
I think your first problem is the coersion done by 'c' when you are mixing objects of various types: you have POSIXct and character. What were your expections? > x <- Sys.time() > str(x) POSIXct[1:1], format: "2012-08-24 13:12:31" > y <- c(x, 'b') > str(y) POSIXct[1:2], format: "2012-08-24 13:1

[R] help with a special variant of balloonplot

2012-08-24 Thread ravi
Hi, I am interested in implementing a special variant of balloonplot.  Let me explain with an example dataset from the reference manual : library(gplots) data(Titanic) dframe<-as.data.frame(Titanic) survived<-dframe[dframe$Survived=="Yes",] attach(survived) balloonplot(x=Class,y=list(Age,Sex),z=F

Re: [R] Extracting data from dataframe with tied rows

2012-08-24 Thread William Dunlap
Or use ave() to compute the within-group ranks (reversed, so max has rank 1) and select the elements whose ranks are 1: f2 <- function (DATA) { stopifnot(is.data.frame(DATA), all(c("distance", "id", "month") %in% names(DATA))) revRanks <- ave(DATA[["distance"]], DATA[["id"]], DAT

Re: [R] (no subject)

2012-08-24 Thread Rui Barradas
Hello, You must post a data example to get some help. Use dput( head(tth, 50) ) # paste the output of this in a post As for the warnings, they are not errors. They are telling you that it can't make a replacement. substitute(x) is probably returning NULL and the aggregate return value's colu

Re: [R] Pseudo R squared in gls model

2012-08-24 Thread Mike Miller
On Thu, 23 Aug 2012, Gary Dong wrote: I'm wondering if the gls function reports pseudo R. I do not see it by summary(). If the package does not report, can I calculate it in this way? Adjusted pseudo R squared = 1 - [(Loglik(beta) - k ) / Loglik(null)] where k is the number of IVs. We've b

Re: [R] (no subject)

2012-08-24 Thread jim holtman
What are your expectations as to what "length(names(tth$Mins.to.hospital))" should be returning? You need to at least provide some data so we can reproduce the error, or 'str(tth)'. My guess is that tth$Mins.to.hospital does not have any 'names' attributes and therefore your error. So what is th

[R] apply a function separately on each element of a list

2012-08-24 Thread jeff6868
Hi everybody, I have a question about applying a specific function (with the calculations I want to do), on a list of elements. Each elements are like a data.frame (with nrows and ncolumns), and have the same structure. At frist, I had a big data.frame that I splitted in all my elements of my lis

Re: [R] Euclidean distance function

2012-08-24 Thread Rui Barradas
Hello, You don't need to write a function. Try the following. nms <- paste0("species", 1:4) mat <- matrix(rnorm(16), ncol=4, dimnames = list(nms, nms)) ?dist dist(mat) dist(mat, diag = TRUE, upper = TRUE) Hope this helps, Rui Barradas Em 24-08-2012 11:56, Arbuckle escreveu: Hi, I should pr

Re: [R] apply a function separately on each element of a list

2012-08-24 Thread Daniel Malter
The easiest way may be to use lmList in the nlme library: #simulate data d<-rep(1:10,each=10) x<-rnorm(100) e<-rnorm(100) y<-2*x+e require(nlme) #or install and load package lmList(y~x|d) #predicted values are obtained with: predict(lmList(y~x|d) HTH, Daniel jeff6868 wrote > > Hi everyb

Re: [R] Euclidean distance function

2012-08-24 Thread Arbuckle
Thank you kindly for both of the replies I've received, that does indeed work perfectly. I had been looking at the description of that function and it reads as though it only deals with 2-dimensional data. Thanks again! Kev -- View this message in context: http://r.789695.n4.nabble.com/Euclide

[R] (no subject)

2012-08-24 Thread Lynn Hutchings
I'm very new to R and just finding my way, so be gentle! I've hit a swift halt doing some summary statistics on a simple continuous data field, divided into two categories. I'm getting the following error message. I am unclear why length(names(tth$Mins.to.hospital)) is zero and how to alter t

Re: [R] R minimal calculation error

2012-08-24 Thread Petr Savicky
On Fri, Aug 24, 2012 at 12:48:54PM +0200, Frederik Bertling wrote: > Hi, > > I'm doing some easy calculations to normalize some values. This looks like > this: > > x=mean(a+b+c+d ...) > a=a-x > b=b-x > c=c-x > d=d-x > ... > mean(a+b+c+d ...) ---> Should now be 0! > However, I'm getting results li

[R] POSIXct-coerced NA's not considered NA by is.na()

2012-08-24 Thread Alexander Shenkin
Hello folks, I found a strangeness while experimenting with POSIXct vectors and lists. It seems that coerced NA's aren't "real" NAs, at least as considered by is.na()? > date_vec = c(as.POSIXct(now()), as.POSIXct(now()+1),NA,"b") > date_vec [1] "2012-08-22 15:00:46 COT" "2012-08-22 15:00:47 COT"

Re: [R] Why was my R process killed spontaneously?

2012-08-24 Thread Jeff Newmiller
Yes, the resources operating systems usually kill for are memory. No, you have not provided a reproducible example. In general, you need to do something different, such as choose a different algorithm, run on a different computer, or split your problem into smaller pieces. --

Re: [R] Euclidean distance function

2012-08-24 Thread Jean V Adams
Kev, The dist() function handles more than 2 dimensions. Using the example you provided ... mydat <- structure(list(Species = c("spA", "spB", "spC", "spD"), x = c(2.9, 5.5, 1.4, 8.3), y = c(34.2, 46.5, 48.6, 56.1), z = c(0.54, 0.45, 0.84, 0.48), n = c(15.7, 19.

Re: [R] R minimal calculation error

2012-08-24 Thread Rui Barradas
Hello, This is FAQ 7.31 Why doesn't R think these numbers are equal? As for your second question whether this behavior is desirable I think so, we should be aware that floating-point arithmetics has limits. In your case, a precision limit. At an R pompt run the instructions ?.Machine .Machin

Re: [R] Error while installing gsubfn_0.6-4.tar.gz for R 2.15.1

2012-08-24 Thread Gabor Grothendieck
Sorry, I just double checked and the options statement should be: options(gsubfn.engine = "R") Again, I am not sure if that is sufficient given that there is clearly something wrong with your version of R. On Fri, Aug 24, 2012 at 8:59 AM, Gabor Grothendieck wrote: > I have never seen that befor

Re: [R] Error while installing gsubfn_0.6-4.tar.gz for R 2.15.1

2012-08-24 Thread Gabor Grothendieck
I have never seen that before. It has been independently verified that gsubfn works on Fedora Red Hat as you can see here: http://cran.r-project.org/web/checks/check_results_gsubfn.html The message about Tcl/Tk in your log suggests that there is something wrong with your version of R itself. See

Re: [R] patchDVI: how to pass encoding of the .Rnw file?

2012-08-24 Thread Marius Hofert
Dear Duncan, many thanks for helping. It works fine. Cheers, Marius Duncan Murdoch writes: > On 12-08-19 3:47 PM, Marius Hofert wrote: >> Dear Duncan, >> >> I recently asked a question concerning patchDVI on r-help, see >> >> , >> | https://stat.ethz.ch/pipermail/r-help/2012-August/321780

Re: [R] R minimal calculation error

2012-08-24 Thread Marc Schwartz
On Aug 24, 2012, at 5:48 AM, Frederik Bertling wrote: > Hi, > > I'm doing some easy calculations to normalize some values. This looks like > this: > > x=mean(a+b+c+d ...) > a=a-x > b=b-x > c=c-x > d=d-x > ... > mean(a+b+c+d ...) ---> Should now be 0! > However, I'm getting results like -2.3152

Re: [R] Random effects in gam (mgcv 1.7-19)

2012-08-24 Thread Simon Wood
Silje, Thanks for reporting this. Should be fixed for version 1.7-20 (but please let me know if not!) best, Simon On 14/08/12 12:08, silje skår wrote: Hi, I am using the gam function in the mgcv package, I have random effects in my model (bs="re") this has worked fine, but after I updated t

Re: [R] Branch and Bound

2012-08-24 Thread Noia Raindrops
Hi, Do you try 'RSiteSearch("Branch Bound")'? -- Noia Raindrops noia.raindr...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

[R] Euclidean distance function

2012-08-24 Thread Arbuckle
Hi, I should preface this problem with a statement that although I am sure this is a really easy function to write, I have tried and failed to get my head around writing functions in R. I can use R where functions exist to do what I want done, but have found myself completely incapable of writing

[R] Branch and Bound

2012-08-24 Thread Davila David
Hi,  Is there a Branch and Bound routines or library for R?.  Thanks, David __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide comment

Re: [R] Why was my R process killed spontaneously?

2012-08-24 Thread flora flora
Thanks for your reply. Does what you said by resources mean memory or something else? Inside my loop, I removed the objects that are created but not used by the next loop and did garbage collection as well. Do you have any idea how I should modify my code such that the system won't kill it? Thanks

[R] R minimal calculation error

2012-08-24 Thread Frederik Bertling
Hi, I'm doing some easy calculations to normalize some values. This looks like this: x=mean(a+b+c+d ...) a=a-x b=b-x c=c-x d=d-x ... mean(a+b+c+d ...) ---> Should now be 0! However, I'm getting results like -2.315223e-18 This is really near to 0 but not very aesthetic. Can I prevent this? Or is

Re: [R] plot curve on surface

2012-08-24 Thread S Ellison
> I would like to plot a curve (in color red) on a surface in a 3D plot. Perhaps trans3d would be relevant? ?persp 's examples include an example of adding a line to a 3d plot using trans3d S *** This email and any attachments are

[R] plot curve on surface

2012-08-24 Thread Michael Meyer
Greetings, I would like to plot a curve (in color red) on a surface in a 3D plot. Say     x <- as.vector(seq(-1,1,0.2))     dim(x) <- c(length(x),1)     y <- as.vector(seq(-1,1,0.2))     dim(y) <- c(1,length(y))         z <- x%*%y # (x_iy_j) # 3D plot of z(x,y)=xy: persp(x,y,z

Re: [R] select most frequent value in set of variables

2012-08-24 Thread Sam Dekeyser
Hi, Shortly after my first post I posted an answer including the fix I found; which seems to work. Through the archives I found that my code snippet got filtered out and appended as an attachment (which was not my intent). This was my suggestion: for(i in seq(length(ss$name))) { color

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread Petr Savicky
On Thu, Aug 23, 2012 at 09:49:33PM -0700, Gopi Goteti wrote: > I would like to know whether there is a faster way to do the below > operation (updating vec1). > > My objective is to update the elements of a vector (vec1), where a > particular element i is dependent on the previous one. I need to d

[R] diagonal matrix, array attributes and how to keep from setting an attribute on "NULL"

2012-08-24 Thread aleksandr russell
Hello, I've put the short version here and if anyone wants to run the code with CollocInfer, I've given the full version in the file "analysis". I come at the question of array attributes and dimnames to try to simplify. In a CollocInfer LS.profile analysis using this array 'Y' constructed as

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread Noia Raindrops
Hello, Each block of probs range from p00 to p10 is last value before the block. Example: probs: .1 .1 .5 .5 .5 .9 .9 vec1 : 0 0 0 0 0 1 1 probs: .9 .9 .5 .5 .5 .1 .1 vec1 : 1 1 1 1 1 0 0 So you can eliminate a loop. # modification f5 <- function () { vec1 <- as.num

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread Petr Savicky
On Fri, Aug 24, 2012 at 10:34:14AM +0200, Petr Savicky wrote: > On Thu, Aug 23, 2012 at 09:49:33PM -0700, Gopi Goteti wrote: > > I would like to know whether there is a faster way to do the below > > operation (updating vec1). > > > > My objective is to update the elements of a vector (vec1), wher

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread PIKAL Petr
Hi Well, I am not sure if this is what you want but same result can be achieved by vec1 <- (probs>=p00)*(probs>=p10) Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Gopi Goteti > Sent: Friday, August 24, 2012 6:50 AM

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread Petr Savicky
On Thu, Aug 23, 2012 at 09:49:33PM -0700, Gopi Goteti wrote: > I would like to know whether there is a faster way to do the below > operation (updating vec1). > > My objective is to update the elements of a vector (vec1), where a > particular element i is dependent on the previous one. I need to d

Re: [R] updating elements of a vector sequentially - is there a faster way?

2012-08-24 Thread Berend Hasselman
On 24-08-2012, at 06:49, Gopi Goteti wrote: > I would like to know whether there is a faster way to do the below > operation (updating vec1). > > My objective is to update the elements of a vector (vec1), where a > particular element i is dependent on the previous one. I need to do this on > vec

Re: [R] Regular expressions: stuck again...

2012-08-24 Thread Noia Raindrops
Hello, try this: x <- c("SELECT [public_tblFiche].[Fichenr], [public_tblArtnr].[Artnr]", "SELECT public_tblFiche.Fichenr, public_tblArtnr.Artnr") # > The square backets [ and ] should removed x <- gsub("[][]", "", x) # > and xxx_xxx.xxx should become \"xxx\".\"xxx\"\".\"xxx\" x <- gsub("([[:al

[R] cygwin utf-8 problem with "help"

2012-08-24 Thread Ralf Goertz
Hi, In R under cygwin I have trouble to correctly display help in text format. One problem arises when there are single qoutes in the text like in "?help" which looks like this helppackage:utils R Documentation Documentation Description: Usage: he

[R] Steps for installing RHBASE library for R

2012-08-24 Thread Divya Kakkillaya B
Hi, Can someone please tell me what are the steps to follow for installing RHBASE library for R 2.15.1. Regards, Divya CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If yo