Re: [R] Loading large tar.gz XenaHub Data into R

2019-08-01 Thread Spencer Brackett
Thank you both for your advice! The z <- readLines(gzcon(url(" https://tcga.xenahubs.net/download/TCGA.GBMLGG.sampleMap/HumanMethylation450.gz;)), ) command worked out nicely On Thu, Aug 1, 2019 at 6:47 PM William Dunlap wrote: > By the way, instead of saying only that there were warnings, it

Re: [R] Loading large tar.gz XenaHub Data into R

2019-08-01 Thread William Dunlap via R-help
By the way, instead of saying only that there were warnings, it would be nice to show some of them. E.g., > z <- readLines(" https://tcga.xenahubs.net/download/TCGA.GBMLGG.sampleMap/HumanMethylation450.gz ") [ Hit control-C or Esc to interrupt, or wait a long time ] There were 50 or more warnings

Re: [R] Loading large tar.gz XenaHub Data into R

2019-08-01 Thread Bert Gunter
These are gzipped files, I assume. So see ?gzfile and associated info for how to open a gzip connection and read from it. You may also prefer to search (e.g. at rseek.org) on "read a gzipped file" or similar for possible alternatives. Of course, if they're not gzipped files, then ignore the

[R] Loading large tar.gz XenaHub Data into R

2019-08-01 Thread Spencer Brackett
Good evening, I am attempting to load the following Xena dataset https://tcga.xenahubs.net/download/TCGA.GBMLGG.sampleMap/HumanMethylation450.gz I am trying to unpack the dataset and read it into R as a table, but due to the size of the file, I am having some trouble. The following are the

Re: [R] fa function in psych package and missing values

2019-08-01 Thread Gomez Cano, Mayam
Does fa function in psych package consider only complete cases when missing=FALSE? Why do I get slightly different results when I restrict my data to complete cases compared to the whole data with the default missing=FALSE? -- Sent from: http://r.789695.n4.nabble.com/R-help-f789696.html

[R] 3.6 on debian stretch

2019-08-01 Thread Larry Martell
I need to run 3.6 on debian stretch - I followed the instructions here: https://cran.r-project.org/bin/linux/debian/ and I was able to install it. But 2 packages I need, r-cran-caret and r-cran-ggplot2 will not install: # apt-get install r-cran-ggplot2 Reading package lists... Done Building

Re: [R] [R-sig-Debian] 3.6 on debian stretch

2019-08-01 Thread Johannes Ranke
Dear Larry, yes, because of various factors the r-cran-* packages from the stable and especially the oldstable distribution are often not compatible with the backported r-base packages provided on CRAN. At current, buster is not affected, but your case shows that using stretch gives this

Re: [R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Lorenzo Isella
Hello, On Thu, Aug 01, 2019 at 11:17:30PM +1200, Richard O'Keefe wrote: 2(N-1)/N = 2 - 2/N. So one way to get exactly that mean is to make all the numbers 2 except for two of them which are 1. N < 2 : can't be done. N = 2 : only [1,1] does the job. N = 3 : the sum of the three numbers must be

Re: [R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Richard O'Keefe
I don't know why I thought you wanted a *random* sequence.. The 'rep' function can do more than you realise. generate_k <- function (N, n3) rep(1:3, c(n3+2, N-2-n3*2, n3)) On Thu, 1 Aug 2019 at 22:48, Lorenzo Isella wrote: > Yes, you are right (and yours is one of the possible cases). > I

Re: [R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Richard O'Keefe
2(N-1)/N = 2 - 2/N. So one way to get exactly that mean is to make all the numbers 2 except for two of them which are 1. N < 2 : can't be done. N = 2 : only [1,1] does the job. N = 3 : the sum of the three numbers must be 4, so none of them can be 3, so [1,1,2] [1,2,1] [2,1,1] are the

Re: [R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Lorenzo Isella
Yes, you are right (and yours is one of the possible cases). I think this works (I resorted to pen and paper for once) generate_k <- function(N, n3){ n1 <- 2+n3 n2 <- N-n1-n3 out <- c(rep(1, n1), rep(2, n2), rep(3, n3)) return(out) } where N is the length of the sample, n3 is

Re: [R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Gerrit Eichner
n_1 + ... + n_N = 2(N-1) is requested for integers n_i >= 1. What about c(rep(2, N-2), 1, 1))? but I'm afraid that this was not what you really wanted. ;-) However, you didn't say if your sample should be random. :-) Best regards -- Gerrit

[R] Integer Sample with Mean Dependent on Size

2019-08-01 Thread Lorenzo Isella
Dear All, I cannot unfortunately provide any R code, otherwise I would not need to post this in the first place. I need to generate a sample of N positive non-zero integers such that their mean is *exactly* 2(N-1)/N, i.e. the mean depends on the length of the sample. For a start, we can assume