similar to: if then else

Displaying 20 results from an estimated 1000 matches similar to: "if then else"

2006 Oct 12
1
Draw a circle at the end of a line
I have a plot of cumulative distribution function which is a step function, I'd like to put a cycle at the right end of each line to indicate that the value here is not available in this line. How can I do that? Thank you. cdf<-function(x){ do.call("rbind",lapply(1:nrow(as.matrix(x)), function(i){ a<-x[i] if (a<0.5){b=0.1} else if (a<1){b=0.3} else if
2006 Sep 29
1
Wilcoxon Rank test of Package Coin
Hi, I am running the following example which can be found on page 12 of the pdf file of COIN package wt<-wilcox_test(pd~age,data=water_transfer,distribution="exact", conf.int=TRUE) "wt" actually contains the estimate of difference in location and the confidence interval of it. I am just wondering how can I extract these values? From the examples, I understand that the
2006 Oct 05
1
The W statistic in wilcox.exact
Does anyone know why wilcox.exact gives W-statistic 6 instead of 12 as indicated below. 12 is the rank sum of group 0 of x, which is the linear statistic computed by wilcox_test. y<-c(1,2,3,4,5) x<-c(1,1,0,0,0) (a) wilcox.exact wilcox.exact(y~x) Exact Wilcoxon rank sum test data: y by x W = 6, p-value = 0.2 alternative hypothesis: true mu is not equal to 0 (b) wilcox_test
2006 Oct 12
1
Arrange histogram
The data set has a number of variables each of which is classified into two groups. For each variable of each group, I need to create a histogram. All the histograms are to be lined up into a file that looks like group1 group2 Variable 1 Histogram histogram Variable 2 Histogram histogram ........................... Can you give me a hint as to what
2006 Oct 13
1
side by side plot of Histogram and densityplot
Using "par" seems easily put a "hist" and a density side by side on the same output window. I would like to use some features in "histogram" from Lattice, but how can I put "histogram" and "densityplot" side by side on the same graph? Thank you par(mfrow=c(2,1)) hist(y) plot(density(y)) Jue Wang, Biostatistician Contracted Position for
2006 Sep 29
1
Confidence interval in the Wilcoxon exact test
Hi, Two functions wilcox.exact and wilcox_test give slightly different confidence intervals of the difference of the medians: for example y<-c(0,0,1.081,0.594,0,0.769,0,0.009,0,0,0.798,0.405,0.498,0.946,1.35,1.149,0.528) x<-c(rep(1,10),rep(2,7)) aa<-wilcox.exact(y~x,conf.int=TRUE) bb<-wilcox_test(y~factor(x),distribution="exact",conf.int=TRUE) aa bb Does anyone know
2006 Jan 05
4
Q: R 2.2.1: Memory Management Issues?
Dear Developers: I have a question about memory management in R 2.2.1 and am wondering if you would be kind enough to help me understand what is going on. (It has been a few years since I have done software development on Windows, so I apologize in advance if these are easy questions.) ------------- MY SYSTEM ------------- I am currently using R (version 2.2.1) on a PC running Windows 2000
2005 May 23
2
Trouble with drplot
Hi, I am a newbie with R, so I hope my question isn't too stupid. I am trying to generate dose-response curves using the "drfit" package. I have formatted my CSV files to the correct format, and have no trouble running drfit to get a summary of my data. The problem is that when I try to use "drplot" to graph my data I get an error. The message is: Error in
2006 Mar 08
5
data import problem
Dear All, I'm trying to read a text data file that contains several records separated by a blank line. Each record starts with a row that contains it's ID and the number of rows for the records (two columns), then the data table itself, e.g. 123 5 89.1791 1.1024 90.5735 1.1024 92.5666 1.1024 95.0725 1.1024 101.2070 1.1024 321 3 60.1601 1.1024 64.8023 1.1024 70.0593
2006 Sep 15
3
graphics and 'layout' question
Hello, I got stuck with a graphics question: I've 3 figures that I present on a single page (window) via 'layout'. The layout is layout(matrix(c(1,1,2,3), 2, 2, byrow=TRUE)); so that the frst plot spans the both columns in row one. Now I'd like to magnify the fist figure so that it takes 20% more vertical space (i.e. more space for the y-axis). How would I do this in R?
2005 Jul 21
4
RandomForest question
Hello, I'm trying to find out the optimal number of splits (mtry parameter) for a randomForest classification. The classification is binary and there are 32 explanatory variables (mostly factors with each up to 4 levels but also some numeric variables) and 575 cases. I've seen that although there are only 32 explanatory variables the best classification performance is reached when
2006 Nov 01
4
splitting very long character string
Hello, I've a very long character array (>500k characters) that need to split by '\n' resulting in an array of about 60k numbers. The help on strsplit says to use perl=TRUE to get better formance, but still it takes several minutes to split this string. The massive string is the return value of a call to xmlElementsByTagName from the XML library and looks like this: ... 12345
2005 Mar 31
2
pictex graphics device and color
Is the pictex graphics device known not to support color? In R 2.0.1 Patched (2004-11-17), it produced very pretty output: ## pictex(file = "modern-metatheonomy.tex", bg = "transparent"); ## plotData(data); ## dev.off() ... but it appears to have ignored all color information. __________ Steve Rowley <steve.rowley at sanofi-aventis.com> Cambridge, MA: (617) 768-4054
2007 Sep 05
1
question: randomization t-test function already defined in R?
Dear R Users, I am hoping you can help me. I have received code from a colleague who uses Matlab. I need to translate it into R. I am wondering if there is a randomization t-test (from non-parametric statistics) function already defined in R. (In Matlab the function is randtest.m.) ************************************************************************ ********** QUESTION: Is anyone
2005 Jun 28
2
svm and scaling input
Dear All, I've a question about scaling the input variables for an analysis with svm (package e1071). Most of my variables are factors with 4 to 6 levels but there are also some numeric variables. I'm not familiar with the math behind svms, so my assumtions maybe completely wrong ... or obvious. Will the svm automatically expand the factors into a binary matrix? If I add numeric
2006 Feb 02
2
calculating IC50
Hello, I was wondering if there is an R-package to automatically calculate the IC50 value (concentration of a substrance that inhibits cell growth to 50%) for some measurements. kind regards, Arne [[alternative HTML version deleted]]
2007 Mar 20
1
grid on a wireframe plot
Hello, I want to do a surface plot with wireframe from the lattice package. As for now I use the following command : print(wireframe(m,main="% my title", colorkey=TRUE, col.regions=rainbow(100), drape=TRUE,aspect = c(1,1.0),ylab="y",xlab="x",zlab="z", scales=list(arrows=FALSE)),split=c(1,1,3,2), more=TRUE) How can I show the gridlines in a 3D surface
2007 Aug 02
2
two plots super-impose
Dear R users, I used plot(x,y) to draw a scatter plot. I need to add another smaller histogram on the same plot I just had. However when I used hist(y), the histogram was on another page. Any suggestion? Best Regards, Philip [[alternative HTML version deleted]]
2006 Oct 12
1
Should NA's in summary() output always be reported???
Consider > summary(1:5) Min. 1st Qu. Median Mean 3rd Qu. Max. 1 2 3 3 4 5 > summary(c(1:5,NA)) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 1 2 3 3 4 5 1 Wouldn't it be more stringent if "NA's" was also reported in the first case?? Regards S?ren
2005 Apr 10
2
residuals in VGAM
Hi all: I want to fit a multinomial logit model with VGAM package, however I cannot find a way to check the residuals since residuals(my_model) and resid(my_model) does not work. Any suggestions? Thanks in advance. Alex Brito [[alternative HTML version deleted]]