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

2014-08-21 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 th

Re: [R] Euclidean Distance in 3 Dimensions

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

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 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 3:

Re: [R] bam (mgcv) not using the specified number of cores

2014-08-21 Thread Andrew Crane-Droesch
Hi Simon, (resending with all images as imgur so as to not bounce from list) Thanks for the reply. I've tried to reproduce the error, but I don't know how to show output from `top` any other way than with screenshots, so please excuse that. Here are screenshots of what happens when I run wi

Re: [R] hadley's book

2014-08-21 Thread PO SU
Haha, i have already read the advanced r programming part of the book. As you said, it will be quite popular in future years. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-08-22 04:57:01, "Mark Leeds" wrote: >I have a feeling hadley's book will be quite popu

Re: [R] Help to install package "mlegp"

2014-08-21 Thread Gyanendra Pokharel
Thanks Uwe! I re-install R and re-install the package "mlegp" and I successfully installed it. Thanks again ! Gyan Gyanendra Pokharel University of Guelph Guelph, ON On Thu, Aug 21, 2014 at 6:36 PM, Uwe Ligges wrote: > > > On 22.08.2014 00:15, Gyanendra Pokharel wrote: > >> Hi R users, >> >>

Re: [R] Help to install package "mlegp"

2014-08-21 Thread Uwe Ligges
On 22.08.2014 00:15, Gyanendra Pokharel wrote: Hi R users, I have successfully downloaded the package "mlegp", but when I tried installing it says the following massage. package ‘mlegp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘mlegp’ l

[R] Help to install package "mlegp"

2014-08-21 Thread Gyanendra Pokharel
Hi R users, I have successfully downloaded the package "mlegp", but when I tried installing it says the following massage. package ‘mlegp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘mlegp’ > library(mlegp) Error in library(mlegp) : there is n

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread David L Carlson
So these two commands split the data frame by Cluster.Index and save them as a list, Clusters and then compute distance matrices on each group and save them as a list, Dists: Clusters <- split(dta, dta$Cluster.Index) Clusters Dists <- lapply(Clusters, dist) Dists You should be able to process t

Re: [R] How to view the whole dataset that is imported through sasxport.get

2014-08-21 Thread David Winsemius
On Aug 21, 2014, at 10:59 AM, Jun Shen wrote: > David, > Thanks for your reply. > Here is some of the output of str() > > 'data.frame': 1991 obs. of 5 variables: > $ SID :Class 'labelled' atomic [1:1991] 01018 01018 01018 01018 ... > .. ..- attr(*, "label")= chr "Subject ID" > $ DV :Class

[R] hadley's book

2014-08-21 Thread Mark Leeds
I have a feeling hadley's book will be quite popular so just a heads up that it can now be pre-ordered on amazon. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] How to view the whole dataset that is imported through sasxport.get

2014-08-21 Thread MacQueen, Don
So it¹s now pretty clear that sasexport.get() gave each variable in the data frame a class of ³labelled². The fix() function likely does not know what to do with that class. So you want to get rid of the labels, and possibly other attributes. I¹s suggest you study the Hmisc help pages for informat

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread David L Carlson
The dist() function works just fine in 2d or 3d or 100d. Your description of what you want to accomplish is not clear. Your code compares rows 1 and 2, then 2 and 3, then 3 and 4, and so on. You are comparing only adjacent points, but your description makes it sound like you want to compare poin

Re: [R] Euclidean Distance in 3 Dimensions

2014-08-21 Thread Don McKenzie
Ugh sorry. I misread your message obviously. Cc�ing back to the list (as is the protocol) I�m surprised no one else has replied. I�m a lightweight compared to others on the list. It looks as if the dist() function has compiled code, which suggests that there is some gnarly linear algebra unde

Re: [R] How to view the whole dataset that is imported through sasxport.get

2014-08-21 Thread Jun Shen
David, Thanks for your reply. Here is some of the output of str() 'data.frame': 1991 obs. of 5 variables: $ SID :Class 'labelled' atomic [1:1991] 01018 01018 01018 01018 ... .. ..- attr(*, "label")= chr "Subject ID" $ DV :Class 'labelled' atomic [1:1991] NA 8.52 463 364 240 278 237 167 8

