Re: [R] Fitting gamma and exponential Distributions with fitdist

2011-04-28 Thread Joshua Wiley
Hi, I am not incredibly knowledgeable about gamma distributions, but looking at your data, you have a tiny mean:variance ratio, which, I believe, means that the bulk of the distribution will be near 0 and you may run into computational problems (again I think. I would gladly be corrected). This

Re: [R] RStudio -manipulate command

2011-04-28 Thread Henrik Bengtsson
It seems like the 'manipulate' package comes as part of the RStudio distribution. It's not part of the standard R and not on CRAN. You're more likely to get help on this via RStudio's website/forums. /Henrik On Wed, Apr 27, 2011 at 8:51 PM, veepsirtt veepsi...@gmail.com wrote:

Re: [R] Fitting gamma and exponential Distributions with fitdist

2011-04-28 Thread Prof Brian Ripley
On Wed, 27 Apr 2011, Joshua Wiley wrote: Hi, I am not incredibly knowledgeable about gamma distributions, but looking at your data, you have a tiny mean:variance ratio, which, I believe, means that the bulk of the distribution will be near 0 and you may run into computational problems (again I

[R] competitive risk model

2011-04-28 Thread Lao Meng
Hi all: Which function or package can perform competitive risk model? Thanks a lot! My best [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] AutomaticTRUE/FALSE Matrix Generation

2011-04-28 Thread ivan
Dear All, I am a newbee in R an have the following problem. I have variables AB,BC,CD to which outputs are assigned. Now AB[,1], for example, outputs a list, which is a random combination of the following characters: AB, BC, CD. What I want to do is to build a 3x3 matrix with colnames and

Re: [R] Snow/Snowfall hangs on windows 7

2011-04-28 Thread Truc
Dear Anna ! I have the same problem with Window 7 - 64 bits. If I use R 2.12.2 with snow packages 0.3-3. It works well. But with R 2.13.0 with the same snow packages. It just hang. I start R (Run as administrator), turn off firewall ... But it seems R .13.0 version of socket connect to window has

Re: [R] Trying to perform an inner loop a random number of times

2011-04-28 Thread Galen Moore
Thanks very much, Jim. I was incorrectly thinking that re-setting the variable feeding iter[i] would re-set iter[i] as well, I understand clearly now that it would and should not. Re-initialization of my vectors immediately before the start of the inner loop did the trick, and my program now

Re: [R] Fitting gamma and exponential Distributions with fitdist

2011-04-28 Thread vioravis
Joshua, thanks for your reply. I have tried out the following scaling and it seems to work fine: scaledVariable - (test-min(test)+0.001)/(max(test)-min(test)+0.002) The gamma distribution parameters are obtained using the scaled variable and samples obtained from this distributions are scaled

Re: [R] Fitting gamma and exponential Distributions with fitdist

2011-04-28 Thread vioravis
I tried using JMP for the same and get two distinct recommendations when using the unscaled values. When using the unscaled values, Log Normal appears to be best fit. fitdist in R is unable to provide a fit in this case. Compare Distributions ShowDistributionNumber of Parameters

[R] search functions for use on vector of ordered data

2011-04-28 Thread Jonathan Gabris
Hello, I am looking for some search functions that deal with _ordered data_. I suppose they already exist but I cannot find any reference of them. Explanation: I have a matrix, who's first column is ordered incrementally, with each value unique and regularly spaced. (timestamps of

[R] DLSODA error

2011-04-28 Thread Kristian Lind
Dear R-users, I'm running an MLE procedure where some ODEs are solved for each iteration in the maximization process. I use mle2 for the Maximum likelihood and deSolve for the ODEs. The problem is that somewhere along the way the ODE solver crashes and I get the following error message: DLSODA-

Re: [R] competitive risk model

2011-04-28 Thread Eik Vettorazzi
Hi, this is not meant to be offensive but please read the posting guide, especially the Do your homework before posting - part. RSiteSearch(competing risk) reveals amongst other a task view for survival models http://finzi.psych.upenn.edu/views/Survival.html hth. Am 28.04.2011 09:56, schrieb

Re: [R] ROCR for combination of markers

2011-04-28 Thread Eik Vettorazzi
Hi Rasanga, you may have a look at the 'improveProb' function from the Hmisc package. There you can compare the increase in prognostic power for several combinations of markers. You can create a ROC curve for a combination of markers by using the predicted risks eg. from a logistic regression

Re: [R] bwlpot problems: printing, and tick labels

2011-04-28 Thread Philipp Pagel
A. It produces empty JPEGs. When the 'bwplot' line alone is submitted, the plot duly shows up. See FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f BTW: don't use jpg for plotting if you can - they routinely look ugly. B. When the 'bwplot'

Re: [R] ROCR for combination of markers

2011-04-28 Thread Eik Vettorazzi
... and additionally, 'ROC' from the Epi package does the second step all in one. Am 28.04.2011 13:01, schrieb Eik Vettorazzi: Hi Rasanga, you may have a look at the 'improveProb' function from the Hmisc package. There you can compare the increase in prognostic power for several combinations

Re: [R] Instances of a C++ class in R

2011-04-28 Thread soeren . vogel
On 27.04.2011, at 11:59, soeren.vo...@uzh.ch wrote: We are working on a class in C++. The files compile fine (R CMD SHLIB ...) and run in R. A bzipped tar archive with source code can be downloaded from here: http://sovo.md-hh.com/files/GUTS3.tar.bz In R, dyn.load(GUTS.so) generates an

Re: [R] AutomaticTRUE/FALSE Matrix Generation

2011-04-28 Thread Sarah Goslee
Hi, You don't provide a reproducible example because we don't have any data to try, just the result dataframe. And I'll admit I got bogged down in trying to figure out what you're doing because your lists and columns and values are all the same pairs of characters. On Thu, Apr 28, 2011 at 4:25

[R] R forum for only Statistics

2011-04-28 Thread Vincy Pyne
Hi! I wish to know if there is any R forum which is meant only for Statistics? I mean where we can clarify our statistics doubts and seek knowledge. I know there are lot many books and internet sites, but 'R forum' has altogether different standard and very high level and one can learn a lot

[R] Extract complete rows by group and maximum

2011-04-28 Thread Sandy Small
Hi I'm trying to extract complete rows from a dataframe by group based on the maximum in a column within that group. Thus I have a dataframe: cvd_basestudy ... es_time ... _ study1... 0.3091667 study2... 0.3091667 study2... 0.2625000 study3...

[R] changing a specific column name

2011-04-28 Thread pdb
Hi, Can someone please tell me how to change the column name of a specific column. How do I change the name of the column 'Species'? Thanks in advance d - iris colnames(d) [1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species ind - which(names(d)=='Species') ind [1] 5

Re: [R] changing a specific column name

2011-04-28 Thread Breheny, Patrick
colnames(d)[ind] - 'new name' colnames(d) [1] Sepal.Length Sepal.Width Petal.Length Petal.Width new name -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of pdb Sent: Thursday, April 28, 2011 7:39 AM To: r-help@r-project.org

Re: [R] Extract complete rows by group and maximum

2011-04-28 Thread Dimitris Rizopoulos
two possibilities are: f - factor(DF$cvd_basestudy, unique(DF$cvd_basestudy)) ind - ave(DF$es_time, f, FUN = function (x) x == max(x)) DF[as.logical(ind), ] f - factor(DF$cvd_basestudy, unique(DF$cvd_basestudy)) lis - lapply(split(DF, f), function (d) d[which.max(d$es_time), ]) do.call(rbind,

Re: [R] changing a specific column name

2011-04-28 Thread Eik Vettorazzi
almost there, just use colnames(d)[ind] - 'new name' (order of brackets matters) Am 28.04.2011 13:39, schrieb pdb: Hi, Can someone please tell me how to change the column name of a specific column. How do I change the name of the column 'Species'? Thanks in advance d - iris

Re: [R] ctree and survival problem

2011-04-28 Thread Jonathan Daily
It would help people who know more about R's guts than me if you posted your sessionInfo() output and exactly what commands produced your error. It is also recommended that you try simply upgrading R to the latest version and see if you get an error with the latest version of 'party'. My guess is

Re: [R] setting options only inside functions

2011-04-28 Thread Jonathan Daily
I would also love to see this implemented in R, as my current solution to the issue of doing tons of open/close, dev/dev.off, etc. is to use snippets in my IDE, and in the end I feel like it is a hack job. A pythonic with function would also solve most of the situations where I have had to use

[R] Best Practices for submitting packages to CRAN

2011-04-28 Thread Singmann
Dear all, I (and a colleague) have been working on our first package (for fitting a certain type of cognitive models: http://www.psychologie.uni-freiburg.de/Members/singmann/R/mptinr) for quite a while now and have the feeling, that it is good to go. That is, we want to submit it to CRAN.

[R] Simple General Statistics and R question (with 3 line example) - get z value from pairwise.wilcox.test

2011-04-28 Thread JP
Hi there, I am trying to do multiple pairwise Wilcoxon signed rank tests in a manner similar to: a - c(runif(1000, min=1,max=50), rnorm(1000, 50), rnorm(1000, 49.9, 0.5), rgeom(1000, 0.5)) b - c(rep(group_a, 1000), rep(group_b, 1000), rep(group_c, 1000), rep(group_d, 1000))

[R] Problem installing package sp in R 2.13.0

2011-04-28 Thread Arnaud Catherine
Hi, I am having troubles trying to install package sp in R (2.13.0) on mac OSX. I have tried installing the package using GUi or function install.packages but it didn't work. Here is the error message I get: also installing the dependency ‘rgdal’ trying URL

[R] Help with multi-response multiple factor model with varying number of factors

2011-04-28 Thread Colleen Kenney
This is both a statistics and R question. I will give more detail if necessary. What packages of functions would help me to create a mutli-response model with multiple factors, where the number of levels for each factor is different? I have a couple hundred simulation experiments, and each

[R] Generate normally distributed correlation matrix

2011-04-28 Thread Richard Wang
Hi, I would like to ask a statistics questions. One way to generate a correlation matrix with normally distributed entries is by generating a matrix A with uniform or normal rows. Then normalize each row to get B. Then B times transpose B is the desired matrix. However, the standard

Re: [R] R forum for only Statistics

2011-04-28 Thread Jeremy Hetzel
Vincy, In addition to the R-help mailing list, other forums for R and statistics that I go to include: Stackoverflow's R tagged questions http://stackoverflow.com/questions/tagged/r StackExchange's Stats site: http://stats.stackexchange.com/ A Google search for R statistics forum shows a few

[R] for loop with global variables

2011-04-28 Thread ivan
Hi, is there a possibility to use global variables in a for loop. More specifically, I want to do the following: output.1-rbind(a,b) output.2-rbind(c,d) output.3-rbind(e,f) . . . output.n-rbind(...,...) next I want to create a data frame with two columns: Outputs Values output.1 a,b output.2

Re: [R] ROCR for combination of markers

2011-04-28 Thread Frank Harrell
Be careful not to use cutpoints at any stage. improveProb does not require this. ROC analysis on the other hand is dangerous in the sense that it tempts one to find cutpoints, which are not replicable or consistent with decision theory. Frank Eik Vettorazzi wrote: Hi Rasanga, you may have

Re: [R] for loop with global variables

2011-04-28 Thread jim holtman
Yes you can, but there is not enough explaination as to what you really want to do. I would suggest that you look at using a 'list' instead of individual objects: myList - list(output.1 = rbind('a','b'), output.2 = rbind('c','d'), ...) Then you can use 'lapply' to operation on the elements. On

[R] [R-pkgs] unknownR : you didn't know you didn't know?

2011-04-28 Thread Matthew Dowle
Do you know how many functions there are in base R? How many of them do you know you don't know? Run unk() to discover your unknown unknowns. It's fast and it's fun! unknownR v0.2 is now on CRAN. More information is on the homepage : http://unknownr.r-forge.r-project.org/ Or, just install the

[R] [R-pkgs] data.table 1.6 is now on CRAN

2011-04-28 Thread Matthew Dowle
data.table offers fast subset, fast grouping and fast ordered joins in a short and flexible syntax, for faster development. It was first released in August 2008 and is now the 3rd most popular package on Crantastic with 20 votes and 7 reviews. * X[Y] is a fast join for large data. *

Re: [R] Convert filogenetic tree to binary matrix

2011-04-28 Thread Ben Bolker
vanderlei52 vanderleidebastianimach at yahoo.com.br writes: I need to create a binary matrix with all node of a phylogenetic tree and the presence of each taxo in their respective node. I would suggest that you try this question on the r-sig-phylo mailing list instead. The phylobase

[R] [R-pkgs] spikeSlabGAM

2011-04-28 Thread Fabian Scheipl
spikeSlabGAM_0.9-6 (initial public release) spikeSlabGAM implements Bayesian variable selection, model choice, and regularized estimation in (geo-)additive mixed models for Gaussian, binomial, and Poisson responses. Its purpose is (1) to choose an appropriate subset of potential covariates and

[R] visualizing bootstrapped dendrogram

2011-04-28 Thread mimato
I want to classify bipolar neurons in human cochleas and have data of the following structure: Vol_Nuc Vol_Soma 1 186.23 731.96 2 204.58 4370.96 3 539.98 7344.86 4 477.71 6939.28 5 421.22 5588.53 6 276.61 1017.05 7 392.28 6392.32 8 424.43 6190.13 9 256.41 3850.51 10

[R] [R-pkgs] lavaan version 0.4-8

2011-04-28 Thread Yves Rosseel
Dear R-users, A new version of `lavaan' (for latent variable analysis) is now available on CRAN. The current version of lavaan (0.4-8) can be used for path analysis, confirmatory factor analysis, structural equation modeling, and growth curve modeling. More information can be found on the

Re: [R] for loop with global variables

2011-04-28 Thread ivan
Hi, thank you for the response. What I actually want to do is pick automatically the results of the various outputs (which I have already defined as variables, e.g. output.1,output.2,etc) and insert them into a table. The list variable would be redundant since in order to create the data frame I

[R] Odp: for loop with global variables

2011-04-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.04.2011 16:16:16: ivan i.pet...@gmail.com Odeslal: r-help-boun...@r-project.org 28.04.2011 16:16 Komu r-help@r-project.org Kopie Předmět [R] for loop with global variables Hi, is there a possibility to use global variables

Re: [R] visualizing bootstrapped dendrogram

2011-04-28 Thread Jeff Newmiller
No, you didn't provide the reproducible R code as the posting guide instructs you to. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing

Re: [R] ROCR for combination of markers

2011-04-28 Thread Rasanga Ruwanthi
Many thanks Eik. That was really helpful. I have found ROC function Epi package draws ROC curve for a combination of markers. What I tried was   library(Epi) x - rnorm( 100 ) z - rnorm( 100 ) w - rnorm( 100 ) tigol - function( x ) 1 - ( 1 + exp( x ) )^(-1) y1 - rbinom( 100, 1, tigol( 0.3 + 3*x +

Re: [R] for loop with global variables

2011-04-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.04.2011 16:59:26: ivan i.pet...@gmail.com Odeslal: r-help-boun...@r-project.org 28.04.2011 16:59 Komu jim holtman jholt...@gmail.com Kopie r-help@r-project.org Předmět Re: [R] for loop with global variables Hi, thank you

Re: [R] R forum for only Statistics

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 8:41 AM, Jeremy Hetzel wrote: Vincy, In addition to the R-help mailing list, other forums for R and statistics that I go to include: Stackoverflow's R tagged questions http://stackoverflow.com/questions/tagged/r StackExchange's Stats site:

[R] Coding design with repeated measurements in the survey package

2011-04-28 Thread ONKELINX, Thierry
Dear all, I'm working on a design with rotating panels. Each site is sampled every X year. Have a look at the code below the get an idea of the design. In reality the number of sites will be (much) higher. However I'm not sure if I coded the design correctly in svydesign(). Can someone

Re: [R] ROCR for combination of markers

2011-04-28 Thread Eik Vettorazzi
Hi, today I accidentally stumbled on a new? package named 'pROC', which might do the job library(pROC) out=ROC( form = y1 ~ x + z, plot=ROC) #calculate the underlying glm from ROC prd-predict(glm(y1 ~ x + z,family=binomial),type=response) #or use the results from ROC prd-out$res$lr.eta[-1]

Re: [R] for loop with global variables

2011-04-28 Thread Petr PIKAL
Hi Something like paste(output, i, sep = .) shall work You could consult FAQ 7.34 How can I save the result of each iteration in a loop into a separate file Regards Petr r-help-boun...@r-project.org napsal dne 28.04.2011 17:17:48: Petr PIKAL petr.pi...@precheza.cz Odeslal:

[R] how to generate a normal distribution with mean=1, min=0.2, max=0.8

2011-04-28 Thread Mao Jianfeng
Dear all, This is a simple probability problem. I want to know, How to generate a normal distribution with mean=1, min=0.2 and max=0.8? I know how the generate a normal distribution of mean = 1 and sd = 1 and with 500 data point. rnorm(n=500, m=1, sd=1) But, I am confusing with how to generate

Re: [R] how to generate a normal distribution with mean=1, min=0.2, max=0.8

2011-04-28 Thread Ravi Varadhan
Surely you must be joking, Mr. Jianfeng. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu -Original

[R] fit a marked poisson process using a quadrature scheme with 'spatstat'

2011-04-28 Thread Layman123
Hello everyone, My data consists of marked points and several covariates, whereby the marks are the time points of the observations. The problem is, that one of the covariates is hard to handle as an image. This covariate represents the type of roads. As there aren't roads at every location of

[R] help needed with LU decomposition: problem with sparse

2011-04-28 Thread Samuel Le
Dear all, I have a problem with the function lu to do LU decomposition: it seems that the algorithm multiplies the matrix I input by a permutation matrix for efficiency reasons -hence the sparse in the output. Does someone know whether it is possible to specify not to use any permutation

[R] Help ave() function

2011-04-28 Thread петрович
Hello again. Following a great idea from Jim and Dennis, I began to use the function ave() in my big data. I proved to use this command in my data with FUN=max(x,na.rm=T), and I received a Warning that translated looks like Warning in max (x, na.rm = T): no arguments to max; returning -Inf Is

Re: [R] ctree and survival problem

2011-04-28 Thread moleps
sessionInfo yields the following: sessionInfo() R version 2.11.1 (2010-05-31) x86_64-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats4tcltk splines grid stats graphics grDevices utils datasets

Re: [R] Help ave() function

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 12:30 PM, петрович wrote: Hello again. Following a great idea from Jim and Dennis, I began to use the function ave() in my big data. I proved to use this command in my data with FUN=max(x,na.rm=T), Try instead: look at the 3rd example of help(ave) and I received

Re: [R] ctree and survival problem

2011-04-28 Thread Achim Zeileis
On Thu, 28 Apr 2011, moleps wrote: sessionInfo yields the following: OK, the Design package causes the problem here. When you load the Design package, it provides a new Surv() and related methods. This clashes with the computations of ctree() based on Surv(). So it's better not to load

[R] Merging two columns of a data frame

2011-04-28 Thread Abraham Mathew
Hi folks, I have a simple question that I just can't solve. I'm trying to merge two columns in my data frame. sessionInfo() R version 2.13.0 (2011-04-13) Platform: i686-pc-linux-gnu (32-bit) head(dat) Year Month Number 2002 Jan 0 2002 Feb 0 2002 March0 2002 April

[R] How to average outputs

2011-04-28 Thread Dat Mai
Hello, I am trying to create a matrix that generates an output from 2 inputs. The problem I have is that I'm assigning a large set of data to various categories (that are used for the matrix). This technically means that I will have multiple output values for each unique set of inputs--I want to

Re: [R] Using help in Windows version of R with disabled browser [SOLVED]

2011-04-28 Thread cpoirier
Dear Ranjan, I'm afraid the command options(help_type = 'text') will not work if R is closed and opened again as the 'help_type' argument is set to 'html' by default in Windows (same for me). You should better modify the 'C:/Program Files/R/R-X.XX.X/etc/Rprofile.site' file with a text editor, as

Re: [R] Merging two columns of a data frame

2011-04-28 Thread Abraham Mathew
I've kind of solved the issue. dat$Time - paste(dat[,2], dat[,1], sep= ) head(dat) dat[,c(1,2)] - NA head(dat) head(dat) Year Month Number Time 1 NA NA 0 Jan 2002 2 NA NA 0 Feb 2002 3 NA NA 0 March 2002 4 NA NA 1 April 2002 5 NA NA 0 May 2002 6 NA NA 0 June 2002 unfortunately, can I delete the

Re: [R] how to generate a normal distribution with mean=1, min=0.2, max=0.8

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 12:09 PM, Ravi Varadhan wrote: Surely you must be joking, Mr. Jianfeng. Perhaps not joking and perhaps not with correct statistical specification. A truncated Normal could be simulated with: set.seed(567) x - rnorm(n=5, m=1, sd=1) xtrunc - x[x=0.2 x =0.8]

[R] Speed up code with for() loop

2011-04-28 Thread hck
Hallo everybody, I'm wondering whether it might be possible to speed up the following code: Error-rnorm(1000, mean=0, sd=0.05) estimate-(log(1.1)-Error) DCF_korrigiert-(1/(exp(1/(exp(0.5*(-estimate)^2/(0.05^2))*sqrt(2*pi/(0.05^2))*(1-pnorm(0,((-estimate)/(0.05^2)),sqrt(1/(0.05^2))-1))

[R] Putting x-axis in opposite order

2011-04-28 Thread Bogaso Christofer
Hi all, please consider this plot: xx - seq(4, 0.01, by = -0.04) yy - rnorm(xx) plot(xx, yy, type=l) Here you see my original 'xx' was in decreasing order, however R puts it in the increasing order. I understand that in any plot x and y axis grow is increasing order, however I am

Re: [R] Putting x-axis in opposite order

2011-04-28 Thread Breheny, Patrick
Try this: plot(xx, yy, type=l, xlim=rev(range(xx))) ___ Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] Putting x-axis in opposite order

2011-04-28 Thread Jonathan Daily
Actually, it is plotting the points in the decreasing order. See: plot(xx) Are you looking to reverse the x axis? Perhaps you will find an answer in either ?par or ?axis. On Thu, Apr 28, 2011 at 2:09 PM, Bogaso Christofer bogaso.christo...@gmail.com wrote: Hi all, please consider this plot:

Re: [R] Using help in Windows version of R with disabled browser [SOLVED]

2011-04-28 Thread Duncan Murdoch
On 28/04/2011 11:00 AM, cpoirier wrote: Dear Ranjan, I'm afraid the command options(help_type = 'text') will not work if R is closed and opened again as the 'help_type' argument is set to 'html' by default in Windows (same for me). That's a default, but you can change it when you install R if

Re: [R] ROCR for combination of markers

2011-04-28 Thread Eik Vettorazzi
Hi Rasanga, I think there is nothing wrong with that plot (you may compare both curves obtained by ROC from Epi and plot.roc from pROC). As usual, both functions plot (1-specificity) at the x-coordinate against sensitivity on y. Perhaps a bit confusing is the labelling of the latter function, it

Re: [R] how to generate a normal distribution with mean=1, min=0.2, max=0.8

2011-04-28 Thread Mao Jianfeng
Thanks a lot for all your replies. This may be a bad question. But, for me I was improved by asking this question. Thanks, Jian-Feng, 2011/4/28 David Winsemius dwinsem...@comcast.net On Apr 28, 2011, at 12:09 PM, Ravi Varadhan wrote: Surely you must be joking, Mr. Jianfeng. Perhaps

[R] Retrieving call sequence leading to a plot / Zooming in maps

2011-04-28 Thread Francois Rousseu
Hello R users When I want to zoom in on a map or any plot in R, I usually use the locator function to reset the limit of the plot and do something like: library(maptools) library(mapdata) map('worldHires',ylim=c(40,55),xlim=c(-90,-60)) points(-71,47,col=red,pch=16) text(-73,49,Hello)

Re: [R] ctree and survival problem

2011-04-28 Thread moleps
Yup, thats the culprit. Thx. //M On 28. apr. 2011, at 18.36, Achim Zeileis wrote: On Thu, 28 Apr 2011, moleps wrote: sessionInfo yields the following: OK, the Design package causes the problem here. When you load the Design package, it provides a new Surv() and related methods. This

[R] Subsetting Data

2011-04-28 Thread Abraham Mathew
I'm using the subset() function in R. dat - data.frame(one=c(6,7,8,9,10), Number=c(5,15,13,1,13)) subset(dat, Number = 10) However, I want to find the number of all rows who meet the Number=10 condition. I've done this in the past with something like colSums or rowSums or another similar

Re: [R] density plot of simulated exponential distributed data

2011-04-28 Thread Juanjuan Chai
I tried logspline function using a lower bound 0 for my data, it works like a charm. When the I changed the xlim only positive part, the vertical line was also gone. That's exactly what I expected. Thanks. -JJ Greg Snow wrote: You might want to use the logspline package instead of the

Re: [R] [BioC] arch=i386

2011-04-28 Thread Dan Tenenbaum
On Wed, Apr 27, 2011 at 4:46 AM, Stat Consult statconsul...@gmail.com wrote: Dear ALL I want to load HTSanalyzeR, It 's necessary to load igraph package. This time I see this error: library(igraph)  library(HTSanalyzeR) Loading required package: GSEABase Loading required package: Biobase

Re: [R] Subsetting Data

2011-04-28 Thread Jonathan Daily
Try this: sum(dat$Number = 10) On Thu, Apr 28, 2011 at 3:13 PM, Abraham Mathew abmathe...@gmail.com wrote: I'm using the subset() function in R. dat - data.frame(one=c(6,7,8,9,10), Number=c(5,15,13,1,13)) subset(dat, Number = 10) However, I want to find the number of all rows who meet the

Re: [R] Subsetting Data

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 3:13 PM, Abraham Mathew wrote: I'm using the subset() function in R. dat - data.frame(one=c(6,7,8,9,10), Number=c(5,15,13,1,13)) subset(dat, Number = 10) However, I want to find the number of all rows who meet the Number=10 condition. I've done this in the past with

Re: [R] Subsetting Data

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 3:38 PM, David Winsemius wrote: On Apr 28, 2011, at 3:13 PM, Abraham Mathew wrote: I'm using the subset() function in R. dat - data.frame(one=c(6,7,8,9,10), Number=c(5,15,13,1,13)) subset(dat, Number = 10) However, I want to find the number of all rows who meet the

[R] fisher exact for 2x2 table

2011-04-28 Thread viostorm
I'm using fisher.exact on a 4x2 table and it seems to work. Does anyone know exactly what is going on? I thought fisher.exact is only for 2x2 tables. Note: I can't use chi-squared because I have a couple of cells with 0 and 5 observations. -- View this message in context:

[R] Subscript out of Bounds

2011-04-28 Thread Dat Mai
I currently have this code: for(j in 2:n){ for(i in 1:(j-1)){ # Make sure the inputs are for the matrix m input1=rownames(m)[i] input2=colnames(m)[j] q=t[(t$Rec1==input1 t$Rec2==input2),output] if(length(q)==0){ q=t[(t$Rec1==input2 t$Rec2==input1),output] }

[R] subset without removing NAs

2011-04-28 Thread Benjamin Caldwell
Hi folks, I'm dealing with a dataset with a lot of NAs, and want to use subset on the data without removing the NAs from the the dataframe; e.g. rws50 - subset(rw.fire.RW,shigo.av50) This removes instances with NA for the value in addition to anything 50. Any suggestions much appreciated. *Ben

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread Mike Miller
On Thu, 28 Apr 2011, viostorm wrote: I'm using fisher.exact on a 4x2 table and it seems to work. Does anyone know exactly what is going on? I thought fisher.exact is only for 2x2 tables. You were wrong. I'm sure there's nothing wrong with the program. You will find that with bigger

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 3:45 PM, viostorm wrote: I'm using fisher.exact on a 4x2 table and it seems to work. Does anyone know exactly what is going on? I thought fisher.exact is only for 2x2 tables. Have you read the help page? -- David Winsemius, MD West Hartford, CT

Re: [R] Subscript out of Bounds

2011-04-28 Thread Duncan Murdoch
On 28/04/2011 3:49 PM, Dat Mai wrote: I currently have this code: for(j in 2:n){ for(i in 1:(j-1)){ # Make sure the inputs are for the matrix m input1=rownames(m)[i] input2=colnames(m)[j] q=t[(t$Rec1==input1 t$Rec2==input2),output] if(length(q)==0){

Re: [R] gridBase Base Plot Positioning

2011-04-28 Thread Paul Murrell
Hi On 28/04/2011 3:00 p.m., Dario Strbenac wrote: Hello, I'm trying to follow the documentation of how to use gridBase, and I've reached the minimal code example below as my best effort. Can someone explain how to keep the column of boxplots on the same page as the rectangles (even though I've

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread Thomas Lumley
On Fri, Apr 29, 2011 at 8:01 AM, Mike Miller mbmille...@gmail.com wrote: On Thu, 28 Apr 2011, viostorm wrote: I'm using fisher.exact on a 4x2 table and it seems to work. Does anyone know exactly what is going on?  I thought fisher.exact is only for 2x2 tables. You were wrong.  I'm sure

Re: [R] Coding design with repeated measurements in the survey package

2011-04-28 Thread Thomas Lumley
On Fri, Apr 29, 2011 at 3:23 AM, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Dear all, I'm working on a design with rotating panels. Each site is sampled every X year. Have a look at the code below the get an idea of the design. In reality the number of sites will be (much) higher.

Re: [R] subset without removing NAs

2011-04-28 Thread Jannis
On 04/28/2011 09:53 PM, Benjamin Caldwell wrote: rws50- subset(rw.fire.RW,shigo.av50) quick and dirty would be to replace all NAs with -9 (or similar), use subset, and set all values ==-9 in the subset back to NA. There may be more elegant solutions, though. Jannis

Re: [R] Retrieving call sequence leading to a plot / Zooming in maps

2011-04-28 Thread Greg Snow
You could always put the commands into a script or function, then instead of retyping everything just run the script or function. There is the zoomplot function in the TeachingDemos package which does what you are suggesting (but my quick test did not work with your map). You could use that

Re: [R] subset without removing NAs

2011-04-28 Thread Marc Schwartz
On Apr 28, 2011, at 3:21 PM, Jannis wrote: On 04/28/2011 09:53 PM, Benjamin Caldwell wrote: rws50- subset(rw.fire.RW,shigo.av50) quick and dirty would be to replace all NAs with -9 (or similar), use subset, and set all values ==-9 in the subset back to NA. There may be more

Re: [R] Subscript out of Bounds

2011-04-28 Thread Dat Mai
Great! I got it. Thanks a bunch. On Thu, Apr 28, 2011 at 4:02 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 28/04/2011 3:49 PM, Dat Mai wrote: I currently have this code: for(j in 2:n){ for(i in 1:(j-1)){ # Make sure the inputs are for the matrix m input1=rownames(m)[i]

Re: [R] Kolmogorov-Smirnov test

2011-04-28 Thread Greg Snow
A couple of things to consider: The Kolmogorov-Smirnov test is designed for distributions on continuous variable, not discrete like the poisson. That is why you are getting some of your warnings. With a sample size over 10,000 you will have power to detect differences that are not

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread viostorm
I have read the help page, or at least ?fisher.exact I looked a bit on the Internet I guess it is applicable to 2x2. I had spoken to a biostatistician here who is quite excellent and was adamant with me I could not do 2x2. I found this: http://mathworld.wolfram.com/FishersExactTest.html

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 4:23 PM, viostorm wrote: I have read the help page, or at least ?fisher.exact Then it should have been clear that more than 2x2 tables can be used. I looked a bit on the Internet I guess it is applicable to 2x2. I had spoken to a biostatistician here who is quite

Re: [R] subset without removing NAs

2011-04-28 Thread David Winsemius
On Apr 28, 2011, at 3:53 PM, Benjamin Caldwell wrote: Hi folks, I'm dealing with a dataset with a lot of NAs, and want to use subset on the data without removing the NAs from the the dataframe; e.g. rws50 - subset(rw.fire.RW,shigo.av50) This removes instances with NA for the value in

Re: [R] subset without removing NAs

2011-04-28 Thread Benjamin Caldwell
Thanks, that worked. *Ben Caldwell* On Thu, Apr 28, 2011 at 2:02 PM, David Winsemius dwinsem...@comcast.netwrote: On Apr 28, 2011, at 3:53 PM, Benjamin Caldwell wrote: Hi folks, I'm dealing with a dataset with a lot of NAs, and want to use subset on the data without removing the NAs

Re: [R] ROCR for combination of markers

2011-04-28 Thread Rasanga Ruwanthi
Thanks Eik. As you said both packages give the same result, except labelling of the x axis. --- On Thu, 28/4/11, Eik Vettorazzi e.vettora...@uke.uni-hamburg.de wrote: From: Eik Vettorazzi e.vettora...@uke.uni-hamburg.de Subject: Re: [R] ROCR for combination of markers To: Rasanga Ruwanthi

Re: [R] Speed up code with for() loop

2011-04-28 Thread Jeremy Hetzel
Hans, You could parallelize it with the multicore package. The only other thing I can think of is to use calls to .Internal(). But be vigilant, as this might not be good advice. ?.Internal warns that only true R wizards should even consider using the function. First, an example with

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread Mike Miller
On Fri, 29 Apr 2011, Thomas Lumley wrote: On Fri, Apr 29, 2011 at 8:01 AM, Mike Miller mbmille...@gmail.com wrote: On Thu, 28 Apr 2011, viostorm wrote: I'm using fisher.exact on a 4x2 table and it seems to work. Does anyone know exactly what is going on?  I thought fisher.exact is only

Re: [R] DLSODA error

2011-04-28 Thread Thomas Petzoldt
Kristian, your example is rather complex and somewhat time consuming even on fast computers, so it is not easy to track your problem down to its original reason. However, what is clear to me is that this is definitely *not* not a problem of deSolve and most likely even not of optim, it is

Re: [R] fisher exact for 2x2 table

2011-04-28 Thread Mike Miller
On Thu, 28 Apr 2011, viostorm wrote: I have read the help page, or at least ?fisher.exact I looked a bit on the Internet I guess it is applicable to 2x2. I had spoken to a biostatistician here who is quite excellent and was adamant with me I could not do 2x2. I found this:

  1   2   >