Re: [R] Euclidean Distance in 3 Dimensions

2014-08-22 Thread Patzelt, Edward
This function unfortunately does not work in 3d space. Thoughts? On Wed, Aug 20, 2014 at 4:57 PM, Don McKenzie d...@u.washington.edu wrote: ?dist from the help dist {stats}R Documentation Distance Matrix Computation Description This function computes and returns the distance

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-22 Thread Patzelt, Edward
Your first description is correct with slight modification compare point 1 to all the other points in that Cluster.Index and see if any of euclidean distances are greater than 8; do this for each point (i.e. point 2, point 3) in that specific Cluster.Index (i.e. 45) On Thu, Aug 21, 2014 at

[R] Subsetting data for split-sample validation, then repeating 1000x

2014-08-22 Thread Angela Boag
Hi all, I'm doing some within-dataset model validation and would like to subset a dataset 70/30 and fit a model to 70% of the data (the training data), then validate it by predicting the remaining 30% (the testing data), and I would like to do this split-sample validation 1000 times and average

Re: [R] loading saved files with objects in same names

2014-08-22 Thread Martin Maechler
Have you tried the 'envir' argument to load()? E.g., envA - new.environment() load(A.RData, envir=envA) envB - new.environment() load(B.RData, envir=envB) plot(A$object, B$object) Bill Dunlap TIBCO Software wdunlap tibco.com An alternative that I have been advocating is

[R] Help on installing R packages in a Citrix

2014-08-22 Thread Jon-Paul Cameron
Hi We are currently trying to migrate 3 users of R to a citrix based environment, but are coming across major issues trying to install the packages to the relevant image. Can someone please contact me around how the install should be done - as we can find no supporting documentation or help

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread David Winsemius
On Aug 22, 2014, at 12:36 AM, Jon-Paul Cameron wrote: Hi We are currently trying to migrate 3 users of R to a citrix based environment, Windows?, Linux? Citrix isn't usually thought of as an OS is it? but are coming across major issues trying to install the packages to the relevant

Re: [R] no visible binding for global variable and with() vs. within()

