similar to: R syntaxe

Displaying 20 results from an estimated 400 matches similar to: "R syntaxe"

2003 Oct 13
4
help with gsub and grep functions
Hi all, Let Names a vector of chatacters. For example, > Names [1] "g 604 be-0 -p1 (602 matches)" "g 606 Phli-0 -p2 (517 matches)" [3] "g 608 alu-0 (659 matches)" I try to use gsub or grep functions for two problems : 1. First, I would like to delete all the characters between parentheses. [1] "g 604 be-0 -p1" "g 606 be-0 -p2" [3] "g
2003 Oct 17
1
heatmap function
Hi all, By default, the heatmap function gives an image with a dendrogram added to the left side and to the top. Is it possible to only add the dendrogram to the left side and let the order of the columns unchanged ? I tried heatmap(mat, col=rbg,Rowv=res.hclust$order,Colv=1:dim(mat)[[2]]). In this case, the order of the columns are unchanged but a dendrogram is added to the top. How can I
2010 Jun 09
1
minor tick marks
Hi ! I need a plot for data extending over several orders of magnitude on the y axis. The following command generates a nice looking semi-log plot for my data: plot(x,y,log="y",type="l",lty=3, ylim=c(0.01,2),yaxp=c(0.01,1,1),las=1) I would appreciate having also minor tick marks in-between the 3 major ticks obtained with the above command. The "minor.tick" function
2007 Jul 30
1
correlation and matrix
Dear everyone, I am new in R and I've got difficulties in realizing the following tasks: -I have variables (factors) with different numbers of levels, either 1, 2 or 3. -I have a matrix containing these 204 factors and I have to correlate them by groups of 4 variables. -I have to delete the factors just having one level ( because when correlating one-level factors, the output is NA) here
2003 Aug 12
1
classification with quantitative variables
Hi all, I want to conduct a cluster analysis with quantitative variables. More precisely, it concerns binary and non-ordered categorical variables. For such data, various similarity measures have been proposed, such as the Jaccard index or the simple matching index. So, is there a package such as mva or multiv in the case of quantitative variables? Could you indicate me reviews, papers or
2007 Jun 29
1
How to add elements to a table
Hi, I've been using R for a few weeks now, but consider myself still a newbie, especially in what concerns the basics of data handling in R. My situation is this: I read in data from a database using RODBC, and then use "table" to produce a table of "counts per years", table which I give to "plot". All is well, as long as there are no gaps in the years
2008 Oct 15
1
Parameter estimates from an ANCOVA
Hi all, This is probably going to come off as unnecessary (and show my ignorance) but I am trying to understand the parameter estimates I am getting from R when doing an ANCOVA. Basically, I am accustomed to the estimate for the categorical variable being equivalent to the respective cell means minus the grand mean. I know is the case in JMP - all other estimates from these data match the
2013 Jan 06
4
random effects model
Hi A.K Regarding my question on comparing normal/ obese/overweight with blood pressure change, I did finally as per the first suggestion of stacking the data and creating a normal category . This only gives me a obese not obese 14, but when I did with the wide format hoping to get a obese14,normal14,overweight 14 Vs hibp 21, i could not complete any of the models. This time I classified obese=1
2009 Jun 11
2
How to order an data.table by values of an column?
Hello! Can you help me? How to order an data.table by values of an column? Per example: Table no initial Categ Perc 468  31.52 351  27.52 0  0.77 234  22.55 117  15.99 table final Categ Perc 0  0.77 117  15.99 234  22.55 351  27.52 468  31.52 Lesandro Veja quais são os assuntos do momento no Yahoo! +Buscados [[alternative HTML version deleted]]
2007 May 18
4
Simple programming question
Hi R-users, I have a simple question for R heavy users. If I have a data frame like this dfr <- data.frame(id=1:16, categ=rep(LETTERS[1:4], 4), var3=c(8,7,6,6,5,4,5,4,3,4,3,2,3,2,1,1)) dfr <- dfr[order(dfr$categ),] and I want to score values or points in variable named "var3" following this kind of logic: 1. the highest value of var3 within category (variable named
2004 Mar 09
2
R and tmp directroy
Hi all, When I start R, it gives mkdir: Ne peut cr?er le r?pertoire `/home/mart/tmp/Rtmp11729'.: No such file or directory (I specify that my home path is /home/mart and the R version is 1.7.1) How I have to configure R to use the directory /tmp instead of /home/mart/tmp ? What is utility of this directory tmp for R? Thanks, Olivier
2007 Jun 28
5
Repeat if
Hello, (Power Book G4, Mac OS X, R 2.5.0) I would like to repeat the function range for 85 Vectors (V1-V85). I tried with this code: i<-0 > repeat { + i<-i+1 + if (i<85) next + range (Vi, na.rm = TRUE) + if (i==85) break + } I presume that the Vi is wrong, because in this syntax i is not known as a variable. But I don´t know how to say that it is a variable here. Would be nice if
2002 May 16
1
glm(y ~ -1 + c, "binomial") question
This is a question about removing the intercept in a binomial glm() model with categorical predictors. V&R (3rd Ed. Ch7) and Chambers & Hastie (1993) were very helpful but I wasn't sure I got all the answers. In a simplistic example suppose I want to explore how disability (3 levels, profound, severe, and mild) affects the dichotomized outcome. The glm1 model (see below) is
2010 Nov 24
2
Is there an equivalent to predict(..., type="linear") of a Proportional hazard model for a Cox model instead?
Hi all, Is there an equivalent to predict(...,type="linear") of a Proportional hazard model for a Cox model instead? For example, the Figure 13.12 in MASS (p384) is produced by: (aids.ps <- survreg(Surv(survtime + 0.9, status) ~ state + T.categ + pspline(age, df=6), data = Aidsp)) zz <- predict(aids.ps, data.frame(state = factor(rep("NSW", 83), levels =
2013 Aug 29
4
Add new calculated column to data frame
Hi, I have a following data set: id event time (in sec) 1 add 1373502892 2 add 1373502972 3 delete 1373502995 4 view 1373503896 5 add 1373503996 ... I'd like to add new column "time on task" which is time elapsed between two events (id2 - id1...). What would be the best approach to do that? Thanks, Srecko [[alternative HTML
2011 Jun 23
2
Rms package - problems with fit.mult.impute
Hi! Does anyone know how to do the test for goodness of fit of a logistic model (in rms package) after running fit.mult.impute? I am using the rms and Hmisc packages to do a multiple imputation followed by a logistic regression model using lrm. Everything works fine until I try to run the test for goodness of fit: residuals(type=c("gof")) One needs to specify y=T and x=T in the fit. But
2009 Oct 29
3
Removing & generating data by category
Dear R users, Basically, from the following arbitrary data set: a <- data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4))) > a
2011 Aug 28
1
Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
Dear developers, I have jutst started working with caret and all the nice features it offers. But I just encountered a problem: I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor). Everything was working fine I got the results, confussion matrix etc. BUT for obtaining the AUC and predicted probabilities I had to add
2013 Feb 17
6
histogram
HI Elisa, You could use ?cut() vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45) label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
2011 May 05
4
Using functions/loops for repetitive commands
I still need to do some repetitive statistical analysis on some outcomes from a dataset. Take the following as an example; id sex hiv age famsize bmi resprate 1 M Pos 23 2 16 15 2 F Neg 24 5 18 14 3 F Pos 56 14 23 24 4 F Pos 67 3 33 31 5 M Neg 34 2 21 23 I want to know if there are statistically detectable differences in all of the continuous variables in