Re: [R] how to remove the 'promise' attribute of an R object (.Random.seed)?

2012-05-23 Thread Prof Brian Ripley
On 22/05/2012 22:26, Yihui Xie wrote: I did not use delayedAssign() directly; I was using lazyLoad() and .Random.seed was saved in a database. The real story out there is the caching of my knitr package -- lazyLoad() was used to speed up the compilation of Sweave documents. I know lazyLoad() is

Re: [R] How to read a function from keyboard?

2012-05-23 Thread Krzysztof Mitko
On 2012-05-23 01:11, zgu9 wrote: Hi everyone, I have an R problem about Input. I want to read an arbitrage function from keyboard. But I don't know how. I tried scan(), readLines() but fail to make the output as a function, or a list that I can use as.function to transform. Is it possible

[R] Special characters in an R package manual

2012-05-23 Thread Özgür Asar
Dear all, I have some trouble with special characters while building my R package. I tried to follow the usual LATEX format, but could not fix the problem: For instance, for greater than or equal, I tried \geq, but R says that this is an unknown macro. Could anyone direct me how to solve this

Re: [R] Special characters in an R package manual

2012-05-23 Thread Prof Brian Ripley
Do you mean in the .Rd files of your package? On 23/05/2012 08:04, Özgür Asar wrote: Dear all, I have some trouble with special characters while building my R package. I tried to follow the usual LATEX format, but could not fix the problem: For instance, for greater than or equal, I tried

Re: [R] “For” calculation is so slow

2012-05-23 Thread Petr PIKAL
I'm not sure what you are trying to prove with that example - the loopless versions are massively faster, no? In some languages loops are integral part of programming habits. In R you can many things do with whole objects without looping - vectorisation approach. See R-Inferno from Patrick

Re: [R] Special characters in an R package manual

2012-05-23 Thread Özgür Asar
Yes, in the .Rd file. \eqn is my cure. Thank you very much. Best ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309

Re: [R] ReName

2012-05-23 Thread Jim Lemon
On 05/22/2012 06:08 PM, HAOLONG HOU wrote: Dear list, The name of R-language is too short and is not friendly to search engines. Do you think it can be renamed to something like Rsio or Radio ? Thank you so much for this useful software! Aw, come on guys, here is somebody praising R and trying

[R] storing output of a loop in a matrix

2012-05-23 Thread RH Gibson
blap.txt is a numeric vector of length 64. I am using the following code: bd-scan(blap.txt) output-matrix(0,64,10) s-sum(bd) for (i in 10){ while (s0) {x1-sample(bd,(length(bd)-1), replace=F) s-sum(x1) bd-x1 output[i]-s } } write.table(output, file=res.txt) This code is not doing what I'd

Re: [R] storing output of a loop in a matrix

2012-05-23 Thread Petr PIKAL
Hi What is your intention? basically one output column can be made by cumsum(bd) Then you can shuffle bd by let say bd - sample(bd, 64) and repeat cumsum for new bd. bd-scan(blap.txt) output-matrix(0,64,10) for (i in 1:10) { bd-sample(bd, 64) cs-cumsum(bd) output[,i]-cs } If you insist

Re: [R] storing output of a loop in a matrix

