[R] simulations with very large number of iterations (1 billion)

2011-04-15 Thread Marion Dumas
Hello R-help list I'm trying to run 1 billion iterations of a code with calls to random distributions to implement a data generating process and subsequent computation of various estimators that are recorded for further comparison of performance. I have two question about how to achieve

Re: [R] Categorical bubble plot

2011-04-15 Thread Michael bibo
Jurgens de Bruin debruinjj at gmail.com writes: Hi, I do not have much R experience just the basics, so please excuse any obvious questions. I would like to create bubble plot that have Categorical data on the x and y axis and then the diameter if the bubble the value related to x and

Re: [R] mixed model random interaction term log likelihood ratio test

2011-04-15 Thread seatales
1. The three levels of the vector DrugPair actually represent three genotypes, which are some randomly chosen genotypes from a population of many genotypes. That's why I thought it was justified as random effect. Does estimating them as random make sense then? 2. Also could you please elaborate

[R] How to generate a correlation matrix with restrictions on its eigenvalues

2011-04-15 Thread Chee Chen
Dear All, I would like to generate m positive real numbers c_i, I=1,...,m, such that (1) c_1 + c_2 + ... + c_m=m, (1) after being ordered into c_1 = c_2 = =c_m0, we have that c_m is of the same order of m^(-1/8), when m is sufficiently large. Thanks, -Chee [[alternative HTML

Re: [R] simulations with very large number of iterations (1 billion)

2011-04-15 Thread Brian J Mingus
On Thu, Apr 14, 2011 at 7:41 PM, Marion Dumas mario...@gmail.com wrote: Hello R-help list I'm trying to run 1 billion iterations of a code with calls to random distributions to implement a data generating process and subsequent computation of various estimators that are recorded for further

Re: [R] [Rcpp-devel] Find number of elements less than some number: Elegant/fastsolution needed

2011-04-15 Thread Christian Gunning
On Thu, Apr 14, 2011 at 7:02 PM, rcpp-devel-requ...@r-forge.wu-wien.ac.at wrote: I was able to write a very short C++ function using the Rcpp package that provided about a 1000-fold increase in speed relative to the best I could do in R.  I don't have the script on this computer so I will

Re: [R] Automatically extract info from Granger causality output

2011-04-15 Thread Pfaff, Bernhard Dr.
Dear Ivan, first, it would pay-off in terms of readability to employ line breaks and second to provide a reproducable code snippet and third which package you have used. Now to your questions: 1) What happens if you provide colnames for your objects? 2) What happens if you omit the $ after

Re: [R] Plotting an Underbrace in R

2011-04-15 Thread Michael McAssey
Ben, This example of pgfSweave looks like it would address my problem.  I installed this package, but I cannot determine how to use it to make R convert LaTeX commands into mathematical symbols on an R plot.  The documentation does not seem to address this.  I tried to mimic the example from

Re: [R] simulations with very large number of iterations (1 billion)

2011-04-15 Thread Viechtbauer Wolfgang (STAT)
We do not know the details of the kinds of computations you intend to do within each iteration, but if, let's say, each iterations takes around 1 second, then your simulation will run for the next 30+ years (on a single core). Even if each iteration only takes a fraction of a second, you are

Re: [R] Automatically extract info from Granger causality output

2011-04-15 Thread ivan
Dear Bernhard, thank you very much for the response. Yes, I am using the packsges vars with fuchrions VAR() and causality(). 1)Giving colnames to the objects does unfortunately not change anything. 2) I am not sure if I understood you right. Did you mean to insert Countml$Granger$p.value

Re: [R] Plotting an Underbrace in R

2011-04-15 Thread baptiste auguie
Hi, Through pgfSweave you can use the tikz device, which is the one that can interpret Latex code (package tikzDevice). I would start with a minimal self-contained plot with this function. see ?tikz for examples. HTH, baptiste On 15 April 2011 20:03, Michael McAssey mpmcas...@gmail.com

Re: [R] Automatically extract info from Granger causality output

2011-04-15 Thread Pfaff, Bernhard Dr.
Hello Ivan, see example(causality) for the first question and use count[[i]] and not count$[[i]] for the second. The following works for me: example(causality) test1 - causality(var.2c, e) test2 - causality(var.2c, prod) tl - list(test1, test2) res - matrix(NA, ncol = 1, nrow = length(tl))

[R] as.matrix strangeness