[R] R version of MATLAB interpn?

2014-08-21 Thread Steven M. Matz
Is there an existing R function to perform n-dimensional linear interpolation, like MATLAB's interpn ( http://www.mathworks.com/help/matlab/ref/interpn.html; a Python version is here: https://github.com/scipy/scipy/issues/2246#issuecomment-17028264)? My searches didn't turn up anything. Maybe not

Re: [R] require() but for source()d files

2014-08-21 Thread Henrik Bengtsson
On Aug 21, 2014 7:40 AM, "Ivan Calandra" wrote: > > Dear useRs, > > I'm looking for something like require() but which will work on source()d files. > > I have a .R file with lots of functions and I'm writing a new function (say, 'foo') that depends on the functions from this file. > > Until now,

Re: [R] How to view the whole dataset that is imported through sasxport.get

2014-08-21 Thread David Winsemius
On Aug 21, 2014, at 7:20 AM, Jun Shen wrote: > Dear list, > > I used sasxport.get to import a SAS xpt file. Although it is a data frame > but i can't view it through the "fix" command. Also when I see its > structure, it brings up attributes I am not really interested in (which > seems part of t

Re: [R] Error - "cannot coerce type 'closure' to vector of type 'character' "

2014-08-21 Thread Rui Barradas
Hello, 'points' is an R function (a closure) and either readOGR() or sub() or both are expecting a vector. Use a different name, like pnts. Hope this helps, Rui Barradas Em 21-08-2014 10:00, Girija Kalyani escreveu: Dear group, Im new to R, I find it comfortable using this with the help of

[R] require() but for source()d files

2014-08-21 Thread Ivan Calandra
Dear useRs, I'm looking for something like require() but which will work on source()d files. I have a .R file with lots of functions and I'm writing a new function (say, 'foo') that depends on the functions from this file. Until now, I have always source()d the .R file before running 'foo'.

Re: [R] anova

2014-08-21 Thread Bert Gunter
... and you do get P values; you just don't understand what you're looking at, which is more or less what you said. This is not a statistical help site. You should seek local statistical consulting advice or post on a statistical help site (caveat emptor!) like stats.stackexchange.com, not here.

Re: [R] file.show() may have some bug?

2014-08-21 Thread Jeff Newmiller
Answering your questions is a "trouble thing" also. You are asked to solve those problems that already have easy fixes on your own, first, to make reproducing your problem on our end less mysterious. The Posting Guide is intended to help you to help us identify your problem... please use it. It

Re: [R] anova

2014-08-21 Thread Sarah Goslee
Hi Lynn, Please read the posting guide, this document: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and don't post in HTML. (See your own email copied below for why.) Sarah On Thu, Aug 21, 2014 at 6:08 AM, Lynn Govaert wrote: > Hi all, > > I have troubl

Re: [R] anova

2014-08-21 Thread Lynn Govaert
I pressed enter to soon. Again Hi all, I have troubles with doing an anova. So I have the following variables: a variable group with two levels, a continuous variable trait and within each group we have 12 organisms (clone) and for each clone we have 5 replicates. So we want to see if for the va

[R] anova

2014-08-21 Thread Lynn Govaert
Hi all, I have troubles with doing an anova. So I have the following variables: a variable group with two levels, a continuous variable trait and within each group we have 12 organisms (clone) and for each clone we have 5 replicates. So we want to see if for the variable trait the two groups diffe

[R] Error - "cannot coerce type 'closure' to vector of type 'character' "

2014-08-21 Thread Girija Kalyani
Dear group, Im new to R, I find it comfortable using this with the help of tutorials, But Im stuck up at a point when I run - points= readOGR(points,sub(".shp","",points)) it shows the error- "cannot coerce type 'closure' to vector of type 'character' ". What could it be. With my browse efforts, I

[R] Calculating contrasts in Anova with interaction term

2014-08-21 Thread Lynn Govaert
Hi all, I have the following variables: a trait z, Treatment A and B, Population 1 and 2 (each having undergo the treatment), and their interaction. Now, I'm doing an Anova as follows aov( z ~ Treatment * Population ) I now want to compare the values of population 1 which underwent treatment A

