Re: [R] vectors as function input

2012-08-24 Thread Daniel Malter
The function you programed expects you to provide 7 arguments. In the first case, you explicitly specify each of the seven arguments, i.e., you tell the function: this is yu, this is yf, and so forth. In the second case, you only specify 2 arguments, t and par[1,1:16]. So the function thinks that

[R] A question about GRAMMAR calculations in the FAM_MDR algorithm

2012-08-24 Thread jinwei wang
Dear R developers: I am a PHD candidate student in the school of public health of Peking University and my major is genetic epidemiology. I am learning the FAM-MDR algorithm, which is used to detect the gene-gene and gene-environment interactions in the data of pedigree. The codes were written

[R] Regular expressions: stuck again...

2012-08-24 Thread Bart Joosen
Hi, I'm currently reworking a report, originating from a MS Access database, but should be implemented in R. Now I'm facing the task to convert a lot of queries to postgreSQL. What I want to do is make a function which takes the MS Access query as an argument and returns the pgSQL version. So:

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

2012-08-24 Thread Gopi Goteti
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 vectors that are 1 million or longer and need to repeat that

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

2012-08-24 Thread Divya Kakkillaya B
Hi, I am getting the follwoing error while installing gsubfn_0.6-4.tar.gz library for R. R version is 2.15.1 and i am installing on Redhat linux version 2.6.18-238.9.1.el5 (mockbu...@x86-002.build.bos.redhat.commailto:mockbu...@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red

[R] Error while installing RODBC_1.3-6.tar.gz on Redhat linux

2012-08-24 Thread Divya Kakkillaya B
Hi, I am facing an issue while installing RODBC library on Redhat Linux version 2.6.18-238.9.1.el5 (mockbu...@x86-002.build.bos.redhat.commailto:mockbu...@x86-002.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)) Warning: invalid package

[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

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

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 -

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 vectors

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 do

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 To:

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), where a

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 -

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

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

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

[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

[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

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

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

Re: [R] R minimal calculation error

2012-08-24 Thread Marc Schwartz
On Aug 24, 2012, at 5:48 AM, Frederik Bertling frederik.bertl...@stud.uni-due.de 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

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 murdoch.dun...@gmail.com writes: On 12-08-19 3:47 PM, Marius Hofert wrote: Dear Duncan, I recently asked a question concerning patchDVI on r-help, see , |

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.

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 ggrothendi...@gmail.com wrote: I have

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

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.4, 24.8,

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.

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

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 like

[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

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:

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

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

[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

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 the

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

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

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]], DATA[[month]],

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

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:12:31 NA

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

[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 class/target[ attribute number:attribute value]* 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!

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.

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

[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] if then in R versus SAS

2012-08-24 Thread Marc Schwartz
On Aug 24, 2012, at 1:03 PM, ramoss ramine.mossad...@finra.org 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

[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

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

[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

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 proeb...@mdanderson.org wrote: [Redirected from R-Devel...] Not that I recall running across such, but does R (or CRAN package)

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

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 david_ly...@yahoo.com 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

Re: [R] PHP escapeshellcmd() equivalent

2012-08-24 Thread Roebuck,Paul L
On 8/24/12 2:59 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: On Fri, Aug 24, 2012 at 2:48 PM, Roebuck,Paul proeb...@mdanderson.org wrote: [Redirected from R-Devel...] Not that I recall running across such, but does R (or CRAN package) provide something equivalent to PHP's

[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] ifelse problem - bug or operator error

2012-08-24 Thread R. Michael Weylandt
On Fri, Aug 24, 2012 at 3:22 PM, Jennifer Sabatier plessthanpointohf...@gmail.com 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

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

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

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

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

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

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 0

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

Re: [R] Hosted R

2012-08-24 Thread Roebuck,Paul L
On 8/24/12 4:02 PM, Matthew K. Hettinger mkhettin...@mathet.com 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

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 ruipbarra...@sapo.pt wrote:

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 plessthanpointohf...@gmail.com wrote: Hi Rui, Thanks so much for responding but I think

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

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.

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

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

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 michael.weyla...@gmail.com wrote: On Fri, Aug 24, 2012 at 4:46 PM, Jennifer Sabatier plessthanpointohf...@gmail.com wrote: Hi Michael, No, I never use attach(), exactly for the reasons you state. To do due diligence I did a search of code

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 ruipbarra...@sapo.pt wrote: No data arrived to me. Rui Barradas Em

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

[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

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

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

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

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

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,

Re: [R] PHP escapeshellcmd() equivalent

2012-08-24 Thread Yihui Xie
You probably mean shQuote(). Regards, Yihui -- Yihui Xie xieyi...@gmail.com 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 proeb...@mdanderson.org wrote: On 8/24/12 2:59 PM,

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

Re: [R] date

2012-08-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
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

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 #