2011-04-15 Thread Michael Bach
Dear R users, I presume there is something foul with system: a - c(1,2,3,4) as.matrix(a, ncol=2) Output: [,1] [1,]1 [2,]2 [3,]3 [4,]4 The vignette for as.matrix says nrow (ncol) will be deduced from length and ncol (nrow). It does not work even when I additionally

Re: [R] Sweave and Slides (Beamer)

2011-04-15 Thread Brett Presnell
Liviu Andronic landronim...@gmail.com writes: Not a solution that would work in all cases, have you tried reducing the font size? Yes, I have done this. I've also eliminated all the stuff that beamer puts on the screen (title bars, navigation symbols, etc), to the point that I probably

Re: [R] as.matrix strangeness

2011-04-15 Thread Adrian Duffner
Hallo Michael, check ?matrix and compare to as.matrix. as.matrix does not provide a ncol argument. To get a 2 by 2 matrix use matrix(a, ncol=2) Regards Adrian Am 15.04.2011 11:42, schrieb Michael Bach: Dear R users, I presume there is something foul with system: a- c(1,2,3,4) as.matrix(a,

Re: [R] how to enclose two xyplot

2011-04-15 Thread Francesco Nutini
Sorry, my previous mail was incomplete. I mean, one of my xyplot is build with the command doubleYScale (in order to overlap two line with different Y-axis). But doubleYScale doesn't run with the nice command that you have suggested: first plot: a-xyplot(NDVI_P10~dek_num | Year,

[R] Odp: nesting multiple for loops

2011-04-15 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.04.2011 01:34:22: Hi everyone. I am quite frustrated that this doesn't work, as all the functions within work fine by themselves. I'd also like any pointers to how to avoid 'for' loops in my code. I understand it's less than desirable, but

Re: [R] Plotting an Underbrace in R

2011-04-15 Thread Michael McAssey
Baptiste, Thank you. The examples in the documentation for tikz helped me solve this problem, and give me a good tool for future plots. I only need to figure out how to incorporate LaTeX packages like amssymb so that I can use \mathbb{} to put the real numbers symbol in my plot. Regards,

Re: [R] Categorical bubble plot

2011-04-15 Thread Jim Lemon
On 04/14/2011 11:48 PM, Jurgens de Bruin wrote: Hi, I do not have much R experience just the basics, so please excuse any obvious questions. I would like to create bubble plot that have Categorical data on the x and y axis and then the diameter if the bubble the value related to x and y.

Re: [R] as.matrix strangeness

2011-04-15 Thread Michael Bach
Hi Adrian, thanks for the hint. The problem was that it showed me help for matrix when I did ?as.matrix. I thought it was some kind of convention that data type conversion functions start with as., so now I will take more care in the future. With matrix() it works as expected, thanks again.

Re: [R] how to enclose two xyplot

2011-04-15 Thread Felix Andrews
Hi, Could you not simplify your a and b plots into one like xyplot(NDVI_P10 + AVG_NDVI_P10 ~ dek_num | Year, data=data, lty = 3:2, col = c(darkgrey, black), ..., [etc] auto.key = list(lines = TRUE, points = FALSE)) Otherwise please provide a commented, minimal, self-contained,

Re: [R] predict

2011-04-15 Thread Paul Hiemstra
On 04/14/2011 10:49 PM, Serdar Akin wrote: PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] How to generate a correlation matrix with restrictions on its eigenvalues

2011-04-15 Thread Ravi Varadhan
Generate random numbers from a multinomial. ?rmultinom # The following will generate n multinomial vectors each of size m rmultinom(n, size=m, prob=m^(-1/8)) # you need to specify probabilities appropriately Ravi. From: r-help-boun...@r-project.org

[R] str() on a data frame with 600 variables

2011-04-15 Thread zubin
Hello.. How do I get str() to show all variables in a data frame? It seems to be list output truncated at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't seem to figure this out - help will be appreciated.

[R] Sweave Executes Package Functions Twice

2011-04-15 Thread Dario Strbenac
Hi, I've got something strange going on. I'm trying to compile a vignette using Sweave(vignette.Rnw), and in the first code chunk that illustrates an example, I noticed from the output text I have inside the function, that it is running it twice, because the sequence of message() statements is

[R] GLM output for deviance and loglikelihood

