similar to: type conversion

Displaying 20 results from an estimated 150 matches similar to: "type conversion"

2008 Jan 08
1
Problem in anova with coxph object
Dear R users, I noticed a problem in the anova command when applied on a single coxph object if there are missing observations in the data: This example code was run on R-2.6.1: > library(survival) > data(colon) > colondeath = colon[colon$etype==2, ] > m = coxph(Surv(time, status) ~ rx + sex + age + perfor, data=colondeath) > m Call: coxph(formula = Surv(time, status) ~ rx +
2012 Jun 05
1
load coda in BRugs to perfor diagnostics
Dear all, I just wrote a script to have each of my three mcmc chins running on a different computer core to improve computation speed. To do it I use the function sfLapply from the package snowfall. Before using parallell computation, I did my diagnostic analyses just after the model updating, but now I have to save the coda before. Using the CODA package, it is possible to load the outputs in a
2006 Feb 08
2
logical condition in vector operation
HI All, I have a data frame such as: > test x y p d [1,] 1 0 10 21 0 [2,] 2 3 11 12 0 [3,] 3 4 12 23 0 [4,] 3 5 13 24 0 and I want to perfor some operations on the first two coulums, conditional on the uneqaulity values on the 3rd and 4th columns. For instance: j = 3 test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1] gives me the result: test: x y p d
2006 May 18
4
Nested design
Dear list members, I'd like to perform a glm analysis with a hierarchically nested design. In particular, I have one fixed factor ("Land Use Classes") with three levels and a random factor ("quadrat") nested within Land Use Classes with different levels per classes (class artificial = 1 quadrat; class crops = 67 quadrats; and class seminatural = 30 quadrats). I have four
2006 Jun 04
1
How to use lmer function and multicomp package?
Dear list members, First of all thank you for your helpful advices. After your answeres to my firt mail I studied a lot (R-News n?5) and I tried to perform my analysis: First, to fit a GLM with a nested design I decided to use the function "lmer" in package "lme4" as suggested by Spencer Graves and Filippo Piro. I remember to you that my data were: land use classes, 3 levels
2007 Jun 07
4
WinXP console
I''m using RHEL 5. One of the virtual machines I have running is a WinXP install. I start this up after I login to X. If I log out of X, the virtual WinXP is still running (that''s fine with me). However when I log back into X and start the Virtual Machine Manager, I am unable to open the machine. It normally says "Virtual Machine Console is unavailable." There does
2006 May 20
0
GLM with nested design
Dear list members, I'd like to perform a glm analysis with a hierarchically nested design. In particular, I have one fixed factor ("Land Use Classes") with three levels and a random factor ("quadrat") nested within Land Use Classes with different levels per classes (class artificial = 1 quadrat; class crops = 67 quadrats; and class seminatural = 30 quadrats). I have four
2006 May 25
0
Nested design and GLM: ....continue
Dear list members, First of all thank you for your helpful advices. After your answeres to my firt mail I studied a lot (R-News n?5) and I tried to perform my analysis: First, to fit a GLM with a nested design I decided to use the function "lmer" in package "lme4" as suggested by Spencer Graves and Filippo Piro. I remember you that my data were: land use classes, 3 levels
2008 Sep 17
3
using for variable as rowname
Is there a way to use the cycle variable for rowname? v=1:6 for (a in 1:3){ for (b in 4:5) { v=rbind(v,a.b=1) } } v This above obviously does not work, but I couldn't find out how to use a and b to construct a rowname like 14, 15, 24, 25. Thanks for the help. Balazs -- View this message in context: http://www.nabble.com/using-for-variable-as-rowname-tp19533203p19533203.html Sent from
2012 Oct 21
1
Changing a for loop to a function using sapply
Apparently there is one or more concepts that I do not fully understand from the descriptions of a function and the apply material. I have been reading the mail from this forum and have learned much but, in this case, what I have been reading here and from the manual isn't enough. The following code produces what I want with the for loop. From what I have read from this forum, a for
2009 Mar 02
3
Error setting rowname if rowname currently NULL
Hi, My first post here and new to R so please bear with me (long time programmer though, helping a friend with some scripts). I've noticed a behaviour when using rownames() that I think is odd, wondering if I'm doing something wrong. To illustrate, say I create a very simple matrix (called fred): fred<-matrix(,4,2) It looks like this: [,1] [,2] [1,] NA NA [2,] NA NA
2008 May 19
2
Sort matrix with duplicate row names alphabetically by rowname
Hi, I've a matrix that contains 4 replicates of each rowname. (4 a's, 4 b's, 4 c's in no particular order) Like this: # c 32 a 1 b 4 c 87 c 34 b 54 a 23 a 12 b 9 a 3 b 87 c 43 There are a couple of more columns but I'm using the above as an example I need to sort it so that the same rownames appear together in alpahbetical order. Like this: # a 1 a 23 a 12 a 3 b 4
2009 Nov 16
1
extracting values from correlation matrix
Hi! All, I have 2 correlation matrices of 4000x4000 both with same row names and column names say cor1 and cor2. I have extracted some information from 1st matrix cor1 which is something like this: rowname colname cor1_value a b 0.8 b a 0.8 c f 0.62 d k 0.59 - - -- -
2004 Jun 11
4
rownames of single row matrices
Hi I want to extract rows of a matrix, and preserve rownames even if only one row is selected. Toy example: R> a <- matrix(1:9,3,3) R> rownames(a) <- letters[1:3] R> colnames(a) <- LETTERS[1:3] R> a A B C a 1 4 7 b 2 5 8 c 3 6 9 Extract the first two rows: R> wanted <- 1:2 R> a[wanted,] A B C a 1 4 7 b 2 5 8 rownames come through fine. Now extract just
2008 Oct 30
1
row.names(data.frame(matrixWithDimnames)) depends on first rowname being "" or not. (PR#13230)
Full_Name: Bill Dunlap Version: R version 2.9.0 Under development (unstable) (2008-10-29 r46795) OS: Linux Submission from: (NULL) (76.28.245.14) When data.frame() is given a matrix with rownames, then the type of the output row names depends on whether the first element of the input row names is "" or not. The other elements of the input row names don't affect things. E.g.,
2007 Mar 01
4
question about xtable and Hmisc
I would like to get rid of the row numbers using xtable and latex. The commands d = cbind(1:10,rep(1:2,5)) ans = xtable(d) latex(ans) gives output containing \begin{tabular}{rrr} \hline & 1 & 2 \\ \hline 1 & 1.00 & 1.00 \\ 2 & 2.00 & 2.00 \\ 3 & 3.00 & 1.00 \\ 4 & 4.00 & 2.00 \\ 5 & 5.00 & 1.00 \\ 6 & 6.00 &
2008 Jul 15
0
creating axis of the plot before data are plotted -- solved
Solved. I tried to create a minimal example, but my script is too complicated to just cut out lines (too many dependencies). Instead of it, I sketch my idea. I do not say it is the nicest solution, but it works as I wanted. The first five rows of my data-matrix: > data_svd$u[1:5,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] 25.12333 -0.05845695
2012 Nov 16
0
[LLVMdev] Using custom LLVM Passes with clang
Hello, I have written a custom LLVM Loop Pass that perforates a loop by changing the increment value for the induction variable. I am able to run this pass using the opt command and loading the shared object library from Debug+Asserts as detailed in http://llvm.org/docs/WritingAnLLVMPass.html I was wondering if this pass can be used in clang somehow. I have read about "-mllvm"
2006 Feb 12
1
Mathematical typesetting of column heads using the latex (Hmisc) function
Dear r-helpers, I would very much appreciate help with the following problem: The following command (in a .Rnw file) latex(anova(e7.lmer3, e7.lmer4), file = 'e7lmer34.tex', rowname = c ('nonlinear', 'linear'), longtable = FALSE, dcolumn = T, booktabs = T, table.env = F) produces the following output after running Sweave: % latex.default(anova(e7.lmer1, e7.lmer2),
2009 Jul 15
4
Extract pairs (rowname, columname) from a matrix where value is 0
Dear sir, I have a matrix like a<-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)<-c("F1","F2","F3") rownames(a)<-c("A1","A2","A3") a F1 F2 F3 A1 0 4 5 A2 2 0 8 A3 0 6 0 I want to extract all pairs (rownames, columnames) from which the value in the matrix is 0 The result should be something like this A1, F1 A2,