[R] How to view the whole dataset that is imported through sasxport.get

2014-08-21 Thread Jun Shen
Dear list, I used sasxport.get to import a SAS xpt file. Although it is a data frame but i can't view it through the "fix" command. Also when I see its structure, it brings up attributes I am not really interested in (which seems part of the SAS labels) and it doesn't seem to tell me the mode of e

Re: [R] ordinary kriging: the edges of the polygons are ignored

2014-08-21 Thread Federico Calboli
Hi Jon, thanks for your reply — it solves my issues completely. Best F On 21 Aug 2014, at 07:58, Jon Skoien wrote: > > Hi Frederico, > > The kriging function seems to come from the kriging package (please give also > the package next time you ask a question), which I dont know. I can the

Re: [R] bam (mgcv) not using the specified number of cores

2014-08-21 Thread Simon Wood
Hi Andrew, Could you provide a bit more information, please. In particular the results of sessionInfo() and the code that caused this weird behaviour (+ an indication of dataset size). best, Simon On 21/08/14 12:53, Andrew Crane-Droesch wrote: I am getting strange behavior when trying to fi

Re: [R] file.show() may have some bug?

2014-08-21 Thread PO SU
Because the update of R is rather a trouble thing, i mean that you should have to install every package you have installed. So i do not follow the newest version. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-08-21 04:40:10, "peter dalgaard" wrote: > >On 21 A

[R] bam (mgcv) not using the specified number of cores

2014-08-21 Thread Andrew Crane-Droesch
I am getting strange behavior when trying to fit models to large datasets using bam. I am working on a 4-core machine, but I think that there may be 2 physical cores that the computer uses as 4 cores in some sense that I don't understand. When I run the bam using makeCluster(3), the model run

Re: [R] Line Graph greater than 2 variables on plot

2014-08-21 Thread David McPearson
You could also try matplot(data_object[, 1], data_object[, -1], ...) ?matplot Cheers. On Thu, 21 Aug 2014 09:55:29 +1000 "Duncan Mackay" wrote > Hi > > Try something like (as you have not given a reproducible example) > > library(lattice) > > xyplot(y1 + y2+ y3 ... ~ x, data = your data.fram

Re: [R] file.show() may have some bug?

2014-08-21 Thread peter dalgaard
On 21 Aug 2014, at 10:13 , Prof Brian Ripley wrote: > On 21/08/2014 08:50, PO SU wrote: >> >> >> >> Sorry for my bad typing, file.show("xxx.h") still not work. > > But note that file.show() uses facilities of the front-end, so report RStudio > problems to them not the R community. > > Also

Re: [R] file.show() may have some bug?

2014-08-21 Thread Prof Brian Ripley
On 21/08/2014 08:50, PO SU wrote: Sorry for my bad typing, file.show("xxx.h") still not work. But note that file.show() uses facilities of the front-end, so report RStudio problems to them not the R community. Also note that the posting guide asked you to update before posting: your R is

Re: [R] file.show() may have some bug?

2014-08-21 Thread PO SU
Sorry for my bad typing, file.show("xxx.h") still not work. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-08-21 03:12:06, "Berend Hasselman" wrote: > >On 21-08-2014, at 05:19, PO SU wrote: > >> Dear Rusers, >> when i try file.show(" xxx.h") in Rstudio whic

Re: [R] file.show() may have some bug?

2014-08-21 Thread Berend Hasselman
On 21-08-2014, at 05:19, PO SU wrote: > Dear Rusers, > when i try file.show(" xxx.h") in Rstudio which using R3.0.2, it doesn't > show anything. But when i use file.edit("xxx.h"),it shows the right file, It > is the same thing happen to xxx.c file. > May you explain it to me? > How about

Re: [R] ordinary kriging: the edges of the polygons are ignored

2014-08-21 Thread Jon Skoien
Hi Frederico, The kriging function seems to come from the kriging package (please give also the package next time you ask a question), which I dont know. I can therefore not tell you why it does not give you the correct result. But R has a huge number of packages which can krige, and autoKrige