2011-04-15 Thread Jeffrey Pollock
It has always been my understanding that deviance for GLMs is defined by; D = -2(loglikelihood(model) - loglikelihood(saturated model)) and this can be calculated by (or at least usually is); D = -2(loglikelihood(model)) As is done so in the code for 'polr' by Brian Ripley (in the

Re: [R] Sweave Executes Package Functions Twice

2011-04-15 Thread Duncan Murdoch
On 15/04/2011 7:00 AM, Dario Strbenac wrote: Hi, I've got something strange going on. I'm trying to compile a vignette using Sweave(vignette.Rnw), and in the first code chunk that illustrates an example, I noticed from the output text I have inside the function, that it is running it twice,

Re: [R] str() on a data frame with 600 variables

2011-04-15 Thread Marc Schwartz
On Apr 15, 2011, at 7:19 AM, zubin wrote: Hello.. How do I get str() to show all variables in a data frame? It seems to be list output truncated at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't

Re: [R] str() on a data frame with 600 variables

2011-04-15 Thread Duncan Murdoch
On 15/04/2011 8:19 AM, zubin wrote: Hello.. How do I get str() to show all variables in a data frame? It seems to be list output truncated at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show all variables, we see list.len() but again can't seem to

Re: [R] Statistical Tables Really Fast

2011-04-15 Thread Michael Friendly
On 4/14/2011 7:22 PM, Dirk Eddelbuettel wrote: Sorry, but this is the r-help list. The 'R Spam' list is over at /dev/null. Clearly a fortune candidate! -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. York University Voice: 416 736-5115 x66249 Fax:

Re: [R] Categorical bubble plot

2011-04-15 Thread Ben Bolker
On 04/15/2011 01:13 AM, Jurgens de Bruin wrote: Thanks for the reply... with reproducible I am believe you require a dataset? yes -- but you can make one up if you like. e.g. dd - expand.grid(drugclass=LETTERS[1:5], plant=c(cactus,sequoia,mistletoe)) set.seed(101) dd$fitvalue -

Re: [R] [Rcpp-devel] Find number of elements less than some number: Elegant/fastsolution needed

2011-04-15 Thread Douglas Bates
On Thu, Apr 14, 2011 at 11:47 PM, Christian Gunning x...@unm.edu wrote: On Thu, Apr 14, 2011 at 7:02 PM, rcpp-devel-requ...@r-forge.wu-wien.ac.at wrote: I was able to write a very short C++ function using the Rcpp package that provided about a 1000-fold increase in speed relative to the best

[R] Can't use attributes from gml file in Cytoscape

2011-04-15 Thread Sandeep Amberkar
Hello, I am exporting a graph in gml format from igraph 0.5.5. When I open the file in Cytoscape v.2.7 I can't map the color attribute that I assign to the graph when I export it from igraph. Could anyone help me in this? Thanks. -- Warm Regards, Sandeep Amberkar BioQuant,BQ26, Im Neuenheimer

[R] adding a name to cross tab margins

2011-04-15 Thread Dmitry Berman
Listers, I have created a cross-tab matrix using the following code: S - c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,1,2,3,1,1,2,3,1,2,2) F - c(1,2,3,1,2,3,1,1,1,1,2,3,1,1,3,2,2,2,1,2,3,1,1,1,1,2,3,3,1,3,1,3,1,1,2,3,1,1,3,2,3,2,1,1,1,2,3,1,1,2) table(S,F) fF

Re: [R] adding a name to cross tab margins

2011-04-15 Thread Sarah Goslee
Hi Dmitry, Nothing is seriously wrong. You want to set the fourth column name, so take column names THEN the fourth element: colnames(PiD)[4] - total Thank you for providing a clear and simple reproducible example. Sarah On Fri, Apr 15, 2011 at 9:29 AM, Dmitry Berman ravenb...@gmail.com

Re: [R] extract cells by columns/rows from matrix

2011-04-15 Thread Jannis
which(data==max(data),arr.ind=TRUE) gives you the indices of the largest element. which(data==data[order(data)[2]],arr.ind=TRUE) the indices of the second largest. Best Jannis On 04/14/2011 10:23 PM, Nicolas Gutierrez wrote: hi All, I have a matrix Ufi (x by y) 1 2 3 4 5 1 0 0 0

Re: [R] str() on a data frame with 600 variables

