similar to: 'break' function in loop

Displaying 20 results from an estimated 900 matches similar to: "'break' function in loop"

2013 Oct 15
1
Problem with lapply
Hi together I'm pretty new to R, so excuse me if it is a basic question. I have a big dataset (extract of it found in the attachment) of returns from firms. I'd like to compute the Pearson correlation of each firm with the "Market" and the corresponding p-Value. So I thought of making a list of 'cor.test's and then extract the needed values with a for loop. What I did so
2012 Feb 08
1
How indices calculated in package "boot"
Hi,there, I am using R package "boot" to bootstrap. I have one question here: does anybody possibly know how the boot package generates the "indices" which is used in the statistic function? I thought "indices = sample(data, replace=TRUE)", but when I replaced "indices" with this command and used "boot", I got different results. Specifically,
2007 May 14
2
creating a "list of 3 dataframes" from a "list of 2 dataframes" and a dataframe?
#I wish to create a "list of three dataframes" ("results2") from a "list of two dataframes" (temp) and a dataframe ("c")? #Please advise. a <- data.frame(x=c(1,2,3),y=c(5,7,9)) b <- data.frame(x=c(2,4,7,9),y=c(2,3,5,4)) c <- data.frame(x=c(22,34,7,9),y=c(52,63,5,4)) results1 <- list(a,b,c) #what I want #but this is how I need to get there
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
Dear R-SIG-Debian, I am using R version 3.1.2 with rstudio-server 0.98.113 on debian build 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux. I often use the %dopar% operator in from the foreach package to run code in parallel. However, the only other use on the box seemingly installed a few items and suddenly %dopar% will use far more than the number of cores I am specifying and
2009 Jul 28
3
Help with significance. T-test?
Hi, this is more a general statistics question I think. I am working on a system which automatically answers user questions (such systems are commonly called "Question Answering systems"). I evaluated different versions of the same system on a publicly available test set. This set contains 500 question. Naturally, for each question the answer can be wrong or right, which is coded as
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I am trying to figure out what is incorrect with my syntax. Any suggestions? Thanks. Here is the data. myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61, 30.59, 30.84, 30.98, 30.79, 30.79,
2012 Apr 06
2
read multiaple files within one folder
Suppose we have files in one folder file1.bin, file2.bin, ... , and 1460slice(file) with dim of 720 * 360 in directory C:\\PHD\\Climate Data\\Wind\\ and we want to read them and make a loop to go from 1 to 4 and take the average, then from 4 to 8 and so on till 1460. in the end we will get 365 files . I need those 365 files to be in one new folder for later use in my model I tried using this
2011 Feb 09
1
Iterate over a list of input files?
Hi, I've got the following code which seems to work fine for a single file if I specify the file name explicitly in the code. What I need to do is run it on all the files in the directory tested and augment the data frame I'm building to have more results columns.How can I do that? Here's the code: library(chron) # .Holidays / is.holiday / is.weekend TStoDate = function
2009 Apr 14
1
mean fold change issues and p values
I am new to R and have two scripts written slightly different but should to relatively the same thing but my lack of experience with the program I can not figure out the what I need to do to correct it. The first script gives me a consistent mean fold change values with every run but can generate negative p values for some. For the second version of the script, the fold changes seem to be very
2004 Feb 10
4
The ttest.c example in R under MS Windows
We are trying to compile and run the ttest.c example that comes with R (in C:\Program Files\R\rw1081\src\library\windlgs\src\ttest.c). After compiling it with MS Visual C++ we load the DLL with dyn.load. So far it seems good, but when we try to call it from R (after running C:\Program Files\R\rw1081\src\library\windlgs\R\windlgs.R) R crashes. We have tried changing the exports from DLL but have
2018 May 01
3
Compiling CUDA with clang on Windows
Dear all, In the official document <https://llvm.org/docs/CompileCudaWithLLVM.html>, it is mentioned that CUDA compilation is supported on Windows as of 2017-01-05. I used msys2 to install clang 5.0.1. Then I installed cuda 8.0. However, I basically could not compile any code of cuda by the prescribed setting. I wounder if anyone can successfully compile cuda code by the clang on Windows.
2009 Sep 23
1
dotchart to barplots
Hi, I am trying to plot the following data so that it can be visually represented well. I tried the dotchart but I felt it was too spread out. Then I tried the barplot which is good enough for me. Is there a way to give the labels for the y-axis as in the dot chart? Also, I feel the grey level is confusing, so is there options for designs within the bars? I cannot use color as the journal wants
2012 Dec 12
4
Matrix multiplication
Hi, I have a transition matrix T for which I want to find the steady state matrix for. This could be approximated by taking T^n , for large n. T= [ 0.8797 0.0382 0.0527 0.0008 0.0212 0.8002 0.0041 0.0143 0.0981 0.0273 0.8802 0.0527 0.0010 0.1343 0.0630 0.9322] According to a text book I have T^200 should have reached the steady state L L
2003 Jun 04
3
Slow ttests in R-devel
Hello ... I've noticed that some of our Bioconductor code was running drastically slower under current R-devel vs. current R-patched - one example is below using a ttest. I have the following snippet of code that demonstrates the problem while avoiding "real" code that takes an extremely long time to finish on R-devel: library(genefilter) data(eset) eset$cov1 z <-
2009 Mar 22
2
Following progress in a lapply() function
Dear all, I am processing a very long and complicated list using lapply through a custom function and I would like to generate some sort of progress report. For instance, print a dot on the screen every time 1000 item have been process. Or even better, reporting the percent of the list that have been process every 10%. However, I can't seem to figure out a way to achieve that. For instance,
2012 Aug 27
3
How to generate a matrix of Beta or Binomial distribution
Hi folks, I have a question about how to efficiently produce random numbers from Beta and Binomial distributions. For Beta distribution, suppose we have two shape vectors shape1 and shape2. I hope to generate a 10000 x 2 matrix X whose i th rwo is a sample from reta(2,shape1[i]mshape2[i]). Of course this can be done via loops: for(i in 1:10000) { X[i,]=rbeta(2,shape1[i],shape2[i]) } However,
2007 Aug 14
4
Problem with "by": does not work with ttest (but with lme)
Hello, I would like to do a large number of e.g. 1000 paired ttest using the by-function. But instead of using only the data within the 1000 groups, R caclulates 1000 times the ttest for the full data set(The same happens with Wilcoxon test). However, the by-function works fine with the lme function. Did I just miss something or is it really not working? If not, is there any other possibility to
2019 Jul 29
3
Why librbd disallow VM live migration if the disk cache mode is not none or directsync
I'm curious that why librbd sets this limitation? The rule first appeared in librbd.git commit d57485f73ab. Theoretically, a write-through cache is also safe for VM migration, if the cache implementation guarantees that cache invalidation and disk write are synchronous operations. For example, I'm using Ceph RBD images as VM storage backend. The Ceph librbd supports synchronous
2007 May 30
2
How to search with limit by field
Hello, I have a ferret index with 2 fields: Acts_as_ferret :fields => [:client, :content] If I do model.find_by_contents(query) I obtain all results by the query but I would like to obtain 3 results for each client. Any ideas? Thanks for all. -- Posted via http://www.ruby-forum.com/.
1999 Jul 21
1
R 0.64.2 for Windows 95/NT
I installed R 0.64.2 using "rwinst.exe" on a Windows 95 machine. The zip files and rwinst.exe were stored in a directory "rtmp" and I wanted R to be installed in "r0642" (by setting c:\rtmp for source directory and c:\ for install directory). After the installation was completed the main program was in r0642 whereas all the documentation in c:\rtmp\r0642. Is this