Re: [R] Issues with loading csv file

2015-05-25 Thread J Robertson-Burns
I suggest two commands to diagnose the problem: getwd() # show the working directory of R This is navigation tool #17. http://www.burns-stat.com/r-navigation-tools/ list.files() # show the files in the working directory You can copy and paste file names to avoid typing mistakes. (Not that I

Re: [R] get the first row ?

2015-05-10 Thread J Robertson-Burns
It looks to me like you need to understand subscripting in R. One place (among many) to learn subscripting is: http://www.burns-stat.com/documents/tutorials/impatient-r/ Pat On 10/05/2015 10:26, Ragia Ibrahim wrote: Dear group kindly I have a logical data type ISINFCluster: 1 2

Re: [R] Question about base::rank results

2015-04-27 Thread J Robertson-Burns
There is a blog post on this topic: http://www.portfolioprobe.com/2012/07/26/r-inferno-ism-order-is-not-rank/ Pat On 26/04/2015 09:17, Giorgio Garziano wrote: Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expe

Re: [R] basic q re: parsing functions, declaration order

2015-04-20 Thread J Robertson-Burns
On 18/04/2015 18:14, Gowder, Paul wrote: Hi there, So I’m doing some serious coding in R for the first time—writing a strategic simulation to run for a few (or many) thousand iterations,* and doing so in proper functional programming form, [...] write.table(results, file="simul_results.

Re: [R] nested for loops too slow

2015-04-12 Thread J Robertson-Burns
You are certainly in Circle 2 of 'The R Inferno', which I suspect is where almost all of the computation time is coming from. Instead of doing: divChng <- rbind(divChng,c(datTS$ts[1], SEG[j], DC, GRW, max(datTS$iter))) it would be much better to create 'divChng' to be the final length and then

Re: [R] automatic coercicion

2015-03-21 Thread J Robertson-Burns
This is Circle 8.1.44 of 'The R Inferno'. http://www.burns-stat.com/documents/books/the-r-inferno/ Pat On 21/03/2015 11:04, jean.cour...@math.u-psud.fr wrote: My question must be a trivial one. There is automatic coercicion to vector when extracting only one line of a matrix. # example A = ma

Re: [R] R match - could be improved ?

2015-03-15 Thread J Robertson-Burns
I believe that you are in Circle 1 of The R Inferno. http://www.burns-stat.com/documents/books/the-r-inferno/ Pat On 15/03/2015 11:04, Jeremy Clark wrote: ​Dear All, The following gives a very unpleasant experience with apparently random NAs - probably it's my bad formatting of the coding - b