2011-04-15 Thread zubin
perfect! thx On 4/15/2011 8:43 AM, Duncan Murdoch wrote: On 15/04/2011 8:19 AM, zubin wrote: Hello.. How do I get str() to show all variables in a data frame? It seems to be list output truncated at about 99 variables, the data frame has over 600 but i can't seem to figure out how to show

Re: [R] Conveting SAS Proc mixed to R code

2011-04-15 Thread Ben Bolker
Kevin Wright kw.stat at gmail.com writes: I am trying to teach myself R and replicate some previous SAS analysis. Could someone please help me translate the following SAS code into R. Proc mixed method=ml Class Group Treatment Stream Time Year; Model Logrpk=Treatment Time

Re: [R] adding a name to cross tab margins

2011-04-15 Thread andrija djurovic
Hi. Have a look also at ?addmargins. addmargins(table(fS,fF),c(1,2),FUN=list(total.row=sum,total.col=sum)) Andrija On Fri, Apr 15, 2011 at 3:29 PM, Dmitry Berman ravenb...@gmail.com wrote: Listers, I have created a cross-tab matrix using the following code: S -

Re: [R] frailtypack

2011-04-15 Thread Uwe Ligges
On 14.04.2011 18:04, Paul78 wrote: I have got the same problem. Can anybody help me why R just shuts down? 1. please quote the original message, mailing list readers do not see it and it is hard to access it. 2. please specify a reproducible example as the posting guide quoted below

Re: [R] Problem with R 2.13.0 Task Views (on Mac)

2011-04-15 Thread Uwe Ligges
On 14.04.2011 18:14, rbali wrote: Same problem with Vista 1. Please quote the original message, mailing list readers are not able to follow otherwise! 2. Peter Dalgaard wrote that it is a bug in the ctv package, so everything is said already. And rather than posting here, why not ask the

Re: [R] adding a name to cross tab margins

2011-04-15 Thread andrija djurovic
Sorry, I've just reversed the names of dimensions :) addmargins(table(fS,fF),c(1,2),FUN=list(total.col=sum,total.row=sum)) Andrija On Fri, Apr 15, 2011 at 3:50 PM, andrija djurovic djandr...@gmail.comwrote: Hi. Have a look also at ?addmargins.

Re: [R] as.matrix strangeness

2011-04-15 Thread Ista Zahn
Hi Michael, It helps to look at the Usage section of the help pages. There you will see that matrix() has an ncol argument, but as.matrix() does not. Best, Ista On Fri, Apr 15, 2011 at 7:08 AM, Michael Bach pha...@gmail.com wrote: Hi Adrian, thanks for the hint.  The problem was that it

[R] Adding Time Series to data.frame without knowing the name of teh time series

2011-04-15 Thread Paolo Rossi
Hello, quick question I reckon. Is there a way to add to time series to a dataframe without knowing their name in advance? I can figure it out the following but wondered if there is a better way Thanks Paolo a = data.frame(i = rep(100, 12)) colnames(a)[length(colnames)] = i

Re: [R] Can't use attributes from gml file in Cytoscape

2011-04-15 Thread Gábor Csárdi
Hi, the problem is that igraph puts node colors into the GML file as simple vertex attributes, but this is not what Cytoscape expects. Plus, it seems that Cytoscape does not read all the node/edge attributes from the GML file, only the ones it interprets, so the color information is lost. Sadly,

[R] prediction error in ROCR package when sampled y consists of only one class