2012-05-23 Thread Rainer Schuermann
Try for( i in 1:10 ){ ... } That should resove your problem 1.! Rgds, Rainer On Wednesday 23 May 2012 09:23:04 RH Gibson wrote: blap.txt is a numeric vector of length 64. I am using the following code: bd-scan(blap.txt) output-matrix(0,64,10) s-sum(bd) for (i in 10){ while

Re: [R] mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?

2012-05-23 Thread Simon Wood
Martijn, I don't think there is one right answer to this. If you look at things in the way that one would usually view a smooth model then m2 is both simpler (lower EDF) and fits better, so is simply a better model (if the simpler model fits better then why would you not use it?). But of

[R] linux

2012-05-23 Thread Soheila Khodakarim
Dear All I can not download R for Linux. I do not know which file I should install? Best Regards, Soheila __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Re : linux

2012-05-23 Thread Pascal Oettli
Hello, http://cran.r-project.org/index.html Regards. - Mail original - De : Soheila Khodakarim lkhodaka...@gmail.com À : r-help@r-project.org r-help@r-project.org Cc : Envoyé le : Mercredi 23 mai 2012 18h00 Objet : [R] linux Dear All I can not download R for Linux. I do not know

Re: [R] linux

2012-05-23 Thread Henri-Paul Indiogine
Hi! 2012/5/23 Soheila Khodakarim lkhodaka...@gmail.com: I can not download R for Linux. Usually in Linux you need to give an installation command such as apt-get install The OS will then grab it from a repository for you and install it. It depends on the Linux distribution. Best,

Re: [R] mgcv: inclusion of random intercept in model - based on p-value of smooth or anova?

2012-05-23 Thread Simon Wood
Having looked at this further, I've made some changes in mgcv_1.7-17 to the p-value computations for terms that can be penalized to zero during fitting (e.g. s(x,bs=re), s(x,m=1) etc). The Wald statistic based p-values from summary.gam and anova.gam (i.e. what you get from e.g. anova(a) where

[R] [R-pkgs] dataframe package

2012-05-23 Thread Tim Hesterberg
A new 'dataframe' package is on CRAN. This is a modified version of the data frame code in R, modified to make fewer copies of the inputs and run faster, e.g. as.data.frame(a vector) makes 1 copy of the vector rather than 3, data.frame(a vector) makes 3 copies rather than 6, and x[, a] -

[R] numerical integration

2012-05-23 Thread Michael Meyer
Greetings, Sorry, the last message was sent by mistake! Here it is again: I encounter a strange problem computing some numerical integrals on [0,oo). Define $$ M_j(x)=exp(-jax) $$ where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products $$ A_{ij}:=(M_i,M_j)=\int_0^\infty

[R] numerical integrals

2012-05-23 Thread Michael Meyer
Greetings,   I encounter a strange problem computing some numerical integrals on [0,oo). Define $$ M_j(x)=exp(-jax) $$ where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products $$ A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx $$ Analytically we have $$ A_{ij}=1/(a(i+j)). $$ In the

Re: [R] How to create axis y axis for horizontal bar plot?

2012-05-23 Thread Manish Gupta
Thanks! It works but how can i remove x axis? Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-axis-y-axis-for-horizontal-bar-plot-tp4630478p4631045.html Sent from the R help mailing list archive at Nabble.com. __

[R] Error from using adaptIntegrate within a function that is then integrated

2012-05-23 Thread Helen Broome
I want to measure the error in the estimation of a 2 dimensional density function that is calculated using an integral but run into problems trying to integrate with adaptIntegrate because the integrand also calls the function adaptIntegrate. In particular I want \int \hat{f}(x,y) - f(x,y) dx dy

[R] Weird date conversion

2012-05-23 Thread Kony-2012
I am a new R user, but have searched the manuals on the topic , but found no suitable solution. I have imported a 20 years’ time-series data from csv format into R. The date variable was a factor and I used the command “ x$date - as.Date(date,format= %d%b%Y) “ to convert to a date format. The

[R] Optimizing problem R

2012-05-23 Thread kylmala
Hi, I have a problem with R optimization. I try to copy excel solver acts to R. Solver has some problems with nonlinear optimisation. Suppose we have resources: (X,Y,Z)=(20, 30, 25) and services: matrix(10,11,0, 13,12,10, 0,24,26), nrow=3. Now we should optimize the problem: max( min(a/10,b/11)

Re: [R] Optimizing problem R

2012-05-23 Thread kylmala
I'have tried to do something like that staring values: pars=c(x1=1,x2=1,x3=1,x4=1,x5=1,x6=1,x7=1) and the function f=function(pars){ min(pars[1]/10,pars[2]/11)+min(pars[3]/20,pars[4]/22,pars[5]/25)+min(pars[6]/36,pars[7]/28) } optim(pars,f) but how can I get the constraints in there also?

Re: [R] Naming dimnames in an array using the results of an expression

2012-05-23 Thread Dr Bob Phillips
Wonderful! Thanks very much for this: the step I'd clearly missed was to 1. put the rownames/colnames in a list object 2. *name* these with the titles separately ... allowing the expression to be evaluated names(dn)-c(names(result[[1]]),names(result[[1]][2])) 3. apply this to the array Ta v

[R] File format for single channel analysis of Agilent microarray data in Limma?

2012-05-23 Thread Parisa
Hi, I am following the protocol outlined here for analysis of single channel Agilent microarray data: http://matticklab.com/index.php?title=Single_channel_analysis_of_Agilent_microarray_data_with_Limma I keep getting the following error message when using Limma's read.maimages function to load

[R] barplot

2012-05-23 Thread bets
Hey, I am trying to create barplot of abundances over time (in days). The period is over 171 days, so I don't want to have all labels there but only the first day of the month. I couldn't find anything like this on the forum yet. Mostrly it's about year to year data. This is the relevant part

Re: [R] barplot

2012-05-23 Thread Jim Lemon
On 05/23/2012 09:34 PM, bets wrote: Hey, I am trying to create barplot of abundances over time (in days). The period is over 171 days, so I don't want to have all labels there but only the first day of the month. I couldn't find anything like this on the forum yet. Mostrly it's about year to

Re: [R] Quantmod, Xts, TTR and Postgresql

2012-05-23 Thread R-type Studios
Hi Joshua, All sorted, turns out I just needed to add this header=TRUE and drop those redundant statements you pointed out. for anyone else: # Libs library('RPostgreSQL') # http://code.google.com/p/rpostgresql/ library('quantmod') library('TTR') # Connect and get data drv -

Re: [R] Optimizing problem R

2012-05-23 Thread Petr Savicky
On Wed, May 23, 2012 at 12:35:31AM -0700, kylmala wrote: Hi, I have a problem with R optimization. I try to copy excel solver acts to R. Solver has some problems with nonlinear optimisation. Suppose we have resources: (X,Y,Z)=(20, 30, 25) and services: matrix(10,11,0, 13,12,10, 0,24,26),

Re: [R] linux

2012-05-23 Thread Kevin E. Thorpe
On 05/23/2012 05:00 AM, Soheila Khodakarim wrote: Dear All I can not download R for Linux. I do not know which file I should install? Best Regards, Soheila Can you provide the list with additional information such as: What Linux distribution? What have you tried? For what it's worth, I

Re: [R] Weird date conversion

2012-05-23 Thread peter dalgaard
On May 23, 2012, at 11:23 , Kony-2012 wrote: I am a new R user, but have searched the manuals on the topic , but found no suitable solution. I have imported a 20 years’ time-series data from csv format into R. The date variable was a factor and I used the command “ x$date -

Re: [R] numerical integration

2012-05-23 Thread Hans W Borchers
Michael Meyer mjhmeyer at yahoo.com writes: Check your logic. The following lines show that integrate *does* return the correct values: a = 0.08 # alpha M - function(j,s){ return(exp(-j*a*s)) } A - matrix(NA, 5, 5) for (i in 1:5) { for (j in i:5) {

Re: [R] Creating functions with a loop.

2012-05-23 Thread Rui Barradas
Hello, To keep related objects of the same nature in the same structure makes very good sense but why not name the functions in the list after they were created? Using 'NextFunc' of a previous post, f.list - list() f.list[[1]] - function(x) x^2 f.list[[2]] - NextFunc(f, 1) f.list[[3]] -

Re: [R] How to create axis y axis for horizontal bar plot?

2012-05-23 Thread Sarah Goslee
On Wed, May 23, 2012 at 3:26 AM, Manish Gupta mandecent.gu...@gmail.com wrote: Thanks! It works but how can i remove x axis? I have no idea what works, except that it may in some way relate to bar plots, but in general xaxt=n will remove an x axis. See ?par for details. -- View this message

Re: [R] barplot

2012-05-23 Thread bets
Thank you for the answer. I tried the first suggestion, but that didn't work (length didn't match again), unless I'm doing something wrong. The stacklab function is nice, but still I'm having way to much labels. Maybe the actual graph makes it more clear:

Re: [R] Weird date conversion

2012-05-23 Thread Kony-2012
You have spotted the problem correctly; indeed the problem was a local issue (I am based in Sweden) and as per your suggestion adjustment of the local parameters has solved it. Many thanks -- View this message in context:

[R] data conversion (possibly with reshape package)

2012-05-23 Thread Martin Schilling
Hi everyone, I have an issue with a data conversion. First, I tried it with the reshape-package, but since it's quite a while that I used it, I feel kind of rusty... I have a data.frame like this: id Sample.Name Marker Allele.1 Allele.2sample_id

[R] garchFit (fGARCH)

2012-05-23 Thread justina
Hello, I would be very grateful if somebody (or everybody:)) answers my question. I am making ARMA-GARCH model with garchFit function and want in arma part make lag list (like with arma models: model=arma(data, lag=list(ar=c(2,6),ma=NULL), include.intercept=FALSE) but I don't know how to do it

Re: [R] Creating functions with a loop.

2012-05-23 Thread David Winsemius
I think there is much to recommend this approach, but if you still want to have separate functions in the workspace with the names having successive integer designations then I have an approach. (There could still be storage in a list for these functions with matching named indices.)

Re: [R] LM with summation function

2012-05-23 Thread Robbie Edwards
Thank you Peter, works perfectly. Funny how simple things are once someone tells you the answer =) robbie On Tue, May 22, 2012 at 9:37 PM, Peter Ehlers ehl...@ucalgary.ca wrote: Robbie, Here's what I *think* you are trying to do: 1. y is a cubic function of x: y = b1*x + b2*x^2 +

