search for: a23

Displaying 20 results from an estimated 47 matches for "a23".

Did you mean: a2
2017 Dec 14
1
match and new columns
Hi Bill, I put stringsAsFactors = FALSE still did not work. tdat <- read.table(textConnection("A B C Y A12 B03 C04 0.70 A23 B05 C06 0.05 A14 B06 C07 1.20 A25 A23 A12 3.51 A16 A25 A14 2,16"),header = TRUE ,stringsAsFactors = FALSE) tdat$D <- 0 tdat$E <- 0 tdat$D <- (ifelse(tdat$B %in% tdat$A, tdat$A[tdat$B], 0)) tdat$E <- (ifelse(tdat$B %in% tdat$A, tdat$A[tdat$C], 0)) tdat I got this, A B C Y...
2017 Dec 13
3
match and new columns
Hi all, I have a data frame tdat <- read.table(textConnection("A B C Y A12 B03 C04 0.70 A23 B05 C06 0.05 A14 B06 C07 1.20 A25 A23 A12 3.51 A16 A25 A14 2,16"),header = TRUE) I want match tdat$B with tdat$A and populate the column values of tdat$A ( col A and Col B) in the newly created columns (col D and col E). please find my attempt and the desired output below Desired output...
2017 Dec 13
2
match and new columns
Thank you Rui, I did not get the desired result. Here is the output from your script A B C Y D E 1 A12 B03 C04 0.70 0 0 2 A23 B05 C06 0.05 0 0 3 A14 B06 C07 1.20 0 0 4 A25 A23 A12 3.51 1 1 5 A16 A25 A14 2,16 4 4 On Wed, Dec 13, 2017 at 4:36 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote: > Hello, > > Here is one way. > > tdat$D <- ifelse(tdat$B %in% tdat$A, tdat$A[tdat$B], 0) > tdat$E <-...
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 A25 A14 A10 A12 A11 A13 G Alternative solutions are also welcome. Thanks in advance P.S. I found a discussion mentioning match() and %in% but it does not seem adapted. --...
2017 Dec 14
0
match and new columns
...your way here. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Dec 13, 2017 at 3:02 PM, Val <valkremk at gmail.com> wrote: > Thank you Rui, > I did not get the desired result. Here is the output from your script > > A B C Y D E > 1 A12 B03 C04 0.70 0 0 > 2 A23 B05 C06 0.05 0 0 > 3 A14 B06 C07 1.20 0 0 > 4 A25 A23 A12 3.51 1 1 > 5 A16 A25 A14 2,16 4 4 > > > On Wed, Dec 13, 2017 at 4:36 PM, Rui Barradas <ruipbarradas at sapo.pt> > wrote: > > > Hello, > > > > Here is one way. > > > > tdat$D <- i...
2017 Dec 13
0
match and new columns
...ifelse(tdat$B %in% tdat$A, tdat$A[tdat$B], 0) tdat$E <- ifelse(tdat$B %in% tdat$A, tdat$A[tdat$C], 0) Hope this helps, Rui Barradas On 12/13/2017 9:36 PM, Val wrote: > Hi all, > > I have a data frame > tdat <- read.table(textConnection("A B C Y > A12 B03 C04 0.70 > A23 B05 C06 0.05 > A14 B06 C07 1.20 > A25 A23 A12 3.51 > A16 A25 A14 2,16"),header = TRUE) > > I want match tdat$B with tdat$A and populate the column values of tdat$A > ( col A and Col B) in the newly created columns (col D and col E). please > find my attempt and the d...
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
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.
2007 Nov 16
4
Permutation of a distance matrix
...e 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 permutation a22 a23 a21 a32 a33 a31 a12 a13 a11 that is relative positions of rows and columns are conserved in the permutation. Basically, I have been doing this in a "for" loop by (1) permuting the raw data vector using "sample", (2)...
2009 Jul 10
3
strange strsplit gsub problem 0 is this a bug or a string length limitation?
...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: backtestFormula<-SPX~A1+A2+A3+A4+A5+A6+A7+A8+A9+A10+A11+A12+A13+A14+A15+A16+A17+A18+A19+A20+A21+A22+A23+A24+A25+A26+A27+A28+A29+A30+A31+A32+A33+A34+A35+A36+A37+A38+A39+A40+A41+A42+A43+A44+A45+A46+A47+A48+A49+A50+A51+A52+A53+A54+A55+A56+A57+A58+A59+A60+A61+A62+A63+A64+A65+A66+A67+A68+A69+A70+A71+A72+A73+A74+A75+A76+A77+A78+A79+A80+A81+A82+A83+A84+A85+A86+A87+A88+A89+A90+A91+A92+A93+A94+A95+A96+A97+A98...
2007 Jun 26
1
APPEND fails
...e javax.mail API. when i use cyrus as source and destination imap server everything is fine. when i use dovecot as destination server occasionally exceptions occur when appending the mails. i was not able to see what's really going wrong so i used wireshark to get the imap command that fails: A23 APPEND INBOX.MYSUBFOLDER () "14-Mar-2007 14:20:45 +0100" {0+} A23 NO Append aborted. this is easy to check via telnet, always the same error. i'm not sure why the javax.mail API uses the "{0+}" but somehow it occurs every now and then. sending this command to a cyrus imap s...
2004 Jul 03
1
solving for a 2D transformation matrix
...ordinates of a subset of the points. I want to use this subset of points to compute a best-fit transformation matrix so that the remaining points can be converted to world coordinates. The transformation matrix is (I think) of the form: [ x' ] [ a11 a12 a13 ] [ x ] | y' | = | a21 a22 a23 | | y | [ w' ] [ a31 a32 a33 ] [ w ] where: x,y = page coordinates x',y' = world coordinates a13 = translation of x a23 = translation of y a11 = scale * cos(theta) a12 = sin(theta) a21 = -sin(theta) a22 = scale * cos(theta) a31 = 0 a31 =...
2008 Nov 29
2
Reading mixed tables
...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 a22 a23 ... B(number of lines for group 2) b11 b12 b13 b21 b22 b23 ... I guess SAS may work pretty well in this kind of situation with data step. But I don't know how to handle them using R. Any suggestions? Thanks a lot. Best wishes, -- ??? Hesen Peng http://hesen.peng.googlepages.com/
2011 Aug 05
2
R compare cells in one matrix
...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 like this: a11 and a12; a11 and a21; a11 and a22. then a12 and a22; a12 and a13; a12 and a23. and so on in a cycle. *Is there a function or a package that can be used for comparation?* Thank you! -- View this message in context: http://r.789695.n4.nabble.com/R-compare-cells-in-one-matrix-tp3720854p3720854.html Sent from the R help mailing list archive at Nabble.com.
2007 Mar 10
3
long character string problem
...8*(X18*x1+X28*x2)+1*sqrt(B18*(X18*x1+X28*x2)^2+C18)A19*(X19*x1+X29*x2)+-1*sqrt(B19*(X19*x1+X29*x2)^2+C19)A110*(X110*x1+X210*x2)+1*sqrt(B110*(X110*x1+X210*x2)^2+C110)" > cum2 [1] "A21*(X11*x1+X21*x2)+1*sqrt(B21*(X11*x1+X21*x2)^2+C21)A22*(X12*x1+X22*x2)+1*sqrt(B22*(X12*x1+X22*x2)^2+C22)A23*(X13*x1+X23*x2)+-1*sqrt(B23*(X13*x1+X23*x2)^2+C23)A24*(X14*x1+X24*x2)+-1*sqrt(B24*(X14*x1+X24*x2)^2+C24)A25*(X15*x1+X25*x2)+1*sqrt(B25*(X15*x1+X25*x2)^2+C25)A26*(X16*x1+X26*x2)+1*sqrt(B26*(X16*x1+X26*x2)^2+C26)A27*(X17*x1+X27*x2)+1*sqrt(B27*(X17*x1+X27*x2)^2+C27)A28*(X18*x1+X28*x2)+1*sqrt(B28*(X18*...
2009 Feb 13
0
help with reshaping (no file attached)
MCI A1 A2 A13 A14 A23 A24 A33 A34 Grouped together 56766 N/A N/A N/A N/A N/A N/A N/A N/A N/A 6459 N/A N/A N/A N/A N/A N/A N/A N/A...
2008 Oct 26
0
orthographic projection of ellipsoids
...a11 <- cos(psi)*cos(phi) - cos(theta)*sin(phi)*sin(psi) > a12 <- cos(psi)*sin(phi) + cos(theta)*cos(phi)*sin(psi) > a13 <- sin(psi)*sin(theta) > a21 <- -sin(psi)*cos(phi) - cos(theta)*sin(phi)*cos(psi) > a22 <- -sin(psi)*sin(phi) + cos(theta)*cos(phi)*cos(psi) > a23 <- cos(psi)*sin(theta) > a31 <- sin(theta)*sin(phi) > a32 <- -sin(theta)*cos(phi) > a33 <- cos(theta) > matrix(c(a11, a12, a13, a21, a22, a23, a31, a32, a33), ncol=3) > } > rotM3d() # I > > ellipsoid <- # idea borrowed from a post in the R-mailing list...
2011 Aug 04
3
functions on rows or columns of two (or more) arrays
...lm(formula = a ~ a2) Coefficients: [,1] [,2] [,3] [,4] [,5] (Intercept) 8.372135 18.372135 28.372135 38.372135 48.372135 a21 -0.006163 -0.006163 -0.006163 -0.006163 -0.006163 a22 -0.093390 -0.093390 -0.093390 -0.093390 -0.093390 a23 0.009315 0.009315 0.009315 0.009315 0.009315 a24 -0.015143 -0.015143 -0.015143 -0.015143 -0.015143 a25 -0.026761 -0.026761 -0.026761 -0.026761 -0.026761 ...Which is clearly very wrong, in a number of ways. If I try by columns: apply(a,2,function(x) lm(a...
2006 Dec 31
7
zero random effect sizes with binomial lmer
...0) a12 <- c(0,0,0,0,0,0,0) a13 <- c(0,0,0,0,0,0,1) a14 <- c(0,0,0,0,0,0,1) a15 <- c(0,0,0,0,0,1,0) a16 <- c(0,0,0,0,1,0,0) a17 <- c(0,0,0,1,0,0,0) a18 <- c(0,0,1,0,0,0,0) a19 <- c(0,1,0,0,0,0,0) a20 <- c(0,1,0,0,0,1,0) a21 <- c(0,0,0,1,0,1,1) a22 <- c(1,0,0,1,0,1,1) a23 <- c(1,0,1,1,0,1,0) aa <- rbind (a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20, a21,a22,a23) b1 <- c(0,0,0,0,0,0,0) b2 <- c(0,0,0,0,0,0,0) b3 <- c(0,0,0,0,0,0,0) b4 <- c(0,0,0,0,0,0,0) b5 <- c(0,0,0,0,0,0,0) b6 <- c(0,0,0,0,0,0,0) b7 <- c(0,0,0...
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 slightly different X values because of measurement errors. For reproducibility, here's my A, x and b matrices and vectors A <-matrix( c(0.03,0.02,0.04,0.01,0.015,0.03,-0.0...