2011-04-15 Thread Soyeon Kim
Dear R users, Hi. I am using prediction function in ROCR package. y consists of two classes 0 and 1. However, since I am using cross-validation, a sampled small number of y may consist of only one class y [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 In this case, prediction function gives an

Re: [R] automate package installation

2011-04-15 Thread Uwe Ligges
On 13.04.2011 02:11, jkang wrote: I have an ubuntu image with R installed. I want to install a list of packages that does not come with R. eg. cluster, gplots, hacks, mapdata. etc. Over time this list may grow. Is there a config file that can tell R what and where to install additional

Re: [R] Trouble using duleg from labdsv

2011-04-15 Thread Uwe Ligges
On 14.04.2011 19:48, droberts wrote: I apologize for the slow response, but I just registered with Nabble. The duleg function in labdsv was renamed indval to be more consistent with its use in the literature. Typing ?indval will provide more information. As an aside, all R functions have

Re: [R] plotting line graphs for output from crosstabs function

2011-04-15 Thread Uwe Ligges
On 14.04.2011 12:47, taby gathoni wrote: Hi R-users, This is a generic question, is there a way to plot a line graph for the output from crosstable function? one of the inputs to the crosstab function is categorical. Generic answer: probably yes. According to the posting guide, you have

Re: [R] Stepwise Regression with no Origin

2011-04-15 Thread Uwe Ligges
On 12.04.2011 21:52, Zd Gibbs wrote: Sorry, the first version was incomplete. I'm trying again. I am running a regression equation and i want to enter in 12 IV then stepwise enter 8 variables and not have an origin. DV is shfl. I want to enter in the following 12 independent dummy variables

Re: [R] prediction error in ROCR package when sampled y consists of only one class

2011-04-15 Thread Uwe Ligges
On 15.04.2011 17:00, Soyeon Kim wrote: Dear R users, Hi. I am using prediction function in ROCR package. y consists of two classes 0 and 1. However, since I am using cross-validation, a sampled small number of y may consist of only one class y [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Re: [R] help on compare two ranks

2011-04-15 Thread Uwe Ligges
Sounds like homework. Anyway, lookup rank correlations (Spearman, Kendall, etc.) and correpsonding tests. Uwe Ligges On 14.04.2011 17:00, Baoqiang Cao wrote: Hi, I have to one set of inputs and their observed true values of each input. Now I have a model takes the input and predict a value.

[R] boxplot with 2 treatments and 2 variables (with 2 corresponding y-axes)

2011-04-15 Thread Ellis, David
Hi, I am a complete newcomer to R and although I can plot standard box-plots I am struggling with this... I have two treatments - A B, and 2 variables 1 2. I want to compare boxplots of variable 1 with variable 2 for each treatment. I would also like them to all be on the same graphic. I

[R] no solution yet, please help: extract p-value from mixed model in kinship package

2011-04-15 Thread Ram H. Sharma
I am making the question clear. Please help. Dear R experts I was using kinship package to fit mixed model with kinship matrix. The package looks like lme4, but I could find a way to extract p-value out of it. I need to extract is as I need to analyse large number of variables ( 1).

[R] Rsquared for anova

2011-04-15 Thread Dorien Herremans
I calculate an anova test in the following way: expdata-read.table(/home/dorien/UA/meta-music/optimuse/optimuse1-build-desktop/results/results_processedCP, header=TRUE) names(expdata)-c('nh1','nh2','nh3','randsize','aweights','tt1','tt2','tt3','path','iters','type','length','tos','tws','time')

[R] question

2011-04-15 Thread Pamela Santelices Elgueta
I have a question, What is the maximum storage capacity of data that R has? Thanks Pamela Santelices Elgueta Estadístico Instituto Nacional de Estadísticas Fono: (56-2) 7962491 Paseo Bulnes 209 oficina 82 Santiago [[alternative HTML version deleted]]

Re: [R] modify particular factor levels

2011-04-15 Thread Dieter Menne
baptiste auguie-5 wrote: I wish to modify programmatically only a few factor levels, according to a named list. I came up with this function.. . It seems to work, but the original order of the levels is changed. The split-and-unite policy you use makes it a bit difficult to

Re: [R] Rsquared for anova

2011-04-15 Thread Dieter Menne
dorien wrote: I calculate an anova test in the following way: ... aov example I want to check the fit of the model with Rsquared Try summary(lm(...)) instead. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Rsquared-for-anova-tp3452399p3452434.html Sent

Re: [R] question

2011-04-15 Thread Duncan Murdoch
On 15/04/2011 12:05 PM, Pamela Santelices Elgueta wrote: I have a question, What is the maximum storage capacity of data that R has? There isn't a simple answer to this question. Vectors have a maximum length of about 2 billion entries, and matrices are stored as vectors. Most often you

[R] Idetntifying nearest topographic contours to data points

2011-04-15 Thread sam.e
Hi there, I have two data sets, one of locations at different elevations (x,y,z) and the other of points that make up topographic contours (also x,y,z). I have used: result-apply(distppll(data2,cbind(topocon[-nrow(topocon),],topocon[-1,])),1,min) where 'data2' are my measurement coordinates (x,

Re: [R] nesting multiple for loops

2011-04-15 Thread Ben Hunter
Thanks Petr, Actually, I figured it out last night. Please read on only if you're sort of interested. You're absolutely right, I hastily changed my function to be more 'readable' without thinking that I was using a name that was already a function. What I wanted was a cross-tabulation of f1 and

[R] GLM and normality of predictors

2011-04-15 Thread Simone Santoro
Hi, I have found quite a few posts on normality checking of response variables, but I am still in doubt about that. As it is easy to understand I'm not a statistician so be patient please. I want to estimate the possible effects of some predictors on my response variable that is nº of males

[R] Extract information from the names of a list within lapply

2011-04-15 Thread Jun Shen
Dear list, I want to loop over a list through lapply and at the same time I want to extract some information from the names of the list elements. lapply does not seem to carry the names. Is there anyway to access the names of a list within lapply? Thanks. Jun [[alternative HTML version

Re: [R] GLM and normality of predictors

2011-04-15 Thread Christian Hennig
Normality of the predictors doesn't belong to the assumptions of the GLM, so you don't have to check this. Note, however, that there are all kinds of potential problems which to detect is fairly hopeless with n=11 and three predictors, so you shouldn't be too confident about your results

Re: [R] Extract information from the names of a list within lapply

2011-04-15 Thread Joshua Wiley
Hi Jun, On Fri, Apr 15, 2011 at 11:14 AM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I want to loop over a list through lapply and at the same time I want to extract some information from the names of the list elements. lapply does not seem to carry the names. Is there anyway to access

Re: [R] Extract information from the names of a list within lapply

2011-04-15 Thread Henrique Dallazuanna
Try this: lapply(mtcars, function(.)names(mtcars)[match.call()[[2]][[3]]]) On Fri, Apr 15, 2011 at 3:14 PM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I want to loop over a list through lapply and at the same time I want to extract some information from the names of the list elements.

[R] Monte Carlo Simulation

2011-04-15 Thread Shane Phillips
Hello, R friends... I am very new to R, and I need some help. I am trying to construct a simulation for my dissertation. I need to create 1000 datasets of 1000 subjects with the following variables... Treatment variable - Drawn from a binomial distribution (1 run, prob=.13) Covariate 1 -

[R] Whole genome searching of 100bp D sequence

2011-04-15 Thread Amos Folarin
Hi, I was wondering I'm going about this in the correct way. I need to test if there are coding sequences or exons in hg19 which match a string of 100bp D i.e. [A,G or T]. However I'm getting a strange result. I get a hit on chr7, using the 100bp search however when I search with 60bp sequence of

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Charles Annis, P.E.
What have you tried so far? It is often helpful to begin with a much simpler problem, then add complexity incrementally until you've constructed the desired model. Best wishes. Charles Annis, P.E. charles.an...@statisticalengineering.com 561-352-9699 http://www.StatisticalEngineering.com

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Shane Phillips
Here's a script of what I have so far. I have a few problems. First, the correlations. Next, recoding that categorical variable into dichotomous variables. Finally, the iterative filename thing. Thanks! S -Original Message- From: Charles Annis, P.E.

Re: [R] GLM and normality of predictors

2011-04-15 Thread Sacha Viquerat
Am 15.04.2011 20:14, schrieb Christian Hennig: Normality of the predictors doesn't belong to the assumptions of the GLM, so you don't have to check this. Note, however, that there are all kinds of potential problems which to detect is fairly hopeless with n=11 and three predictors, so you

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Ista Zahn
Hi Shane, See ?rbinom, ?rnorm, ?mvrnorm (in the MASS package), ?sample, ?for and ?write.table Best, Ista On Fri, Apr 15, 2011 at 2:49 PM, Shane Phillips sphill...@lexington1.net wrote: Hello, R friends... I am very new to R, and I need some help.  I am trying to construct a simulation for

Re: [R] Extract information from the names of a list within lapply

2011-04-15 Thread Jun Shen
Thanks, Joshua and Henrique. Henrique's solution is very interesting. Could you explain a bit more? What does this grammar mean? match.call()[[2]][[3]] Jun On Fri, Apr 15, 2011 at 1:27 PM, Henrique Dallazuanna www...@gmail.comwrote: Try this: lapply(mtcars,

[R] How to view only error messages on R install in Ubuntu?

2011-04-15 Thread Iurie Malai
Hi, When I install R in Ubuntu/Linux, is it possible to view only the error messages without the installation progress? And how? Regards, Iurie Malai Moldova Pedagogical State University [[alternative HTML version deleted]] __

Re: [R] How to view only error messages on R install in Ubuntu?

2011-04-15 Thread Iurie Malai
Sorry, I meant: when installing R packages with 'install.packages()'. 2011/4/15 Iurie Malai iurie.ma...@gmail.com Hi, When I install R in Ubuntu/Linux, is it possible to view only the error messages without the installation progress? And how? Regards, Iurie Malai Moldova Pedagogical

[R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread zhenjiang xu
Hi all, Suppose I have 2 data.frame , a and b, how can I add them together to get c? Thanks a A a 1 b 2 c 3 b A a 6 c 1 c A a 7 b 2 c 4 -- Best, Zhenjiang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Jeremy Miles
On 15 April 2011 12:03, Shane Phillips sphill...@lexington1.net wrote: Here's a script of what I have so far.  I have a few problems.  First, the correlations.  Next, recoding that categorical variable into dichotomous variables.  Finally, the iterative filename thing. Where? Perhaps give

Re: [R] prediction error in ROCR package when sampled y consists of only one class

2011-04-15 Thread Saeed Abu Nimeh
Try performing stratified sampling when doing cv. cran.r-project.org/web/packages/ipred On Fri, Apr 15, 2011 at 11:00 AM, Soyeon Kim yunni0...@gmail.com wrote: Dear R users, Hi. I am using prediction function in ROCR package. y consists of two classes 0 and 1. However, since I am using

Re: [R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread Dennis Murphy
Hi: Here's one approach: df1 - data.frame(x = letters[1:3], y = 1:3) df2 - data.frame(x = c('a', 'c'), z = c(6, 1)) dfm - merge(df1, df2, all.x = TRUE) dfm x y z 1 a 1 6 2 b 2 NA 3 c 3 1 sumdf - data.frame(x = dfm$x, y = rowSums(dfm[, -1], na.rm = TRUE)) x y 1 a 7 2 b 2 3 c 4 HTH,

[R] Launcher for Rattle?

2011-04-15 Thread Iurie Malai
How to make a launcher for Rattle? Regards, Iurie Malai Moldova Pedagogical State University [[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] Function for deleting variables with =50% missing obs from a data frame

2011-04-15 Thread Rita Carreira
Hello R users! I have several data frames where some of the variables have many missing observations. For example, Q1 in one of my data frames has over 66% of its observations missing. I have tried imputation with mice but it does not work for all the data frames and I get the following

Re: [R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread zhenjiang xu
Thanks, Dennis! I'll go with it. It's surprising there is no ready way to do that. I imagine it should be a common data manipulation to add two data.frame from two different sources. It could happen that one data.frame is missing some rows while the other have some more. On Fri, Apr 15, 2011 at

Re: [R] Function for deleting variables with =50% missing obs from a data frame

2011-04-15 Thread Ben Bolker
Rita Carreira ritacarreira at hotmail.com writes: I have several data frames where some of the variables have many missing observations. For example, Q1 in one of my data frames has over 66% of its observations missing. I have tried imputation with mice but it does not work for all the data

Re: [R] Whole genome searching of 100bp D sequence

2011-04-15 Thread Ben Bolker
Amos Folarin amosfolarin at gmail.com writes: I was wondering I'm going about this in the correct way. I need to test if there are coding sequences or exons in hg19 which match a string of 100bp D i.e. [A,G or T]. However I'm getting a strange result. I get a hit on chr7, using the 100bp

Re: [R] Launcher for Rattle?

2011-04-15 Thread Iurie Malai
I tried this: sh -c 'R_DEFAULT_PACKAGES=$R_DEFAULT_PACKAGES rattle R $@' but without success. I get this message: R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes

Re: [R] Monte Carlo Simulation

2011-04-15 Thread Shane Phillips
I apologize for my last post. here is the script I forgot to paste! subject=1:1000 treat=rbinom(1*1000,1,.13) gender=rbinom(1*1000,1,.5) eth=runif(1*1000, min=1, max=4) cogat=rnorm(1*1000, 100, 16) map=rnorm(1*1000, 200, 9) growth=0 simtest=data.frame (subject=subject, treat=treat,

Re: [R] GLM and normality of predictors

2011-04-15 Thread Ben Bolker
Sacha Viquerat tweedie-d at web.de writes: Am 15.04.2011 20:14, schrieb Christian Hennig: Normality of the predictors doesn't belong to the assumptions of the GLM, so you don't have to check this. On Fri, 15 Apr 2011, Simone Santoro wrote: I want to estimate the possible effects of

Re: [R] Monte Carlo Simulation

2011-04-15 Thread MacQueen, Don
See below: -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 -Original Message- From: Jeremy Miles jeremy.mi...@gmail.com Date: Fri, 15 Apr 2011 14:17:13 -0700 To: Shane Phillips sphill...@lexington1.net Cc:

Re: [R] Monte Carlo Simulation

2011-04-15 Thread MacQueen, Don
The filenames can be done within a loop, like this: for (id in 1:1000) { ## the filename fname - paste('sample', formatC(id,width=4,flag='0'),'.tsv',sep='') ## more stuff } -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550

Re: [R] how to add two data.frame with the same column but different row numbers

2011-04-15 Thread Gabor Grothendieck
On Fri, Apr 15, 2011 at 6:10 PM, zhenjiang xu zhenjiang...@gmail.com wrote: Thanks, Dennis! I'll go with it. It's surprising there is no ready way to do that. I imagine it should be a common data manipulation to add two data.frame from two different sources. It could happen that one data.frame

Re: [R] Idetntifying nearest topographic contours to data points

2011-04-15 Thread Rolf Turner
On 16/04/11 04:18, sam.e wrote: Hi there, I have two data sets, one of locations at different elevations (x,y,z) and the other of points that make up topographic contours (also x,y,z). I have used: result-apply(distppll(data2,cbind(topocon[-nrow(topocon),],topocon[-1,])),1,min) where 'data2'

Re: [R] Sweave Executes Package Functions Twice

2011-04-15 Thread Rolf Turner
On 16/04/11 00:38, Duncan Murdoch wrote: SNIP In version 2.14.0 in the fall, this will no longer be the default behaviour. Perhaps it will be possible to suppress the multiple runs before then, but I think it is unlikely that the default will change. SNIP It already ***is*** the fall (or

[R] Cannot access to PDF manuals from R console

2011-04-15 Thread Fred
I recently installed version 2.13, however when I click the manual from the console, the error message appears Error: 'doc\manual\refman.pdf' not found Error: 'doc\manual\R-intro.pdf' not found Does anyone know about what's happening? Thank you very much

[R] spatstat regression troubles

2011-04-15 Thread Gregory Ryslik
Hi Everyone, I am trying to figure out the spatstat package for the first time and am having some trouble. Unfortunately, I can't post my data set but I'll hopefully post enough details for some help. I want to model the intensity of a spatial point process using 2 covariates from my data.

Re: [R] Cannot access to PDF manuals from R console

2011-04-15 Thread Duncan Murdoch
On 11-04-15 10:20 PM, Fred wrote: I recently installed version 2.13, however when I click the manual from the console, the error message appears Error: 'doc\manual\refman.pdf' not found Error: 'doc\manual\R-intro.pdf' not found Does anyone know about what's happening? We just noticed this

Re: [R] 'tcltk' does not have a name space

2011-04-15 Thread annihination
I am having the same problem on R-2.13.0. Anybody have ideas? Thanks! -- View this message in context: http://r.789695.n4.nabble.com/tcltk-does-not-have-a-name-space-tp3020504p3452810.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Rsquared for anova

2011-04-15 Thread Dorien Herremans
Hi, Thank you for your suggestion. I am stil quite new to the syntax of R. I tried in a few ways but all produced errors: fit - lm((tos~nh1*nh2*nh3*randsize*aweights*tt1*tt2*tt3*iters*length, data=expdata)) Error: unexpected ',' in fit -

[R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-15 Thread Nilaya Sharma
Hi R community, I am new bird to R and moved recently from SAS. I am no means expert on either but very curious learner. So your help crucial for me to learn R. I have already got positive expression. I was trying to fit a mixed model in animal experiment but stuck at simple point. The following

[R] patterned non-random jitter

2011-04-15 Thread Daryl Morris
Hi, Is there a function somewhere that does a patterned jitter of data? I've googled and the problem is that I don't know what to google for. The setting is in grouped data. I have plots which overlay jittered points on a boxplot. I simply jitter the x-value, and the y-value has no

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-15 Thread Nilaya Sharma
My question was how can we estimate effects and define correct model equivalent to SAS code provided. On Fri, Apr 15, 2011 at 10:21 PM, Nilaya Sharma nilaya.sha...@gmail.comwrote: Hi R community, I am new bird to R and moved recently from SAS. I am no means expert on either but very curious

  1   2   >