Re: [R] nmax parameter in factor function

2017-06-03 Thread Bert Gunter
I'll go just a bit "fer-er." It appears the anomaly -- I hesitate to call it a bug -- is in the C code for duplicated.default(): > duplicated(letters[1:10],nmax=10) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE > duplicated(letters[1:10],nmax=9) [1] FALSE FALSE FALSE FALSE FAL

Re: [R] nmax parameter in factor function

2017-06-03 Thread Bert Gunter
Well, you won't like this, but it is kind of wimpily (is that a word?) documented: If you check the code of factor(), you will see that nmax appears as an argument in a call to unique(). ?unique says for nmax, "... see duplicated" . And ?duplicated says: "If nmax is set too small there is liable

[R] Hlep in analysis in RWinBugs

2017-06-03 Thread Shubha Nath Pandit
Hi R User, I was trying to use R for WINBUGS using following model and data (example), but I am new with WINBUGS and don't know how we perform the analysis. I wonder whether I can run the following the example data and Winbugs Model in R. Your help will be highly appreciated. Sincerely, SN PA

Re: [R] New var

2017-06-03 Thread Jeff Newmiller
# read.table is NOT part of the data.table package #library(data.table) DFM <- read.table( text= 'obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004 ',header = TRUE, stringsAsFactors = FALSE) # cleaner w

[R] nmax parameter in factor function

2017-06-03 Thread Ramnik Bansal
I have been trying to understand how the argument 'nmax' works in 'factor' function. R-Documentation states - "Since factors typically have quite a small number of levels, for large vectors x it is helpful to supply nmax as an upper bound on the number of unique values." In the code below what is

Re: [R] New var

2017-06-03 Thread Val
Thank you all for the useful suggestion. I did some of my homework. library(data.table) DFM <- read.table(header=TRUE, text='obs start end 1 2/1/2015 1/1/2017 2 4/11/2010 1/1/2011 3 1/4/2006 5/3/2007 4 10/1/2007 1/1/2008 5 6/1/2011 1/1/2012 6 10/5/2004 12/1/2004',stringsAsFactors = FALSE)

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Vivek Sutradhara
Hi, I have now re-installed Rtools. This has solved my problem. Even previously, Rtools was the first on the path. However, thanks a lot for this help. I can now move on. Thanks, Vivek 2017-06-03 13:09 GMT+02:00 Duncan Murdoch : > On 03/06/2017 7:00 AM, Vivek Sutradhara wrote: > >> Hi, >> As far

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Duncan Murdoch
On 03/06/2017 7:00 AM, Vivek Sutradhara wrote: Hi, As far as I can see, no. On checking, I have confirmed that the only location of cygwin1.dll is : C:\Rtools\bin I would re-install Rtools, and make sure C:\Rtools\bin appears first in your PATH. Duncan Murdoch Thanks Vivek 2017-06-03 12

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Vivek Sutradhara
Hi, As far as I can see, no. On checking, I have confirmed that the only location of cygwin1.dll is : C:\Rtools\bin Thanks Vivek 2017-06-03 12:57 GMT+02:00 Duncan Murdoch : > On 03/06/2017 6:31 AM, Vivek Sutradhara wrote: > >> Hi all, >> I am having some problems in updating some packages from

Re: [R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Duncan Murdoch
On 03/06/2017 6:31 AM, Vivek Sutradhara wrote: Hi all, I am having some problems in updating some packages from source. I start with : install.packages("Boom",lib="C:/RownLib",type="source") I get the following error message : Do you have multiple copies of cygwin1.dll? Duncan Murdoch * in

[R] Fwd: cygwin1.dll problems when installing packages from source

2017-06-03 Thread Vivek Sutradhara
Hi all, I would just like to add that I have installed R3.4.0patched and again run the same commands. This does not help. I get essentially the same error message. It is just a lot more longer with multiple repetitions of essentially the following : c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/R

[R] cygwin1.dll problems when installing packages from source

2017-06-03 Thread Vivek Sutradhara
Hi all, I am having some problems in updating some packages from source. I start with : install.packages("Boom",lib="C:/RownLib",type="source") I get the following error message : * installing *source* package 'Boom' ... ** package 'Boom' successfully unpacked and MD5 sums checked ** libs *** ar

Re: [R] New var

2017-06-03 Thread peter dalgaard
As Bert says/implies, "some assembly is required". as.Date() is your friend and you can basically just subtract those to get differences. Also, it seems to me that you are really trying to convert differences to a factor, and then represent the factor using particular dummy variables for succe