[R] procrustes (vegan) plot of residual differences

2012-05-23 Thread Juan Antonio Balbuena
Hello This is a simple question but I couldn't google an answer. In the procrustes function of the vegan package, one uses plot(procrustes_object, kind=2) to obtain a plot of the residual differences. For instance: data(varespec) vare.dist -

[R] how a latent state matrix is updated using package R2WinBUGS

2012-05-23 Thread Jean V Adams
I'm trying to understand how a latent state matrix is updated by the MCMC iterations in a WinBUGS model, using the package R2WinBUGS and an example from Kery and Schaub's (2012) book, Bayesian Population Analysis Using WinBUGS. The example I'm using is 7.3.1. from a chapter on the

Re: [R] write.xls

2012-05-23 Thread David L Carlson
You need to read the documentation for read.xlsx and data.frame. In it you would discover what you have done wrong: 1. rowIndex must be an array listing the columns you wish to read not a character value 2. colIndex must be an array listing the rows you wish to read [Deleting these arguments

[R] mgcv: How to calculate a confidence interval of a ratio

2012-05-23 Thread Gevin Brown
Dear R-Users, Dr. Wood replied to a similar topic before where confidence intervals were for a ratio of two treatments ( https://stat.ethz.ch/pipermail/r-help/2011-June/282190.html). But my question is more complicated than that one. In my case, log(E(y)) = s(x) where y is a smooth function of x.

[R] edgeR: design matrix setup

2012-05-23 Thread rmje
I have a data frame like this: T0h T0.25h T0.5h T1h T2h T3h T6h T12h T24h T48h C0h C0.25h C0.5h C1h C2h C3h C6h C12h C24h C48h NM_001001130 68 9556 43 66 62 68 90 63 89 65 8558 49 81 49 76 73 48 77 NM_001001152 79

[R] Get variable names from results of lm()

2012-05-23 Thread jdub
What is the best way to get the variable names used in lm() from its results? Stumbling around I found I could get the response variable name from myMod$terms[[2]] but using myMod$terms[[1 ]] gives a tilda. I found the names buried in other places in the model object and in the summary of

Re: [R] barplot

2012-05-23 Thread Rui Barradas
Hello, Would the following do it? # make the dates vector x - seq(as.Date(2011-03-15), as.Date(2011-09-09), by=day) # this is the important part labs - seq(min(x), max(x), by=month) # month, not 30 labs - format(labs, %b) labs.pos - round(seq(1, length(x), length.out=length(labs))) # make

Re: [R] Syntax for lme function to model random factors and interactions

2012-05-23 Thread i_like_macs
Hi Joshua, Thank you again for your very-generous help. I think I could follow most of your explanations. To give you some background about myself, I'm doing a PhD at the Institute of Sound Recording (IoSR) at the University of Surrey in the UK. As I have no statistics background, I've been

[R] two sided wilcox test

2012-05-23 Thread evaD
Hey, could I just ask you a quick question? if i have two sets of numbers, eg: list1 = 1,3,4,4,4 list2 = 1,2,4,5,6 and in R, i run the command: wilcox.test(list1, list2, paired=TRUE, alternative=greater) and say i get a p-value of 0.0001 Does this tell me that my values in list 1 tend to

[R] Distances between countries package?

2012-05-23 Thread Marta ter Haar
Hi everyone, I am looking for a package that would take CountryName1 and CountryName2 as input and spit out the distance (approximate) between the two countires. Does something like that exist? I don't have R experience, so making one myself is out of the question... Thanks in advance!

Re: [R] Median computation

2012-05-23 Thread Preeti
Hello Everybody, The code: dfmed-lapply(unique(colnames(df)), function(x) rowMedians(as.matrix(df[,colnames(df) == x]),na.rm=TRUE)) takes really long time to execute ( in hours). Is there a faster way to do this? Thanks! On Tue, May 22, 2012 at 3:46 PM, Preeti pre...@sci.utah.edu wrote:

Re: [R] Get variable names from results of lm()

2012-05-23 Thread R. Michael Weylandt
I think the easiest that comes to mind is simply names(coef(myMod)) But did you look at myMod$terms[[3]] ? That seems to be the RHS of the formula input (in the few cases I tried) Best, Michael On Wed, May 23, 2012 at 10:58 AM, jdub j...@ramas.com wrote: What is the best way to get the

[R] gam (mgcv) vs. multiple regression breakpoint analysis: inconsistencies?

2012-05-23 Thread Martijn Wieling
Dear useRs, I have a question with respect to fitting a non-linearity using gam (mgcv package, version 1.7-16). In a study I'm currently conducting, I'd like to find out if there is a breakpoint after which the effect of Age of Acquisition (AOA) of the second language changes. I.e. if the slope

Re: [R] Median computation

2012-05-23 Thread Bert Gunter
Assuming your original matrix IS a matrix, call it yourmat, and not a data frame (whose columns **must* have unique names if you haven't messed with the check.names default) then maybe: UNTESTED!!! ### thenames - unique(dimnames(yourmat)[[2]]) ans - lapply(thenames, function(nm, { apply(

Re: [R] two sided wilcox test

2012-05-23 Thread csrabak
Em 23/5/2012 11:59, evaD escreveu: Hey, could I just ask you a quick question? if i have two sets of numbers, eg: list1 = 1,3,4,4,4 list2 = 1,2,4,5,6 and in R, i run the command: wilcox.test(list1, list2, paired=TRUE, alternative=greater) and say i get a p-value of 0.0001 Does this tell

Re: [R] Median computation

2012-05-23 Thread Benno Pütz
I wonder how you do this (or maybe on what kind of machine you execute it). I tried it out of curiosity and get df = as.data.frame(lapply(1:300,function(x)sample(200,25,T))) colnames(df) = sample(letters[1:20],300,T) system.time(dfmed-lapply(unique(colnames(df)), function(x) +

Re: [R] Median computation

2012-05-23 Thread Preeti
Hmm.. that is interesting... I did this on our server machine which has about 200 cores. So memory is not an issue. Also, building the dataframe takes about a few minutes maximum for me. My code is similar to yours but for the fact that I create my dataframe from read.delim(filename) and then I

Re: [R] Median computation

2012-05-23 Thread Henrik Bengtsson
Just adding a few cents to this: rowMedians(x) is roughly 4-10 times faster than apply(x, MARGIN=1, FUN=median) - at least on my local Windows 7 64bit tests. You can do these simple benchmark runs yourself via the matrixStats/tests/rowMedians.R system test, cf. http://goo.gl/YCJed [R-forge].

Re: [R] Median computation

2012-05-23 Thread peter dalgaard
On May 23, 2012, at 19:30 , Preeti wrote: Hmm.. that is interesting... I did this on our server machine which has about 200 cores. So memory is not an issue. Also, building the dataframe takes about a few minutes maximum for me. My code is similar to yours but for the fact that I create my

Re: [R] Median computation

2012-05-23 Thread Preeti
On Wed, May 23, 2012 at 11:54 AM, peter dalgaard pda...@gmail.com wrote: On May 23, 2012, at 19:30 , Preeti wrote: Hmm.. that is interesting... I did this on our server machine which has about 200 cores. So memory is not an issue. Also, building the dataframe takes about a few minutes

Re: [R] two sided wilcox test

2012-05-23 Thread Peter Ehlers
On 2012-05-23 10:19, csrabak wrote: Em 23/5/2012 11:59, evaD escreveu: Hey, could I just ask you a quick question? if i have two sets of numbers, eg: list1 = 1,3,4,4,4 list2 = 1,2,4,5,6 and in R, i run the command: wilcox.test(list1, list2, paired=TRUE, alternative=greater) and say i

Re: [R] Get variable names from results of lm()

2012-05-23 Thread Peter Ehlers
On 2012-05-23 09:55, R. Michael Weylandt wrote: I think the easiest that comes to mind is simply names(coef(myMod)) But did you look at myMod$terms[[3]] ? That seems to be the RHS of the formula input (in the few cases I tried) Best, Michael It depends a bit on just what the OP wants. In

Re: [R] Get variable names from results of lm()

2012-05-23 Thread Marc Schwartz
On May 23, 2012, at 1:42 PM, Peter Ehlers wrote: On 2012-05-23 09:55, R. Michael Weylandt wrote: I think the easiest that comes to mind is simply names(coef(myMod)) But did you look at myMod$terms[[3]] ? That seems to be the RHS of the formula input (in the few cases I tried) Best,

Re: [R] procrustes (vegan) plot of residual differences

2012-05-23 Thread Peter Ehlers
On 2012-05-23 08:19, Juan Antonio Balbuena wrote: Hello This is a simple question but I couldn't google an answer. In the procrustes function of the vegan package, one uses plot(procrustes_object, kind=2) to obtain a plot of the residual differences. For

Re: [R] Get variable names from results of lm()

2012-05-23 Thread William Dunlap
You might want to look at https://stat.ethz.ch/pipermail/r-help/2012-April/310582.html Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marc Schwartz Sent: Wednesday,

Re: [R] write.xls

2012-05-23 Thread MacQueen, Don
Seems like you have a solution by now, but I didn't see: require(xlsx) df1 - data.frame(c1=1:2, c2=3:4, c3=5:6) df2 - data.frame(c21=c(10.10101010101,20, 3), c22=c(50E50,60, 3) ) outFile - 'df12.xls' wb - createWorkbook() sh1 - createSheet(wb,'sheet1') addDataFrame(df1,sh1) sh2 -

[R] Question on if i am allowed to do something

2012-05-23 Thread Giannis Mamalikidis
Hello all. I would like to know: provided that I absolutely state that R is not mine and I also include the R’s License which will be shown so people know R and R’s license, (provided the above) am I allowed to include R’s folder (the folder that has its binaries) on my freeware program or

Re: [R] RODBC connect to Excel (64-bit Windows 7)

2012-05-23 Thread IzRey
andrija djurovic djandrija at gmail.com writes: Hi to all. .. Thanks in advance Andrija I am having the exact same problem. Any luck with this yet? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Get variable names from results of lm()

2012-05-23 Thread arun
Hi, I assume this is what you are looking. ?variable.names()  x - 1:20   y -  x + (x/4 - 2)^3 + rnorm(20, sd=3)   names(y) - paste(O,x,sep=.)   ww - rep(1,20); ww[13] - 0   summary(lmxy - lm(y ~ x + I(x^2)+I(x^3) + I((x-10)^2), weights = ww), cor =

[R] Error message from optim

2012-05-23 Thread Rubem Kaipper Ceratti
Dear list, When running the script below, the optim function returns the message 'Error in function (par) : could not find function fn'. I've re-read the code a few times and just can't figure out why it's happening. Any help/suggestion is appreciated. Regards, Rubem ## R script

[R] Random Forest Classification_ForestCombination

2012-05-23 Thread Nikita Desai
Hello, I am aware of the fact that the combine() function in the Random Forest package of R is meant to combine forests built from the same training set, but is there any way to combine trees built on different training sets? Both the training datasets used contain the same variables and

[R] applying cbind (or any function) across all components in a list

2012-05-23 Thread Hans Thompson
#If I have two lists as follows a1- array(1:6, dim=c(2,3)) a2- array(7:12, dim=c(2,3)) l1- list(a1,a2) a3- array(1:4, dim=c(2,2)) a4- array(5:8, dim=c(2,2)) l2- list(a3,a4) #how can I create a new list with the mean across all arrays within the list, so all components are included? As

Re: [R] Get variable names from results of lm()

2012-05-23 Thread arun
Hi Marc, Just to point out some difference,  x - 1:20   y -  x + (x/4 - 2)^3 + rnorm(20, sd=3)   names(y) - paste(O,x,sep=.)    ww - rep(1,20); ww[13] - 0   summary(lmxy - lm(y ~ x + I(x^2)+I(x^3) + I((x-10)^2),   weights = ww), cor = TRUE)

Re: [R] Median computation

2012-05-23 Thread Bert Gunter
Yes, thanks Henrik. I neglected to mention that rowMedians could just be plugged in instead of apply (..,1,...) However, my main point is that that's probably not what matters,as Benno points out. Maybe it's the data frames instead of the matrices, but The process should execute in a few

Re: [R] Distances between countries package?

2012-05-23 Thread Greg Snow
This depends on what you mean by distance between the 2 countries. Do you want the shortest distance from a point on the border of each country? The distance from the one capitol to the other? Distance between centroids? Weighted distance based on population distributions? Etc. Do you want great

Re: [R] Error message from optim

2012-05-23 Thread Peter Ehlers
On 2012-05-23 09:39, Rubem Kaipper Ceratti wrote: Dear list, When running the script below, the optim function returns the message 'Error in function (par) : could not find function fn'. I've re-read the code a few times and just can't figure out why it's happening. Any help/suggestion is

Re: [R] Error message from optim

2012-05-23 Thread Rubem Kaipper Ceratti
Ok, I feel kinda silly for not having thought of that before... Anyway, thanks, Peter. De: Peter Ehlers ehl...@ucalgary.ca Cc: r-help@r-project.org r-help@r-project.org Enviadas: Quarta-feira, 23 de Maio de 2012 19:22 Assunto: Re: [R] Error message from

[R] Letter with tilde

2012-05-23 Thread Judith Flores
Hi,    I was unable to find documentation about how to include the letter 'n' with tilde above it, like this: ñ.    Is it possible to do that? Thank you, Judith [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Question on if i am allowed to do something

2012-05-23 Thread Duncan Murdoch
On 12-05-23 1:31 PM, Giannis Mamalikidis wrote: Hello all. I would like to know: provided that I absolutely state that R is not mine and I also include the R’s License which will be shown so people know R and R’s license, (provided the above) am I allowed to include R’s folder (the folder that

Re: [R] Letter with tilde

2012-05-23 Thread Duncan Murdoch
On 12-05-23 7:40 PM, Judith Flores wrote: Hi, I was unable to find documentation about how to include the letter 'n' with tilde above it, like this: ñ. Is it possible to do that? Yes, just type it. The main problem will come if you write it to a file and read it somewhere else;

Re: [R] Get variable names from results of lm()

2012-05-23 Thread Marc Schwartz
On May 23, 2012, at 2:52 PM, arun wrote: Hi Marc, Just to point out some difference, x - 1:20 y - x + (x/4 - 2)^3 + rnorm(20, sd=3) names(y) - paste(O,x,sep=.) ww - rep(1,20); ww[13] - 0 summary(lmxy - lm(y ~ x + I(x^2)+I(x^3) + I((x-10)^2),

Re: [R] Question on if i am allowed to do something

2012-05-23 Thread Marc Schwartz
On May 23, 2012, at 6:51 PM, Duncan Murdoch wrote: On 12-05-23 1:31 PM, Giannis Mamalikidis wrote: Hello all. I would like to know: provided that I absolutely state that R is not mine and I also include the R’s License which will be shown so people know R and R’s license, (provided the

Re: [R] glm(weights) and standard errors

2012-05-23 Thread Steve Taylor
Re: coef(summary(glm(extra ~ group, data=sleep[ rep(1:nrow(sleep), 10L), ] ))) Your (corrected) suggestion is the same as one of mine, and doesn't do what I'm looking for. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Tuesday, 22 May 2012 3:37p To:

Re: [R] Letter with tilde

2012-05-23 Thread Peter Ehlers
On 2012-05-23 16:53, Duncan Murdoch wrote: On 12-05-23 7:40 PM, Judith Flores wrote: Hi, I was unable to find documentation about how to include the letter 'n' with tilde above it, like this: ñ. Is it possible to do that? Yes, just type it. The main problem will come if you

[R] trouble installing RCurl

2012-05-23 Thread Ux.Seo
Hi, all I got following errors when I tried to install RCurl in Ubuntu. my R version is na@ubuntu:~$ R --version R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) thanks in advance * installing

[R] Calling on certina columns

2012-05-23 Thread Chris Burns
I'm trying to run a regression on certain columns. The columns are named Cat_1, Cat_2 etc. Is there a way to call upon all of the columns that contain Cat? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Plot txt

2012-05-23 Thread Trying To learn again
Hi all Sorry in advance I have this txt with data and I want to plot the data with a line between dots. The thing is that if I run this g-read.table(ip.txt) plot(g,type=l) I have prove to attach(g) but doesn´ t work. I know is a begginer question and sure is of the type of data or the file

[R] Using NA as a break point for indicator variable?

2012-05-23 Thread Max Brondfield
Hi all, I am working with a spatial data set for which I am only interested in high concentration values (leaks). The low values ( 90th percentile) have already been turned into NA's, leaving me with a matrix like this: CH4_leak lonlatCH4 1 -71.11954 42.35068

[R] Exclude when sd=0

2012-05-23 Thread Chris Burns
How do I trim a matrix to exclude columns that have no standard deviation? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Calling on certina columns

2012-05-23 Thread David Winsemius
On May 23, 2012, at 5:47 PM, Chris Burns wrote: I'm trying to run a regression on certain columns. The columns are named Cat_1, Cat_2 etc. Is there a way to call upon all of the columns that contain Cat? lm( y ~ . , data=dfrm[, c(y, grep(Cat, names(dfrm), value=TRUE) ] ) OR: lm (y ~

Re: [R] Plot txt

2012-05-23 Thread David Winsemius
On May 23, 2012, at 6:11 PM, Trying To learn again wrote: Hi all Sorry in advance I have this txt with data and I want to plot the data with a line between dots. The thing is that if I run this g-read.table(ip.txt) plot(g,type=l) Try: plot(g$V1,type=l) I have prove to attach(g)

Re: [R] Plot txt

2012-05-23 Thread Christopher W. Ryan
Dear Trying: after g - read.table(ip.txt) enter str(g) You will see that g is a dataframe with one variable, called V1. V1 contains the data you want to plot. So type plot(g$V1, type=l) or with(g, plot(V1, type=l)) or, if you prefer to attach g: attach(g) plot(V1, type=l) --Chris

Re: [R] Exclude when sd=0

2012-05-23 Thread David Winsemius
On May 23, 2012, at 8:44 PM, Chris Burns wrote: How do I trim a matrix to exclude columns that have no standard deviation? mtx[ , as.logical(apply(mtx, 2, sd))] -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list

Re: [R] Exclude when sd=0

2012-05-23 Thread Jorge I Velez
Perhaps this? X[, apply(X, 2, sd) 1e-10] HTH, Jorge.- On Wed, May 23, 2012 at 8:44 PM, Chris Burns wrote: How do I trim a matrix to exclude columns that have no standard deviation? Thanks, Chris [[alternative HTML version deleted]]

Re: [R] trouble installing RCurl

2012-05-23 Thread Krzysztof Mitko
W dniu 24.05.2012 00:08, Ux.Seo pisze: Hi, all I got following errors when I tried to install RCurl in Ubuntu. my R version is na@ubuntu:~$ R --version R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: