[R] Why is kmeans incredibly slow on this Ubuntu machine?

2014-01-14 Thread Ben Harrison
X is a 5000 x 5 matrix (numerical variables) k = 6 My desktop machine is a Xeon-processor Dell Precision T3500. [Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-58-generic x86_64) with 24 GB RAM] [R version 3.0.2 (2013-09-25) -- Frisbee Sailing Copyright (C) 2013 The R Foundation for Statistical Computing

Re: [R] table of contents link style in R's PDF docs

2013-09-27 Thread Ben Harrison
On 27/09/13 00:33, Duncan Murdoch wrote: On 25/09/2013 11:38 PM, Ben Harrison wrote: Hello, It's been the way it is for about 14 years, and I don't recall anyone else complaining, so I'd conclude it must have been set that way with you in mind. Ah-hah, I knew it! I *am* special. More

Re: [R] table of contents link style in R's PDF docs

2013-09-26 Thread Ben Harrison
On 27/09/13 00:03, Ista Zahn wrote: Hi Ben, On Wed, Sep 25, 2013 at 11:38 PM, Ben Harrison h...@student.unimelb.edu.au wrote: Hello, I agree that it would be nicer to have the whole TOC entry hyperlinked. But out of curiosity, why are you using the pdf documentation? I find the html much

[R] table of contents link style in R's PDF docs

2013-09-25 Thread Ben Harrison
Hello, I am mildly annoyed each time I use a PDF doc of an R package that the table of contents hyperlinks are *only* on the page numbers. To activate a hyperlink, one must carefully scan sideways from the text item wanted to the far right of the page and click on a tiny box. Multiply that

Re: [R] Subtracting elements of a vector from each other stepwise

2013-09-11 Thread Ben Harrison
If I were Michael (OP) right now, I think my head would be spinning. As a newbie myself, I know how hard it is to read R code for the first time, so could it also be part of the newsgroup etiquette to at least partially explain provided code to newbies? I agree that the interactive help '?'

Re: [R] Need to learn or get R tutor in Minneapolis

2013-09-11 Thread Ben Harrison
On 10/09/13 06:45, sewal...@umn.edu wrote: Please advise Can't help you in Minneapolis, though surely your university has a statistics department? To learn R there are many online tutorials and video guides. The latest is a large collection from the Google developers:

[R] Use of parantheses to force order of execution

2013-09-08 Thread Ben Harrison
Hello, I wish to create a copy of a data frame, but with missing values replaced with NAs. I thought I should be able to do it in one step using parentheses to group the statements and force those inside the parens to execute first: df - (BWS6[BWS6 -998] - NA) But all this does is assign NA to

Re: [R] Use of parantheses to force order of execution

2013-09-08 Thread Ben Harrison
solutions, I have found that R can be a troublesome pet at times, and this seems like one of them. Thanks for the help and warnings! Ben. On 9 September 2013 00:39, peter dalgaard pda...@gmail.com wrote: On Sep 8, 2013, at 16:09 , Duncan Murdoch wrote: On 13-09-08 6:46 AM, Ben Harrison wrote

[R] Analogues to my data and prediction problem

2013-08-25 Thread Ben Harrison
Hello, I am quite a novice when it comes to predictive modelling, so would like to see where my particular problem might lie in the spectrum of problems that you collectively have seen in your experiences. Background: I have been handed a piece of software that uses a kohonen SOM network to

[R] Error: cannot allocate vector of size 18.4 Gb (NbClust)

2013-08-22 Thread Ben Harrison
I have a 70363 x 5 double matrix that I am playing with. head(df) GR SP SN LN NEUT 1 1.458543 1.419946 -0.2928088 -0.2615358 -0.5565227 2 1.432041 1.418573 -0.2942713 -0.2634204 -0.5927334 3 1.406642 1.418226 -0.2958296 -0.2652920 -0.6267121 4 1.382284

Re: [R] Error: cannot allocate vector of size 18.4 Gb (NbClust)

2013-08-22 Thread Ben Harrison
On 22/08/13 21:57, Michael Weylandt wrote: On Aug 22, 2013, at 7:39, Ben Harrison h...@student.unimelb.edu.au wrote: No idea about the problem specifics but what are your OS and version of R? You might be limited there. I have 64-bit Ubuntu 12.04, R version 3.0.1. More likely

[R] Manipulations of a data frame or list -- rename or re-assign?

2013-08-03 Thread Ben Harrison
If I am to do a lot of pre-processing operations on some data, comprising many steps such as: -- despike a set of signals -- smooth a set of signals -- filter -- subset -- impute missing values etc... Should I be assigning the result of each operation to a new object, and then destroying the old

[R] Plot a series of plots without using a loop

2013-07-30 Thread Ben Harrison
I have an xyf object from the kohonen package, and wish to plot a lattice or grid or multiplot of a set of attributes of this object. I've included the structure of the object below for reference, and here is the set of plots I wish to produce, given in long-hand. I don't know enough R to

Re: [R] Plot a series of plots without using a loop

2013-07-30 Thread Ben Harrison
On 30 July 2013 21:35, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Maybe the following does it. op - par(mfrow=c(2, 3)) for(i in 1:6){ plot(somdata.xyf, type=property, property=somdata.xyf$codes$X[, i],

[R] Clarification of inputs for xyf function of kohonen package

2013-07-25 Thread Ben Harrison
For supervised version of the kohonen SOM (xyf), I wish to train a map, and then predict a property from the trained map. For the function xyf, whose basic call is: xyf(data, Y, grid) should the data argument contain the Y property? Or does it need to be excluded? e.g.: head(somdata)

[R] Help to improve prediction from supervised mapping using kohonen package

2013-07-24 Thread Ben Harrison
I would really like some or any advice on how I can improve (or fix??) the following analysis. I hope I have provided a completely runnable code - it doesn't produce any errors for me. The resulting plot at the end shows a pretty poor correlation (just speaking visually here) to the test set. How

Re: [R] Help to improve prediction from supervised mapping using kohonen package

2013-07-24 Thread Ben Harrison
On 24 July 2013 19:25, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Try rescaling your data prior to splitting it up into a training and test set. Otherwise you end up with two different ways of scaling. Thanks, good point. I have adjusted the code, however with no visible improvement.

Re: [R] Help to improve prediction from supervised mapping using kohonen package

2013-07-24 Thread Ben Harrison
On 24 July 2013 19:25, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Try rescaling your data prior to splitting it up into a training and test set. Otherwise you end up with two different ways of scaling. I was mistaken, there is a visible improvement! I still cannot understand how I can

Re: [R] Help to improve prediction from supervised mapping using kohonen package

2013-07-24 Thread Ben Harrison
On 24 July 2013 21:32, Ben Harrison h...@student.unimelb.edu.au wrote: On 24 July 2013 19:25, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Try rescaling your data prior to splitting it up into a training and test set. Otherwise you end up with two different ways of scaling. I still

[R] Imputation with SOM using kohonen package

2013-04-15 Thread Ben Harrison
I have a data set with 10 variables, and about 8000 instances (or objects/rows/samples). In addition I have one more ('class') variable that I have about 10 instances for, but for which I wish to impute values for. I am a little confused how to go about doing this, mostly as I'm not well-versed

[R] Fwd: Imputation with SOM using kohonen package

2013-04-15 Thread Ben Harrison
Trying re-send as plain text. I have a data set with 10 variables, and about 8000 instances (or objects/rows/samples). In addition I have one more ('class') variable that I have about 10 instances for, but for which I wish to impute values for. I am a little confused how to go about doing this,

Re: [R] Annotate a segmented linear regression plot

2012-10-02 Thread Ben Harrison
On 28 September 2012 16:38, David Winsemius dwinsem...@comcast.net wrote: ?text # should be fairly clear. Thank you. I was stupid to ask such a trivial question along with a not-so-trivial one. The second part of the question was probably more important: is there a way to obtain the location

[R] Annotate a segmented linear regression plot

2012-09-27 Thread Ben Harrison
Hello, I have produced some segmented regressions with the segmented package by Viggo Mutteo. I have some example data and code below. I want to annotate the individual segments with the slope parameter (actually it would be nicer to annotate with 1000*slope and add some small amount of text as

Re: [R] Using subset to filter data table

2011-01-19 Thread Ben Harrison
Thank you Santosh. I am so new to R that I don't even have droplevels: 1 tcc2 = droplevels(tcc) Error: could not find function droplevels I looked up ?droplevels: 1 ?droplevels No documentation for 'droplevels' in specified packages and libraries: you could try '??droplevels' 1 ??droplevels Help

Re: [R] Using subset to filter data table

2011-01-19 Thread Ben Harrison
Thank you Santosh. I am so new to R that I don't even have droplevels: 1 tcc2 = droplevels(tcc) Error: could not find function droplevels I looked up ?droplevels: 1 ?droplevels No documentation for 'droplevels' in specified packages and libraries: you could try '??droplevels' 1 ??droplevels Help

[R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
hello, I am very new to R. My current data set is a mix of values and categories. It is a geoscience data set, with values per rock sample. Case in point, each sample belongs to a lithology class, and each sample has several physical property measurements (density, porosity...). I want to be able

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
Thanks for the reply Peter. On 18 January 2011 22:52, Peter Ehlers ehl...@ucalgary.ca wrote: Since you don't provide data, let's borrow from the help(droplevels) page: I had no joy with my R install finding droplevels exactly, but found this instead: ??droplevels gdata::drop.levels

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
Dennis, thank you for the response! Sorry for lack of clarity, I'll explain a little more below... plot(Depth[LithClass=='sand'], Conductivity[LithClass=='sand']) (ad nauseum... how can I loop through them all?) I have several lithology classes - sand, clay, limestone, etc... I wish to

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
On 18 January 2011 22:52, Peter Ehlers ehl...@ucalgary.ca wrote: Since you don't provide data, let's borrow from the help(droplevels) page: As an aside, is it normal practice then to attach data files to questions on this mailing list? I might do that in future if it's possible and

[R] Using subset to filter data table

2011-01-18 Thread Ben Harrison
I am having difficulty understanding how I would constrain a data set by filtering out 'records' based on certain criteria. Using SQL I could query using 'select * from my.data where LithClass in ('sand', 'clay')' or some such. Using subset, there seem to be ghosts left behind (that is, all of