Re: [R] Manipulating groups of boolean data subject to group size and distance from other groups

2016-11-28 Thread David Winsemius
> On Nov 28, 2016, at 9:38 AM, Morway, Eric wrote: > > The example below is a pared-down version of a much larger dataset. My > goal is to use the binary data contained in DF$col2 to guide manipulation > of the binary data itself, subject to the following: > > - Groups of

Re: [R] reshaping a large dataframe in R

2016-11-28 Thread David L Carlson
There may be a simpler way of getting there, but this works: > rows <- 500 > cols <- 4004 > dat <- as.data.frame(t(replicate(rows, 1:cols))) > dat[c(1:3, 500), c(1:4, 4001:4004)] V1 V2 V3 V4 V4001 V4002 V4003 V4004 11 2 3 4 4001 4002 4003 4004 21 2 3 4 4001 4002 4003

[R] reshaping a large dataframe in R

2016-11-28 Thread jean-philippe
dear all, I have a dataframe of 500 rows and 4004 columns that I would like to reshape to a dataframe of 500500 rows and 4 columns. That is from this dataframe: V1 V2 V3 V4 ... V4001 V4002 V4003 V4004 1 2 3 4 ... 4001 4002 4003 4004 1 2 3 4 ... 4001 4002 4003 4004 1 2 3 4 ... 4001 4002

[R] Manipulating groups of boolean data subject to group size and distance from other groups

2016-11-28 Thread Morway, Eric
The example below is a pared-down version of a much larger dataset. My goal is to use the binary data contained in DF$col2 to guide manipulation of the binary data itself, subject to the following: - Groups of '1' that are separated from other, larger groups of "1's" in 'col2' by 2 or more

Re: [R] reshaping a large dataframe in R

2016-11-28 Thread Daniel Nordlund
On 11/28/2016 1:06 AM, jean-philippe wrote: dear all, I have a dataframe of 500 rows and 4004 columns that I would like to reshape to a dataframe of 500500 rows and 4 columns. That is from this dataframe: V1 V2 V3 V4 ... V4001 V4002 V4003 V4004 1 2 3 4 ... 4001 4002 4003 4004 1 2 3 4 ...

[R] read

2016-11-28 Thread Ashta
Hi all, I have a script that reads a file (dat.csv) from several folders. However, in some folders the file name is (dat) with out csv and in other folders it is dat.csv. The format of data is the same(only the file name differs with and without "csv". Is it possible to read these files

Re: [R] Manipulating groups of boolean data subject to group size and distance from other groups

2016-11-28 Thread Morway, Eric
To help with the clarification, I renamed 'col1' to 'year' and 'col2' to 'origDat'. With that said... The reason the second 'block' of 1's (four consecutive 1's appearing in DF$origDat[11:14]) is preserved is because they are only separated by a total of 1 year (1998 in DF$year) from a larger

[R] errors when installing packages

2016-11-28 Thread Chris
I'm using R 3.3.1  when installing/ updating a library module, for example "Hmisc" I get an error message about "unable to move..." cutting/pasting survival’ successfully unpacked and MD5 sums checkedWarning: unable to move temporary installation

Re: [R] read

2016-11-28 Thread Jeff Newmiller
No, and yes, depending what you mean. No, because you have to supply the file name to open it... you cannot directly use wildcards to open files. Yes, because the list.files function can be used to match all file names fitting a regex pattern, and you can use those filenames to open the

Re: [R] read

2016-11-28 Thread Val
Hi Jeff and John, Thank you for your response. In each folder, I am expecting a single file name (either dat or dat.csv).v so will this work? Is the following correct? fns <- list.files(mydir) if (is.element(pattern="dat(\\.[^.]+)$",fns )) Thank you again. On Mon, Nov 28, 2016 at 7:20

Re: [R] read

2016-11-28 Thread John McKown
On Mon, Nov 28, 2016 at 4:23 PM, Ashta wrote: > Hi all, > > I have a script that reads a file (dat.csv) from several folders. > However, in some folders the file name is (dat) with out csv and in > other folders it is dat.csv. The format of data is the same(only the > file

Re: [R] read

2016-11-28 Thread Jeff Newmiller
Doesn't look right to me... you are likely to need to change something to handle the multiple directories thing somehow, but I don't know why you made the changes you did make to my suggestion. -- Sent from my phone. Please excuse my brevity. On November 28, 2016 5:56:04 PM PST, Val

[R] independent censoring

2016-11-28 Thread Damjan Krstajic
Dear All, Independent censoring is one of the fundamental assumptions in the survival analysis. However, I cannot find any test for it or any paper which discusses how real that assumption is. I would be grateful if anybody could point me to some useful references. I have found the

Re: [R] Unable to Install POT Package for R 3.1.0

2016-11-28 Thread Jeff Newmiller
You probably need to upgrade your R software to the current version. Many CRAN mirrors don't keep binary package repositories for old versions of R online, and the Posting Guide warns that old versions of R are effectively off-topic on the mailing lists. You could also try downloading the zip