Re: [R] faster execution of for loop in Fishers test

2019-02-11 Thread Patrick (Malone Quantitative)
Point 1 confirmed. It's an exhaustive permutation test. On 2/11/19, 8:46 PM, "R-help on behalf of Bert Gunter" wrote: 1. I believe Fisher's exact test is computationally intensive and takes a lot of time for large structures, so I would say what you see is what you should expect!

Re: [R] faster execution of for loop in Fishers test

2019-02-11 Thread Bert Gunter
1. I believe Fisher's exact test is computationally intensive and takes a lot of time for large structures, so I would say what you see is what you should expect! (As I'm not an expert on this, confirmation or contradiction by those who are would be appreciated). 2. Your second question on how to

[R] faster execution of for loop in Fishers test

2019-02-11 Thread Adrian Johnson
Dear group, I have two large matrices. Matrix one: is 24776 x 76 (example toy1 dput object given below) Matrix two: is 12913 x 76 (example toy2 dput object given below) Column names of both matrices are identical. My aim is: a. Take each row of toy2 and transform vector into UP (>0) and DN

Re: [R] Select

2019-02-11 Thread Val
Thank you very much Jeff, Goran and David for your help. On Mon, Feb 11, 2019 at 6:22 PM Jeff Newmiller wrote: > > N <- 8 # however many times you want to do this > ans <- lapply( seq.int( N ) > , function( n ) { > idx <- sample( nrow( mydat ) ) >

Re: [R] Select

2019-02-11 Thread Jeff Newmiller
N <- 8 # however many times you want to do this ans <- lapply( seq.int( N ) , function( n ) { idx <- sample( nrow( mydat ) ) mydat[ idx[ seq.int( which( 40 < cumsum( mydat[ idx, "count" ] ) )[ 1 ] ) ], ] } ) On Mon, 11

Re: [R] Select

2019-02-11 Thread Val
Sorry Jeff and David for not being clear! The total sample size should be at least 40, but the selection should be based on group ID. A different combination of Group ID could give at least 40. If I select group G1 with 25 count and G2 and with 15 counts then I can get a minimum of

Re: [R] Select

