similar to: CORRECTION - Generation of Random numbers in a loop

Displaying 20 results from an estimated 2000 matches similar to: "CORRECTION - Generation of Random numbers in a loop"

2009 Dec 17
1
Random Number Generation in a Loop
Dear R helpers   I am having following data   Name           Numbers A                  25 B                   3  C                  13 A                   5  B                   7 C                   0 A                   2 B                 10 C                   9   CONDITIONS   If Name is A, min_val = 1.05, max_val = 1.30 If Name is B, min_val = 1.30, max_val = 1.60 If Name is C, min_val =
2011 Aug 05
2
R compare cells in one matrix
Good morning! Please, could you help me with the problem? I have a matrix *144x73.* An example of a matrix: [,1] [,2] [,3] [,4] [,5] [1,] 277.4 276.24 275.62 276.55 278.05 [2,] 277.4 276.24 275.55 276.42 277.72 [3,] 277.4 276.24 275.50 276.22 277.39 [4,] 277.4 276.24 275.42 276.02 277.02 [5,] 277.4 276.22 275.37 275.82 276.64 And I want to *compare*its cells
2009 Jul 10
3
strange strsplit gsub problem 0 is this a bug or a string length limitation?
I was working with the rmetrics portfolioBacktesting function and dug into the code to try to find why my formula with 113 items, i.e. A1 thru A113, was being truncated and I only get 85 items, not 113. Is it due to a string length limitation in R or is it a bug in the strsplit or gsub functions, or in my string? I'd very much appreciate any suggestions ============Input script:
2008 Jan 20
3
Logical test and look up table
Dear R users, I have a data frame with one column (4000 rows) containing name codes (factor with 63 levels). I would like to associate each name with a particular Type (coded as 1,2,3,4,H or H1) in a second column. Is it possible to do a lookup table of associations (i.e. A23 is of type 1, A13 is of type 3 ...) so as to fill up automatically the $Type column. df() $Source $Type A23 A24 A9 A32
2007 Nov 16
4
Permutation of a distance matrix
Hi there, I would like to find a more efficient way of permuting the rows and columns of a symmetrical matrix that represents ecological or actual distances between objects in space. The permutation is of the type used in a Mantel test. Specifically, the permutation has to accomplish something like this: Original matrix addresses: a11 a12 a13 a21 a22 a23 a31 a32 a33 Example
2005 Nov 09
8
Element-by-element multiplication operator?
Is there an element-by-element multiplication in R, like the .* operator in Matlab? eg: A (2x3) B (2x3) C=A.*B C (2x3) C = [[a11*b11 a12*b12 a13*b13]; [a21*b21 a22*b22 a23*b23]] I can't find one... Thanks -Mike Gates
2004 Jul 03
1
solving for a 2D transformation matrix
We have recently digitized a set of points from some scanned engineering drawings (in the form of PDFs). The digitization resulted in x,y page coordinates for each point. The scans were not aligned perfectly so there is a small rotation, and furthermore each projection (e.g. the yz-plane) on the drawing has a different offset from the page origin to the projection origin. From the dimensions
2005 Jul 07
3
What method I should to use for these data?
Dear R user: I am studying the allele data of two populations. the following is the data: a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 pop1 0.0217 0.0000 0.0109 0.0435 0.0435 0.0000 0.0109 0.0543 0.1739 0.0761 0.1413 0.1522 0.1087 0.0870 0.0435 0.0217 0.0109 pop2 0.0213 0.0213 0.0000 0.0000 0.0000 0.0426 0.1702 0.2128 0.1596 0.1809 0.0957 0.0745 0.0106
2007 Mar 10
3
long character string problem
Hi All I am having 2 very long character strings (550chars) and I want to put them as expressions together with c(). The problem is that I also get these double-quotes, as seen below in 'fct'. How can I remove these double-quotes? I tried as.name() but it did not work (because of size?). These are creating trouble with subsequent programs, which I tested with strings that for some
2008 Nov 29
2
Reading mixed tables
Dear R buddies, This weekend I became interested in solving Google Code Jam problems using R. I guess R may work very well in this kind of contests but the input of file has been a problem for me. Take this case for example (http://code.google.com/codejam/contest/dashboard?c=agdjb2RlamFtchALEghjb250ZXN0cxjRzBQM), the files are usually of the form: A(number of lines for group 1) a11 a12 a13 a21
2005 Sep 20
2
script.aculo.us: pause before effect.appear
I''ve created a simple script (below) which calls the effect.appear script in order to make a group of items appear at the page load. I would like to have the images randomly appear at different times; e.g. the 3rd image might start appearing 2 seconds after load, the 6th image immediately after load, the first image 1 second after load, etc... How can I achieve this affect? ---
2012 Mar 28
6
How to get all possible combinations?
Dear all, suppose I have a vector with elements as: Vec <- c(2,3,4,5,6) Now I want to have all possible combination of length 3 using those elements and without any repetition. Like, I want to have 1 possibility like 2-3-4 but not 3-2-4. Can somebody guide me how to achieve that in R? Thanks for your help.
2009 Oct 08
2
plotting a set of discrete distributions
I have the following data set, representing the the estimated number of some event (est), when the actual number was 3, 4, ..., 15. The numbers in the cells are the observed *frequencies* of each combination of (actual, estimated), so each column (a3 -- a15) gives a single discrete frequency distribution. Thus, when the actual number was 6, the estimated values were 5,6,7 with frequencies 7,
2006 Dec 31
7
zero random effect sizes with binomial lmer
I am fitting models to the responses to a questionnaire that has seven yes/no questions (Item). For each combination of Subject and Item, the variable Response is coded as 0 or 1. I want to include random effects for both Subject and Item. While I understand that the datasets are fairly small, and there are a lot of invariant subjects, I do not understand something that is happening
2012 Feb 16
2
how to rbind matrices from different loops
Dear R experts, I am having difficulty using loops productively and would like to please ask for advice. I have a dataframe of ids and groups. I would like to break down the dataframe into groups, find the unique sets of ids, then reassemble. My thought was to use a loop, but I have been unable to finish this loop in a logical way. I would like to find the unique ids for group 1, group 2,
2005 Jun 14
1
Matrix stability problem
Hello, This is not a problem with R, the calculated results are mathematically correct. This a matrix stability problem. Because of measuring errors, my matrix solution is a bit off. Here is what my equations look like: A11 x11+A12 x12 +A13 x13 = b1 A21 x21+A22 x21 +A23 x23 = b2 A31 x31+A32 x31 +A33 x33 = b3 A is a reading, X is a measured weight, and b is total. The 3 experiments give
2008 Sep 09
1
creating table of averages
Dear Colleagues, I have a dataframe with variables: [1] "ID" "category" "a11" "a12" "a13" "a21" [7] "a22" "a23" "a31" "a32" "b11" "b12" [13] "b13" "b21"
2005 Mar 22
2
Error: Can not handle categorical predictors with more than 32 categories.
Hi All, My question is in regards to an error generated when using randomForest in R. Is there a special way to format the data in order to avoid this error, or am I completely confused on what the error implies? "Error in randomForest.default(m, y, ...) : Can not handle categorical predictors with more than 32 categories." This is generated from the command line: >
2011 Jul 04
1
placing multiple rows in a single row
Dear people from the R help list, I have a question that I can't get my head around to start answering, that is why I am writing to the list. I have data in a format like this (tabs might look weird): John A1 1 0 1 John A2 1 1 1 John A3 1 0 0 Mary A1 1 0 1 Mary A2 0 0 1 Mary A3 1 1 0 Peter A1 1
2013 Feb 04
4
If() values in one dataframe then return values from another
I have a large data frame ("data1") that looks like: A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 [1,] 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 [2,] 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 [3,] 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 [4,] 1 1 1 1