2014-08-22 Thread Martin Maechler
Rolf Turner r.tur...@auckland.ac.nz on Mon, 18 Aug 2014 08:47:36 +1200 writes: On 17/08/14 23:05, Duncan Murdoch wrote: On 16/08/2014, 9:36 PM, Daniel Braithwaite wrote: R CMD check does not object to this code when checking a package: foo1 - function (bar) {

Re: [R] loading saved files with objects in same names

2014-08-22 Thread Martin Maechler
On 20/08/2014, 8:58 AM, Barry Rowlingson wrote: On Tue, Aug 19, 2014 at 1:30 AM, Jinsong Zhao jsz...@yeah.net wrote: Hi there, I have several saved data files (e.g., A.RData, B.RData and C.RData). In each file, there are some objects with same names but different contents. Now, I need

[R] knitr and stopifnot replacement.

2014-08-22 Thread Bart Kastermans
I have a daily generated report in which I put a check using stopifnot. Unfortunately I didn’t check the effect very well, turns out that if the condition checked fails this is not shown in the knitr output (I only get an error much later due to a missing object). So my question is, what is

Re: [R] knitr and stopifnot replacement.

2014-08-22 Thread Duncan Murdoch
On 22/08/2014, 6:02 AM, Bart Kastermans wrote: I have a daily generated report in which I put a check using stopifnot. Unfortunately I didn’t check the effect very well, turns out that if the condition checked fails this is not shown in the knitr output (I only get an error much later due

Re: [R] knitr and stopifnot replacement.

2014-08-22 Thread Bart Kastermans
On 22 Aug 2014, at 12:39, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 22/08/2014, 6:02 AM, Bart Kastermans wrote: I have a daily generated report in which I put a check using stopifnot. Unfortunately I didn’t check the effect very well, turns out that if the condition checked fails

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread S Ellison
We are currently trying to migrate 3 users of R to a citrix based environment, but are coming across major issues trying to install the packages to the relevant image. Why can't you open a virtualised OS instance, install and start R in the normal way, install the packages normally in R

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread arnaud gaboury
On Fri, Aug 22, 2014 at 2:03 PM, S Ellison s.elli...@lgcgroup.com wrote: We are currently trying to migrate 3 users of R to a citrix based environment, but are coming across major issues trying to install the packages to the relevant image. Please be more precised in your issue.

[R] Help with analysis of variance

2014-08-22 Thread McCulloch, Andrew
Hi, I have an observational dataset which consists of eight annual observations (year) for children (id) recording the rate of unemployment in the neighbourhood in which they lived (rate). I know if children move home so the data also has an identifier for spells in the same neighbourhood

[R] print vectors with consecutive numbers

2014-08-22 Thread James Wei
Hi all, I have a matrix with consecutive and non-consecutive numbers in columns. For example, the first 2 columns have consecutive numbers. I want R to print only columns with consecutive numbers. Here is the matrix and how I did using conditional statement: ##

Re: [R] print vectors with consecutive numbers

2014-08-22 Thread Jorge I Velez
Hi James, Try mat[, apply(mat, 2, function(x) any(diff(x) == 1))] HTH, Jorge.- On Fri, Aug 22, 2014 at 10:18 PM, James Wei zwei0...@hotmail.com wrote: Hi all, I have a matrix with consecutive and non-consecutive numbers in columns. For example, the first 2 columns have consecutive

Re: [R] Help with analysis of variance

2014-08-22 Thread Richard M. Heiberger
Andrew, I plotted your data first. Then I made id, spell, year into factors and did the ANOVA. From the graph, it looks like the two ids who had more than one spell show variability in rate. The ANOVA table agrees by showing high significance for the id:spell interaction. The numbers in this

Re: [R] knitr and stopifnot replacement.

2014-08-22 Thread Yihui Xie
Yep, that is exactly the answer. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Web: http://yihui.name On Fri, Aug 22, 2014 at 6:35 AM, Bart Kastermans kaste...@kasterma.net wrote: On 22 Aug 2014, at 12:39, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 22/08/2014, 6:02 AM, Bart

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-22 Thread William Dunlap
This function unfortunately does not work in 3d space. [I think 'this' is refering to the 'dist' function.] Can you show how it is not working for you? I.e., what does it produce compared to what you want for a given input? dist() does work on a 3-column (or n-column) matrix or data.frame,

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread David Winsemius
On Aug 22, 2014, at 7:37 AM, Chirag Patel wrote: Hi David I have installed R Version 2.15.1 on the image but having problems install rcom and rscproxy. Those are commercial packages and not maintained or supported by R-Core (That is also a rather old version of R and would have gotten

Re: [R] print vectors with consecutive numbers

2014-08-22 Thread James Wei
Hi Jorge, Thanks so much, it is working perfectly. There are so many for me to learn. Cheers. James From: jorgeivanve...@gmail.com Date: Fri, 22 Aug 2014 22:28:40 +1000 Subject: Re: [R] print vectors with consecutive numbers To: zwei0...@hotmail.com CC: r-help@r-project.org Hi James,

Re: [R] print vectors with consecutive numbers

2014-08-22 Thread Bert Gunter
Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. Clifford Stoll On Fri, Aug 22, 2014 at 7:16 AM, James Wei zwei0...@hotmail.com wrote: Hi Jorge, Thanks so much, it is working

Re: [R] Help on installing R packages in a Citrix

2014-08-22 Thread David Winsemius
On Aug 22, 2014, at 9:13 AM, David Winsemius wrote: On Aug 22, 2014, at 7:37 AM, Chirag Patel wrote: Hi David I have installed R Version 2.15.1 on the image but having problems install rcom and rscproxy. Those are commercial packages and not maintained or supported by R-Core I

Re: [R] loading saved files with objects in same names

2014-08-22 Thread Jinsong Zhao
On 2014/8/22 1:02, Martin Maechler wrote: Have you tried the 'envir' argument to load()? E.g., envA - new.environment() load(A.RData, envir=envA) envB - new.environment() load(B.RData, envir=envB) plot(A$object, B$object) Bill Dunlap TIBCO Software wdunlap tibco.com

Re: [R] filled.contour key axis

2014-08-22 Thread Lietz, Haiko
Hi Jim, all, Thx, I was hoping for percentage scores, such that R puts numbers with % there. And by automatically labeling I meant giving the axis a title, sorry for mixing that up. I havn't found an option in the parameters for filled.contour. Haiko

Re: [R] no visible binding for global variable and with() vs. within()

2014-08-22 Thread Henrik Bengtsson
I'm dealing with these type of false NOTEs as: foo1 - function (bar) { # To please R CMD check x - NULL; rm(list=x) with(bar, { x }) } Of course, that may one day break with more clever code inspections. My $.02 /Henrik On Fri, Aug 22, 2014 at 2:40 AM, Martin Maechler

Re: [R] filled.contour key axis

2014-08-22 Thread Jeff Newmiller
You seem to be thinking of Excel. R does not dress up numbers for you... if you want them represented in a particular way, you need to format them into a character string. There are plenty of options for doing that. --- Jeff

Re: [R] Subsetting data for split-sample validation, then repeating 1000x

2014-08-22 Thread David L Carlson
You can use replicate() or a for (i in 1:1000){} loop to do your replications, but you have other issues first. 1. You are sampling with replacement which makes no sense at all. Your 70% sample will contain some observations multiple times and will use less than 70% of the data most of the

Re: [R] Subsetting data for split-sample validation, then repeating 1000x

2014-08-22 Thread David L Carlson
Combine your code into a function: Plant - function() { train - sample.int(nrow(A), floor(nrow(A)*.7)) test - (1:nrow(A))[-train] A.model - glmmadmb(nat.r ~ isl.sz + nr.mead, random = ~ 1 | site, family = poisson, data = A[train,]) cor(Atest$nat.r, predict(A.model, newdata

Re: [R] loading saved files with objects in same names

2014-08-22 Thread Duncan Murdoch
On 22/08/2014, 1:14 PM, Jinsong Zhao wrote: On 2014/8/22 1:02, Martin Maechler wrote: Have you tried the 'envir' argument to load()? E.g., envA - new.environment() load(A.RData, envir=envA) envB - new.environment() load(B.RData, envir=envB) plot(A$object, B$object)

Re: [R] BNF description for R

2014-08-22 Thread kevin2059
Thank you,that help a lot. At 2014-08-17 19:09:00,Duncan Murdoch murdoch.dun...@gmail.com wrote: On 16/08/2014, 7:32 PM, kevin2059 wrote: HOW can I get a completely BNF description for R? I try to write a parser for R now. The R grammar is defined in the src/main/gram.y file (in Bison

Re: [R] filled.contour key axis

2014-08-22 Thread Jim Lemon
On Fri, 22 Aug 2014 05:36:23 PM Lietz, Haiko wrote: Hi Jim, all, Thx, I was hoping for percentage scores, such that R puts numbers with % there. And by automatically labeling I meant giving the axis a title, sorry for mixing that up. I havn't found an option in the parameters for