2019-02-11 Thread Göran Broström
On 2019-02-11 23:35, Val wrote: Hi all, I have a data frame with tow variables group and its size. mydat<- read.table( text='group count G1 25 G2 15 G3 12 G4 31 G5 10' , header = TRUE, as.is = TRUE ) How about x <- sample(1:5) total <- mydat$count[x[1]] i <- 1 while (total < 40){

Re: [R] Select

2019-02-11 Thread Jeff Newmiller
This constraint was not clear in your original sample data set. Can you expand the data set to clarify how this requirement REALLY works? On February 11, 2019 3:00:15 PM PST, Val wrote: >Thank you David. > >However, this will not work for me. If the group ID selected then all >of its

Re: [R] Select

2019-02-11 Thread Val
Thank you David. However, this will not work for me. If the group ID selected then all of its observation should be included. On Mon, Feb 11, 2019 at 4:51 PM David L Carlson wrote: > > First expand your data frame into a vector where G1 is repeated 25 times, G2 > is repeated 15 times, etc.

Re: [R] Select

2019-02-11 Thread David L Carlson
First expand your data frame into a vector where G1 is repeated 25 times, G2 is repeated 15 times, etc. Then draw random samples of 40 from that vector: > grp <- rep(mydat$group, mydat$count) > grp.sam <- sample(grp, 40) > table(grp.sam) grp.sam G1 G2 G3 G4 G5 10 9 5 13 3

[R] Select

2019-02-11 Thread Val
Hi all, I have a data frame with tow variables group and its size. mydat<- read.table( text='group count G1 25 G2 15 G3 12 G4 31 G5 10' , header = TRUE, as.is = TRUE ) I want to select group ID randomly (without replacement) until the sum of count reaches 40. So, in the first case, the

Re: [R] Question about bindata lib in high dimensions

2019-02-11 Thread إيمان إسماعيل محمد
even I tried to use another library mipfp to generate multivariate Bernoulli *using the following:* > p.joint <- ObtainMultBinaryDist(corr = corr_mat[1:10,1:10], marg.probs = probs[1:10]) *it Shows:* Problematic pairs: row col [1,] 10 9 [2,] 9 10 Warning messages: 1: In

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard
Simple when you know how! Thanks Sent from mobile device - please excuse any spelling mistakes. -- Original Message -- From: William Dunlap To: Bernard McGarvey Cc: Ivan Krylov, r-help@r-project.org Sent: February 11, 2019 at 4:29 PM Subject: Re: [R] Difficulty with "\\" in string

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread William Dunlap via R-help
You can also avoid the issue by using the basename and dirname functions. > Fname1 <- "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis Input Data Example WorkBook.xlsx" > basename(Fname1) [1] "QT Analysis Input Data Example WorkBook.xlsx" > dirname(Fname1) [1] "D:/Data/OneDrive/ISTA

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
Brilliant! Thanks a million Ivan. Lion Bernard McGarvey Director, Fort Myers Beach Lions Foundation, Inc. Retired (Lilly Engineering Fellow). > On February 11, 2019 at 3:13 PM Ivan Krylov wrote: > > > On Mon, 11 Feb 2019 15:01:16 -0500 (EST) > Bernard McGarvey wrote: > > > Now I try to

Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Ivan Krylov
On Mon, 11 Feb 2019 15:01:16 -0500 (EST) Bernard McGarvey wrote: > Now I try to split it using > > > str_split(Fname1,"\\") > > > but this returns an error > > > Error in stri_split_regex(string, pattern, n = n, simplify = > simplify, : Unrecognized backslash escape sequence in pattern. >

[R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
I am using the file.choose() function to choose a file from the dialog box and once I get it, I want to be able to split the full name into the folder part and the file name part. So for example, when I have closed the file choose dialog, the name for the file I get is Fname1 [1]

Re: [R] Help needed with my code for merging multiple xls files from google drive

2019-02-11 Thread Jeff Newmiller
Your example is not reproducible [1][2][3], you are reposting a copy of an email in a fresh thread (instead of replying to the first one), and you are using HTML email format on a text-only mailing list (what you see is really not what we see). Please read the Posting Guide to find out what the

[R] Help needed with my code for merging multiple xls files from google drive

2019-02-11 Thread Ross Molden
Hi guys, I am trying to merge a list of .xls files in google drive. I have now managed to create a list of all the files I need, but for some reason I still can't manage to merge them, this is the code I have so far: library(googledrive) inputfiles <- drive_ls(path = "Email It In", pattern =

Re: [R] Siegel nonparametric regression / mblm package

2019-02-11 Thread Marco Besozzi
Thanks a lot! Il giorno lun 11 feb 2019 alle ore 14:39 Roger Koenker < rkoen...@illinois.edu> ha scritto: > A quick look at the code for Siegel in mblm reveals that it is extremely > inefficient, but it seems to be correct. > One “explanation” for this behavior, presuming that we haven’t

Re: [R] Siegel nonparametric regression / mblm package

2019-02-11 Thread Roger Koenker
A quick look at the code for Siegel in mblm reveals that it is extremely inefficient, but it seems to be correct. One “explanation” for this behavior, presuming that we haven’t overlooked something more basic, is that such high breakdown estimates sacrifice some efficiency, that is to say, they

Re: [R] (no subject)

2019-02-11 Thread Adrian Johnson
Pardon me, I forgot to add subject line. -Adrian. On Sun, Feb 10, 2019 at 3:49 PM Adrian Johnson wrote: > > Dear group, > > I have two large matrices. > > Matrix one: is 24776 x 76 (example toy1 dput object given below) > > Matrix two: is 12913 x 76 (example toy2 dput object given below) > >

Re: [R] Siegel nonparametric regression / mblm package

2019-02-11 Thread Roger Koenker
My first thought was also that this was an artifact of the ties, but dithering the data n <- length(child) child <- child + runif(n,-.5,.5) parent <- parent + runif(n,-.5,.5) and rerunning yields the same discrepancy between the Siegel and other fits. Curiously, both lmsreg and ltsreg from MASS

Re: [R] pattern evaluation in electron microscopy images

2019-02-11 Thread S Ellison
Not really my field, but would you not approach this using FFT on selected regions? I think IMageJ has some capability in that area; see example at https://imagej.nih.gov/ij/docs/examples/tem/. Steve Ellison > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org]

Re: [R] [FORGED] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Duncan Murdoch
On 11/02/2019 4:26 a.m., Rolf Turner wrote: On 2/11/19 3:57 AM, Murris Johnson wrote: Hi, I have a quick question for you about a page on your site that briefly mentions a data security topic, https://stat.ethz.ch/pipermail/r-help/2008-May/162561.html. I plan on writing a few guest

Re: [R] Question about bindata lib in high dimensions

2019-02-11 Thread إيمان إسماعيل محمد
*Here Sample of Code for 10 variables:* > probs_10 = probs[1:10] > probs_10 [1] 9.795272e-01 9.331778e-01 6.764349e-01 9.884067e-02 9.52e-05 3.499417e-03 2.380556e-05 9.826457e-01 9.628633e-01 8.874949e-01 > corr_mat_10 = corr_mat[1:10,1:10] > corr_mat_10 [,1] [,2]

[R] Siegel nonparametric regression / mblm package

2019-02-11 Thread Marco Besozzi
I employed the "galton" set of data included in the package "psych". With the package "mblm" I obtained the Theil-Sen nonparametric regression and the Siegel non parametric regression, and compared them with the ordinary least square regression line. The results of standard regression and

Re: [R] Question about bindata lib in high dimensions

2019-02-11 Thread Eric Berger
Hi Eman, It helps if you create a small example that reproduces the problem and then post the code with your question. This will help people determine what is causing the problem. Best, Eric ‪On Mon, Feb 11, 2019 at 11:52 AM ‫إيمان إسماعيل محمد‬‎ < emanismail...@gmail.com> wrote:‬ > I need to

Re: [R] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Berend Hasselman
Just read the complete thread. That will clarify. Nothing wrong with R or RGUI; the virus checker is wrong. regards, Berend Hasselman > On 10 Feb 2019, at 15:57, Murris Johnson wrote: > > > > Hi, > > > I have a quick question for you about a page on your site that briefly > mentions a

[R] Question about bindata lib in high dimensions

2019-02-11 Thread إيمان إسماعيل محمد
I need to simulate data for 2000 binary variables given a vector of marginal probabilities and a correlation matrix. I used bindata library, but it give me Not all probabilities are between 0 and 1. Error in Element ( i , j ): Admissible values are in [.]. Error in

Re: [R] [FORGED] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Rolf Turner
On 2/11/19 3:57 AM, Murris Johnson wrote: Hi, I have a quick question for you about a page on your site that briefly mentions a data security topic, https://stat.ethz.ch/pipermail/r-help/2008-May/162561.html. I plan on writing a few guest authored articles in the next month or so that

[R] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Murris Johnson
Hi, I have a quick question for you about a page on your site that briefly mentions a data security topic, https://stat.ethz.ch/pipermail/r-help/2008-May/162561.html. I plan on writing a few guest authored articles in the next month or so that talk about data security & breaches, are