[R] mvpart analyses with covariables

2011-09-12 Thread 'Ben Ford'
Hi all, I am fairly new to R and I am trying to run mvpart and create a MRT using explanatory variables and covariables. I've been following the procedures in Numerical Ecoogy with R. The command (no covariables) which works fine - ABUNDTMRT <- mvpart(abundance ~ .,factors,margin=0.08,cp=0,xv="1

[R] Radial basis function network

2011-09-12 Thread ospoz
Hi, Does anyone know where I can find a package which implements this network? http://en.wikipedia.org/wiki/Radial_basis_function_network The package "neural" was good for that I think, but it doesn't exist anymore (I don't know why). Thanks a lot -- View this message in context: http://r.789

[R] Getting Rcpp SEXP data in C++

2011-09-12 Thread Worik R
Friends I am looking at Rcpp and I am a bit stuck on a simple matter. (I am calling R from c++, if there is a better way...) Given this simple example using the TTR package and the SMA function which returns a simple moving average Rcpp::NumericVector rv; for(int i = 0; i < 100; i++){

Re: [R] as.POSIXct on vector weird output

2011-09-12 Thread jim holtman
'f$V1' is a factor. try as.POSIXct(as.character(f$V1), format="%m/%d/%Y %H:%M:%S") You need to convert to a character first. On Mon, Sep 12, 2011 at 7:24 PM, bradford wrote: > I don't know R, so maybe I've done something wrong, but I'm working off an > example I saw on the web and wondering wh

Re: [R] help with glmm.admb

2011-09-12 Thread Ben Bolker
eeadie unm.edu> writes: > Now I have a new problem with the same model that I've been working on. Here > is the model and the error message: > > > modelnbbb<-glmmadmb(total_bites_rounded~age_class_back+ (1|focal_individual)+(1|food.dif.id)+ offset(log(forage_time)),data=data,family="nbi

[R] nls, the four parameter logisitc equation, and prediction band

2011-09-12 Thread sg
I have uploaded a datafile that contains the following two variables: time (X value) and response (Y value). This is a fairly extensive file (with > 16000 entries). I have two questions: 1. I want to use the following equation to regress Y on X: Y-hat = min + (max-min)/(1 + (X/EC50)^Hillslope).

[R] as.POSIXct on vector weird output

2011-09-12 Thread bradford
I don't know R, so maybe I've done something wrong, but I'm working off an example I saw on the web and wondering why as.POXIXct isn't returning the same result on f$V1 as it is on z. Did I do something wrong? Or is it a problem with my build? > f$V1 [1] 09/11/2011 13:46:39 09/11/2011 13:45:18

[R] Question on reading nodes info from all random forests generated trees

2011-09-12 Thread k
Hi All, I have a quick question on random forests. Simply, I am not sure how to read the values of independent variables related to the highest value of a response variable from all trees generated from random forests. It is easy to do this in a single regression tree. But I am not clear how to

Re: [R] nested anova<-R chrashing

2011-09-12 Thread Ben Bolker
joerg stephan rhrk.uni-kl.de> writes: > > Hi, > > I tried to do a nested Anova with the attached Data. My response > variable is "survivors" and I would like to know the effect of > (insect-egg clutch) "size", "position" (of clutch on twig) and "clone" > (/plant genotype) on the survival of

Re: [R] Solve your R problems

2011-09-12 Thread Rolf Turner
On 13/09/11 11:27, Carl Witthoft wrote: Love the page. Just out of interest, is this an updated version or the same ol' Inferno document? And why do I keep thinking you (Patrick Burns) are the Hab's coach? :-) Now *that's* a blast from the past! Burns coached the Canadiens way back whe

Re: [R] calc.relimp pmvd for US R-user

2011-09-12 Thread Ben Bolker
YAddo gmail.com> writes: > > Dear All: > > I am calculating the relative importance of a regressor in a linear model. > Does anyone know how I can obtain/install the 'pmvd' computation type? I am > a US user. > I didn't know what the heck you were talking about, but having looked at http:

Re: [R] Very slow using S4 classes

2011-09-12 Thread André Rossi
Thank you a lot Morgan. Your suggestion helped me to speed up my code. But I still believe that the inefficience is an S4 issue. Best regards, André Rossi 2011/9/12 Martin Morgan > Hi André... > > > On 09/12/2011 07:20 AM, André Rossi wrote: > >> Dear Martin Morgan and Martin Maechler... >>

Re: [R] Solve your R problems

2011-09-12 Thread Carl Witthoft
Love the page. Just out of interest, is this an updated version or the same ol' Inferno document? And why do I keep thinking you (Patrick Burns) are the Hab's coach? :-) -- - Sent from my Cray XK6 __ R-help@r-project.org mailing list https:/

Re: [R] On-line machine learning packages?

2011-09-12 Thread Jason Edgecombe
I already provided the link to the task view, which provides a list of the more popular machine learning algorithms for R. Do you have a particular algorithm or technique in mind? Does it have a name? How does sequential classification differ form running a one-off classifier for each run?

[R] calc.relimp pmvd for US R-user

2011-09-12 Thread YAddo
Dear All: I am calculating the relative importance of a regressor in a linear model. Does anyone know how I can obtain/install the 'pmvd' computation type? I am a US user. Regards, Y -- View this message in context: http://r.789695.n4.nabble.com/calc-relimp-pmvd-for-US-R-user-tp3808752p38087

Re: [R] plot 3 lines with ggplot2

2011-09-12 Thread J Toll
Justin, Thanks for your help. On Mon, Sep 12, 2011 at 2:19 PM, Justin Haynes wrote: > > the data you've given is all character vectors! Yes, I'm sorry about that. I should not have used cbind when forming my data.frame. It changed my numeric data to character. This command would have been be

Re: [R] Problem in put.var.ncdf

2011-09-12 Thread David William Pierce
On Mon, Sep 12, 2011 at 1:32 PM, Claudia Stocker wrote: > Dear all, > > I have a problem in writing a variable to a NetCDF-File. > My code works pretty well until the step put.var.ncdf(): > > [...code omitted...] > R prints the following error: > #- > > Error in put.var.ncdf(sp

Re: [R] Multiple regression intercept

2011-09-12 Thread Daniel Malter
This suggests that this is a dangerous office to be in because this is a basic question. I am sure somebody in your office knows this. Anyway, the baseline gives you the average value of the group that constitutes the baseline when all other covariates are zero. Let's say you measure whether men or

Re: [R] Multilevel model in lme4 and nlme

2011-09-12 Thread Ben Bolker
jonas garcia googlemail.com> writes: > I am trying to fit some mixed models using packages lme4 and nlme. > > I did the model selection using lmer but I suspect that I may have some > autocorrelation going on in my data so I would like to have a look using the > handy correlation structures avai

Re: [R] creating a new column with values from another

2011-09-12 Thread Daniel Malter
You can do this using ifelse(). See example below. x<-rpois(100,100) NA.x<-sample(1:100,40) x[NA.x]=NA y<-rpois(100,100) NA.y<-sample(1:100,40) y[NA.y]=NA z<-ifelse(!is.na(y),y,ifelse(!is.na(x),x,NA)) HTH, Daniel holly shakya wrote: > > I have 2 columns for weight. There are NAs in each col

[R] Problem in put.var.ncdf

2011-09-12 Thread Claudia Stocker
Dear all, I have a problem in writing a variable to a NetCDF-File. My code works pretty well until the step put.var.ncdf(): # Get variables #- data1 <- open.ncdf("PREC_me_03-1500.nc") prec1 <- get.var.ncdf(data1,"PRECT") dim.time <- get.var.ncdf(data1,"time2") close.ncdf(

Re: [R] Error message for .csv file

2011-09-12 Thread David Winsemius
You are asking a question about a package that seldom appears on rhelp, leading me to infer that there is not a large user community that reads this mailing list. You are also not providing the data needed to reproduced the problem. You would be better off taking the time to contact the pac

Re: [R] function to include factors in summary data frame

2011-09-12 Thread Daniel Malter
I have read it three times and still no concrete idea what you are actually trying to do, mainly because there is no information as to which level/variable you are aggregating on. It'd help if you provided the aggregated data (or sample rows thereof) so that we know what you want the result to be.

[R] creating a new column with values from another

2011-09-12 Thread holly shakya
I have 2 columns for weight. There are NAs in each column but not for the same observation. Some observations have values for both. I would want to prioritize the WT2 values so I would like to do the following: >From this: ID WT1WT2 1 134 NA 2 145 155 1

[R] nested anova<-R chrashing

2011-09-12 Thread joerg stephan
Hi, I tried to do a nested Anova with the attached Data. My response variable is "survivors" and I would like to know the effect of (insect-egg clutch) "size", "position" (of clutch on twig) and "clone" (/plant genotype) on the survival of eggs (due to predation). Each plant was provided with

Re: [R] findFreqTerms vs minDocFreq in Package 'tm'

2011-09-12 Thread vioravis
Thanks, Bettina. -- View this message in context: http://r.789695.n4.nabble.com/findFreqTerms-vs-minDocFreq-in-Package-tm-tp3806644p3808134.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.

[R] Multilevel model in lme4 and nlme

2011-09-12 Thread jonas garcia
Dear list, I am trying to fit some mixed models using packages lme4 and nlme. I did the model selection using lmer but I suspect that I may have some autocorrelation going on in my data so I would like to have a look using the handy correlation structures available in nlme. The problem is th

Re: [R] Error message for .csv file

2011-09-12 Thread vkent
I am using the package SPACECAP which provides an interface for R. I used this interface to import the csv file into R as well as the other two csv files that are required. This is the output I get when querying the error message Error in NN[i, 1:length(od)] <- od : subscript out of bounds > str(

[R] Multiple regression intercept

2011-09-12 Thread burdy
Hi I am having difficulty interpretive the multiple regression output. I would like to know what it means when one of the factors is assigned as the intercept? In my data I am looking at the relationship between environmental parameters and biological production. One of my variables in the analys

Re: [R] Centering lines on barplot centers.

2011-09-12 Thread Greg Snow
Setting par(usr=something) does not survive the creating of a new high level plot. Using par(new=TRUE) is to be avoided if at all possible (it just leads to problems like yours), it would be better for you to use matlines instead of matplot which adds lines to the current plot. If you want to

[R] Centering lines on barplot centers.

2011-09-12 Thread gerald.jean
Hello, I am trying to port one of my plotting S+ functions to R and I am having difficulties!!! I am including here only the troublesome code! I first produce a barplot, saving the positions of the bar's centers. par(mar = c(6.1, 5.1, 4.1, 4.1), mgp = c(3, 3.0, 0)) ticks.loc <- barplot(su

[R] function to include factors in summary data frame

2011-09-12 Thread Wade Wall
Hi all, I have a dataframe that includes data on individuals that are distributed across multiple rows. I have aggregated the data using ddply, but I have columns in the original data frame that are factors ( such as sites "A", "B", and "C") that I would like to include in the new data frame. I

[R] plot 3 lines with ggplot2

2011-09-12 Thread J Toll
Hi, I am trying to learn to use ggplot2 for what I had hoped would be a fairly simple task. I have a relatively small data.frame (100 by 4). The first column contains symbols. The 2nd, 3rd and 4th columns represent percentage weightings for each symbol using 3 different methodologies. For examp

Re: [R] Loops on data˜1

2011-09-12 Thread R. Michael Weylandt
I may be totally off base with this, but I'm wondering what exactly this would suggest or why you want to do it. Specifically "multiple regression with only intercept" -- how is it multiple if you don't have any regressors? Furthermore, you want to run a "regression" on a single data point -- reall

Re: [R] Difference in function arima estimation between 2.11.1 and R 2.12.2

2011-09-12 Thread Berend Hasselman
Luis Felipe Parra wrote: > > > and as you can see in the results some coefficients (for example ar2 and > ar8) are different in the different R versions. does anybody know what > might > be going on. Was there any change in the arima function between the two > versions? > You asked the sam

Re: [R] Writting excel files

2011-09-12 Thread Bos, Roger
Marc's links lists many packages. Of those, I would recommend XLConnect. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Marc Schwartz Sent: Monday, September 12, 2011 12:53 PM To: Damian Abalo Cc: r-help Subject: Re: [R] Writting

Re: [R] suggestion for proportions

2011-09-12 Thread csrabak
Em 9/9/2011 14:32, array chip escreveu: Thanks all again for the suggestions. I agree with Wolfgang that mcnemar.test() is what I am looking for. The accuracy is the proportion of correct diagnosis compared to a gold standard, and I am interested in which diagnosis test is better, not particular

Re: [R] 1 not equal to 1, and rep command

2011-09-12 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Benjamin Høyer > Sent: Monday, September 12, 2011 6:19 AM > To: r-help@r-project.org > Cc: t...@novozymes.com > Subject: [R] 1 not equal to 1, and rep command > > Hi > > I need

Re: [R] Multiple t.test

2011-09-12 Thread Greg Snow
Here is another approach. A linear regression with a single binomial predictor will give the same results as a pooled t-test (if you insist on non-pooled then use sapply as previously suggested). The lm function will do multiple regressions if given a matrix as the y-variable, so you can do a

Re: [R] Error message for .csv file

2011-09-12 Thread Sarah Goslee
Go to your R session. First off, tell the R-help list how you got your csv file into R as NN. read.csv() ? read.table()? Then tell us exactly what code you're using. Where did i come from? Also type in exactly the commands I gave you (four lines), and share the output with the R-help list. str(

Re: [R] barplot in hexagram layout

2011-09-12 Thread Schatzi
I updated the code as follows: dev.new(width=2.5, height=3,mar=c(0,0,0,0)) par(mfrow=c(5,1),mar=c(.5, .5, 1.5, .5), oma=c(.4, 0,.5, 0)) barplot(c(1,1,1,1,1),col=c("white","white","red","white","white"), axes = FALSE,border=NA) barplot(c(1,1,1,1,1),col=c("orange","white","white","white","yellow"), a

Re: [R] Hourly data with zoo

2011-09-12 Thread steven mosher
worked beautifully. Thanks. On Mon, Sep 12, 2011 at 9:45 AM, Gabor Grothendieck wrote: > On Mon, Sep 12, 2011 at 11:57 AM, steven mosher > wrote: >> Gabor.. thanks. >> >> zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) >> >> a couple issues:  my date data  has missing days and

Re: [R] 1 not equal to 1, and rep command

2011-09-12 Thread Sarah Goslee
Not so strange, in fact this is FAQ 7.31, and has to do (as you guess) with the way that computers store numbers. You need to do as you did, and use round() or floor() or similar to ensure that you get the results you expect. Sarah 2011/9/12 Benjamin Høyer : > Hi > > I need to use rep() to get a

Re: [R] barplot in hexagram layout

2011-09-12 Thread Schatzi
Here is the new code. It works just like I wanted. dev.new(width=6, height=6.5,mar=c(0,0,0,0)) par(mfrow=c(5,1),mar=c(.5, .5, 1.5, .5), oma=c(.4, 0,.5, 0)) barplot(c(1,1,1,1,1),col=c("white","white","red","white","white"), axes = FALSE,border=NA) barplot(c(1,1,1,1,1),col=c("orange","white","white"

Re: [R] barplot in hexagram layout

2011-09-12 Thread Schatzi
I will try stacking 5 barplots (with 5 bars per plot) and somehow only showing the middle bar for the top and bottom plots and the two end bars for the two middle plots. - In theory, practice and theory are the same. In practice, they are not - Albert Einstein -- View this message in context:

Re: [R] Very slow using S4 classes

2011-09-12 Thread Martin Morgan
Hi André... On 09/12/2011 07:20 AM, André Rossi wrote: Dear Martin Morgan and Martin Maechler... Here is an example of the computational time when a slot of a S4 class is of another S4 class and when it is just one object. I'm sending you the data file. Thank you! Best regards, André Rossi

Re: [R] Writting excel files

2011-09-12 Thread Marc Schwartz
On Sep 12, 2011, at 10:28 AM, Damian Abalo wrote: > Hello. > I need to generate, using R code, an excel file with multiple sheets, > I wonder if any of you know how to do so. > > Thanks for the help See the following: R Data Import/Export Manual: http://cran.r-project.org/doc/manuals/R-data.ht

Re: [R] envfit vector labels with ordiplot3d

2011-09-12 Thread Gavin Simpson
On Mon, 2011-09-12 at 03:24 -0700, Briony wrote: > Thank you very much for the suggestion. And while I'm here, thank you for > vegan and the documentation that goes with it. > > >Function ordiplot3d uses scatterplot3d, and it returns also all > >scatterplot3d items, like functions xyz.converter an

[R] Writting excel files

2011-09-12 Thread Damian Abalo
Hello. I need to generate, using R code, an excel file with multiple sheets, I wonder if any of you know how to do so. Thanks for the help __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Very slow using S4 classes

2011-09-12 Thread André Rossi
Dear Martin Morgan and Martin Maechler... Here is an example of the computational time when a slot of a S4 class is of another S4 class and when it is just one object. I'm sending you the data file. Thank you! Best regards, André Rossi ##

Re: [R] Hourly data with zoo

2011-09-12 Thread Gabor Grothendieck
On Mon, Sep 12, 2011 at 11:57 AM, steven mosher wrote: > Gabor.. thanks. > > zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) > > a couple issues:  my date data  has missing days and missing hours.. > Sorry if I was not clear on > that.. I input it to a data frame and dates are of t

[R] Loops on data˜1

2011-09-12 Thread Trying To learn again
Hi all, I have a time series a column vector with the ordered data so that the first column is the first observation and so on. The fact is that I want to run a multiple regression with only intercept. My first task is to run the regression on the first observation (1 from 276) and at the same t

Re: [R] Error message for .csv file

2011-09-12 Thread Sarah Goslee
Hi, On Mon, Sep 12, 2011 at 11:07 AM, vkent wrote: > I would be grateful if anyone could tell me what the error message: > > Error in NN[i, 1:length(od)] <- od : subscript out of bounds It means that either i ends up being larger than the number of rows in NN, or that length(od) ends up being la

[R] 1 not equal to 1, and rep command

2011-09-12 Thread Benjamin Høyer
Hi I need to use rep() to get a vector out, but I have spotted something very strange. See the reproducible example below. N <- 79 seg <- 5 segN <- N / seg # = 15.8 d1 <- seg - ( segN - floor(segN) ) * seg d1# = 1 rep(2, d1) # = numeric(0), strange - why doesn't

[R] kernel weight

2011-09-12 Thread Soberon Velez, Alexandra Pilar
Hello dear members, I need to calculate "by hand" a local lineal regression so I need to compute a kernel weight. Does somebody knows how to get a kernel to use as weighted? I can calculate a density kernel function and after pre-multiply it by the sample size. However I know this is not w

[R] Error message for .csv file

2011-09-12 Thread vkent
I would be grateful if anyone could tell me what the error message: Error in NN[i, 1:length(od)] <- od : subscript out of bounds means for a large .csv file containing gps coordinates. I am using package SPACECAP and have successfully run it with other .csv files but now keep getting this error

Re: [R] Hourly data with zoo

2011-09-12 Thread steven mosher
Gabor.. thanks. zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24) a couple issues: my date data has missing days and missing hours.. Sorry if I was not clear on that.. I input it to a data frame and dates are of the form 20110101 and hours are in the format 0,100,200 The end goa

[R] Difference in function arima estimation between 2.11.1 and R 2.12.2

2011-09-12 Thread Luis Felipe Parra
Hello , I have estimated the following model, a sarima: p=9 d=1 q=2 P=0 D=1 Q=1 S=12 In R 2.12.2 Call: arima(x = xdata, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), optim.control = list(reltol = tol)) Coefficients: ar1 ar2 ar3 ar4 ar5 ar

[R] Superimposing titles on dotcharts

2011-09-12 Thread Mikkel Grum
I've created a chart with times that employees have entered data on named tasks as in the following example: Employee <- c(rep("Tom", 127),  rep("Dick", 121),  rep("Sally", 130) ) Time <- c(seq(as.POSIXct("2011-09-12 07:00:00"), as.POSIXct("2011-09-12 14:00:00"), 200), seq(as.POSIXct("2011-09-12

Re: [R] barplot in hexagram layout

2011-09-12 Thread Schatzi
I'm not sure this is the right location (maybe R-devel would be better). - In theory, practice and theory are the same. In practice, they are not - Albert Einstein -- View this message in context: http://r.789695.n4.nabble.com/barplot-in-hexagram-layout-tp3807600p3807608.html Sent from the

[R] barplot in hexagram layout

2011-09-12 Thread Schatzi
dev.new(width=6, height=1.5,mar=c(0,0,0,0)) par(mfrow=c(1,1),mar=c(.5, .5, 1.5, .5), oma=c(.4, 0,.5, 0)) barplot(c(1,1,1,1,1,1),col=c("blue","purple","red","green","orange","yellow"), axes = FALSE) I have a barplot that returns six colors in a line. I would like to get the same six color blocks in

Re: [R] On-line machine learning packages?

2011-09-12 Thread Paul Hiemstra
On 09/11/2011 03:42 PM, Jay wrote: > What R packages are available for performing classification tasks? > That is, when the predictor has done its job on the dataset (based on > the training set and a range of variables), feedback about the true > label will be available and this information shoul

Re: [R] Automated generation of combinations

2011-09-12 Thread Andrej Blejec
Try this > ltr<-LETTERS[1:3] > unique(apply(expand.grid(ltr,ltr,ltr),1,function(x) > paste("Var",unique(sort(x)),collapse="+",sep=""))) [1] "VarA" "VarA+VarB" "VarA+VarC" "VarA+VarB+VarC" "VarB" "VarB+VarC" "VarC" > Andrej -- Andrej Blejec National Institute

Re: [R] findFreqTerms vs minDocFreq in Package 'tm'

2011-09-12 Thread Bettina Gruen
On 09/12/2011 04:28 PM, vioravis wrote: I am using 'tm' package for text mining and facing an issue with finding the frequently occuring terms. From the definition it appears that findFreqTerms and minDocFreq are equivalent commands and both tries to identify the documents with terms appearing mo

Re: [R] number of repetition

2011-09-12 Thread Duncan Murdoch
On 12/09/2011 9:03 AM, amir wrote: Hi, Is there any function or command in R that show that how many times a number is repeated in an array? ?table __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] number of repetition

2011-09-12 Thread amir
Hi, Is there any function or command in R that show that how many times a number is repeated in an array? Regards, Amir -- ___ Amir Darehshoorzadeh |Comp. Architecture Dept. PhD Student |UPC-Campus Nord, C6-221 Em

Re: [R] Multiple t.test

2011-09-12 Thread Mihovil Pletikos
Thank you for your help Yes i wanted to do the t test for all columns except for the grouping column. 2011/9/12 Uwe Ligges > > > On 12.09.2011 13:16, Raphael Saldanha wrote: > >> Hi! >> >> Try something like this: >> >> subset(example, disease==TRUE) >> subset(example, disease==FALSE)

Re: [R] how to get xlab and ylab in bold?

2011-09-12 Thread Uwe Ligges
On 12.09.2011 12:30, Nevil Amos wrote: A very basic query This code plots OK the axis values are in bold but the axis labels are not. how do I get them in bold too? Add font.lab=2 Uwe Ligges thanks Nevil Amos plot(c(1,1),xlim=c(0,450),ylim=c(0.7,1.4),xlab="Distance (cells) from edge

Re: [R] hclust and cutree: identifying branches as classes

2011-09-12 Thread Peter Langfelder
On Mon, Sep 12, 2011 at 4:59 AM, Laurent Fernandez Soldevila wrote: > Good afternoon, > > > After cuting a hierarchical tree using cutree(), how to check correspondances > between classes and branches? > This is what we do: > > srndpchc <- hclust(dist(srndpc$x[1:1000,1:3]),method="ward") #creatio

Re: [R] Automated generation of combinations

2011-09-12 Thread Dimitris Rizopoulos
one option is the following: varNames <- c("varA", "varB", "varC", "varD") f <- function (i) { combn(length(varNames), i, function (x) paste(varNames[x], collapse = " + ")) } lapply(seq_along(varNames), f) However, in case you're interested in performing a linear regression with t

[R] hclust and cutree: identifying branches as classes

2011-09-12 Thread Laurent Fernandez Soldevila
Good afternoon, After cuting a hierarchical tree using cutree(), how to check correspondances between classes and branches? This is what we do: srndpchc <- hclust(dist(srndpc$x[1:1000,1:3]),method="ward") #creation of hierarchical tree plclust(srndpchc,hmin=2) #visualisation srndpchc2

[R] PerMANOVA of community data

2011-09-12 Thread Markus Lindh
Hi! How can I make a PerMANOVA in R comparing treatments in a matrix that looks something like this: Treatment 1 Treatment 2 Treatment 3 Species 1 0.6 0.2 0 Species 2 0 0.7 0.3 Species 3

[R] how to get xlab and ylab in bold?

2011-09-12 Thread Nevil Amos
A very basic query This code plots OK the axis values are in bold but the axis labels are not. how do I get them in bold too? thanks Nevil Amos plot(c(1,1),xlim=c(0,450),ylim=c(0.7,1.4),xlab="Distance (cells) from edge of grid",ylab="Resistance distance", type="l",col="white",lwd=2,font=2

Re: [R] NMDS plot and Adonis (PerMANOVA) of community composition with presence absence and relative intensity

2011-09-12 Thread Markus Lindh
How can I display a heatmap.2 with a column dendrogram without reordering neither column or row? library(vegan) dissimilaritymatrix<-data.matrix(vegdist(step3,method="bray")) library(gplots) heatmap<-heatmap.2(dissimilaritymatrix,dendrogram="column",Colv=T, Rowv=F,key=TRUE, symkey=FALSE, density.i

[R] Display dendrogram in heatmap.2 without reordering col or row

2011-09-12 Thread Markus Lindh
How can I display a heatmap.2 with a column dendrogram without reordering neither column or row? library(vegan) dissimilaritymatrix<-data.matrix(vegdist(step3,method="bray")) library(gplots) heatmap<-heatmap.2(dissimilaritymatrix,dendrogram="column",Colv=T, Rowv=F,key=TRUE, symkey=FALSE, density.i

[R] Automated generation of combinations

2011-09-12 Thread Santiago Guallar
Hello,   I'd like to generate automatically all the possible combinations of a set of 8 variables (there are 535, too many to do it by hand). For example:   input: varA, varB, varC output: varA+varB+varC varA+varB varA+varC varB+varC varA    

Re: [R] R-help Digest, Vol 103, Issue 11

2011-09-12 Thread mihalicza . peter
Szeptember 12-től 26-ig irodán kívül vagyok, és az emailjeimet nem érem el. Sürgős esetben kérem forduljon Kárpáti Edithez (karpati.e...@gyemszi.hu). Üdvözlettel, Mihalicza Péter I will be out of the office from 12 till 26 September with no access to my emails. In urgent cases please contact

Re: [R] On-line machine learning packages?

2011-09-12 Thread Jay
In my mind this sequential classification task with feedback is somewhat different from an completely offline, once-off, classification. Am I wrong? However, it looks like the mentality on this topic is to refer me to cran/google in order to look for solutions myself. Oblivious I know about these s

Re: [R] envfit vector labels with ordiplot3d

2011-09-12 Thread Briony
Thank you very much for the suggestion. And while I'm here, thank you for vegan and the documentation that goes with it. >Function ordiplot3d uses scatterplot3d, and it returns also all >scatterplot3d items, like functions xyz.converter and points3d that >can be used for tuning labels. I tried or

Re: [R] coxreg vs coxph: time-dependent treatment

2011-09-12 Thread Göran Broström
Dear Ehsan, the cluster option is not implemented in 'eha', although you obviously get no error if trying I'll fix this. Thanks for the report. (So, use 'coxph' with cluster). Göran On Mon, Sep 12, 2011 at 4:43 AM, Ehsan Karim wrote: > Sorry: there was an error in the weight calculation,

Re: [R] regression on data subsets in datafile

2011-09-12 Thread Gabor Grothendieck
On Mon, Sep 12, 2011 at 3:42 AM, marcel wrote: > I have data of the form > > tC <- textConnection(" > Subject Date    parameter1 > bob     3/2/99  10 > bob     4/2/99  10 > bob     5/5/99  10 > bob     6/27/99 NA > bob     8/35/01 10 > bob     3/2/02  10 > steve   1/2/99  4 > steve   2/2/00  7 > s

Re: [R] Multiple t.test

2011-09-12 Thread Uwe Ligges
On 12.09.2011 13:16, Raphael Saldanha wrote: Hi! Try something like this: subset(example, disease==TRUE) subset(example, disease==FALSE) Hmmm, I think the actual answer to the question is something along this line: sapply(example[names(example)!="disease"], function(x) t.test(x ~

Re: [R] Multiple t.test

2011-09-12 Thread Raphael Saldanha
Hi! Try something like this: subset(example, disease==TRUE) subset(example, disease==FALSE) On Mon, Sep 12, 2011 at 4:54 AM, C.H. wrote: > Dear R experts, > > Suppose I have an data frame likes this: > > > example <- data.frame(age=c(1,2,3, 4,5,6), > height=c(100,110,120,130,140,150), disease

Re: [R] Hourly data with zoo

2011-09-12 Thread Gabor Grothendieck
On Mon, Sep 12, 2011 at 1:58 AM, steven mosher wrote: > I have date data as a numeric and hourly data in 0 to 2300 hours in a > dataframe. > > d  <-  rep(20110101,24) > h  <-  seq(from =  0, to  =  2300, by  = 100) > > df  <-  data.frame(LST_DATE  =  d,  LST_TIME  =  h,  data  =  rnorm(24, 0, 1))

Re: [R] envfit vector labels with ordiplot3d

2011-09-12 Thread Uwe Ligges
Please quote the prior thread, otherwise readers of this mailing list will not get the context. Uwe Ligges On 12.09.2011 01:41, Briony wrote: Thank you very much for the suggestion. And while I'm here, thank you for vegan and the documentation that goes with it. I tried ordilabel(pl$arrows

Re: [R] Solve your R problems

2011-09-12 Thread Patrick Burns
Far be it from me to misquote someone. On 12/09/2011 09:17, peter dalgaard wrote: On Sep 12, 2011, at 09:41 , Patrick Burns wrote: R-help is all about solving R problems. So here ya go: http://www.portfolioprobe.com/2011/09/12/solve-your-r-problems/ Grin. Incidentally, I don't think it is

Re: [R] regression on data subsets in datafile

2011-09-12 Thread Dennis Murphy
Hi: Here's one approach: # date typo fixed in record 5 - changed 35 to 5 tC <- textConnection(" Subject Dateparameter1 bob 3/2/99 10 bob 4/2/99 10 bob 5/5/99 10 bob 6/27/99 NA bob 8/5/01 10 bob 3/2/02 10 steve 1/2/99 4 steve 2/2/00 7 steve 3/2/01 10 steve

[R] completing missing samples

2011-09-12 Thread Eran Eidinger
Hello, I have a time-series that has some missing samples. I was thinking on completing them using either zero-order hold or linear interpolation. I am looking for an efiicient way (other than a loop...) of identifiying the missing time slots and filling them. Can you think of any methods that mi

Re: [R] Latex + R + sweave

2011-09-12 Thread Liviu Andronic
On Mon, Sep 12, 2011 at 9:21 AM, Twaha Mlwilo wrote: > > Hello all, > Good day, > I have problem on how to remove the source code from the pdf output.Here I > mean this. >  code in sweave Rnw files > >  <<>>= >  x<-c(1,2,3,4,5,6) > x >  mean(x) > sd(x) > @ > then would like it appear as > mean =

Re: [R] Power analysis in hierarchical models

2011-09-12 Thread ONKELINX, Thierry
Dear Tom, I think you failed to generate simulated outcome from the correct model. Hence the zero variance of your random effects. Here is a better working example. library(lme4) fake2 <- expand.grid(Bleach = c("Control","Med","High"), Temp = c("Cold","Hot"), Rep = factor(seq_len(3)), ID = seq

Re: [R] On-line machine learning packages?

2011-09-12 Thread Dennis Murphy
http://cran.r-project.org/web/views/ Look for 'machine learning'. Dennis On Sun, Sep 11, 2011 at 11:33 PM, Jay wrote: > If the answer is so obvious, could somebody please spell it out? > > > On Sep 11, 10:59 pm, Jason Edgecombe wrote: >> Try this: >> >> http://cran.r-project.org/web/views/Mach

Re: [R] Solve your R problems

2011-09-12 Thread Liviu Andronic
On Mon, Sep 12, 2011 at 9:41 AM, Patrick Burns wrote: > R-help is all about solving R problems. > So here ya go: > http://www.portfolioprobe.com/2011/09/12/solve-your-r-problems/ > Sweet. :) May I suggest a font change: anything but the default CM should do the trick. For one I prefer Palatino &

Re: [R] Hourly data with zoo

2011-09-12 Thread Dennis Murphy
Hi Steven: How about this? d <- rep(20110101,24) h <- sprintf('%04d', seq(0, 2300, by = 100)) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) df <- transform(df, datetime = as.POSIXct(paste(LST_DATE, LST_TIME), format = '%Y%m%d %H%M')) library(zoo

Re: [R] Solve your R problems

2011-09-12 Thread peter dalgaard
On Sep 12, 2011, at 09:41 , Patrick Burns wrote: > R-help is all about solving R problems. > So here ya go: > http://www.portfolioprobe.com/2011/09/12/solve-your-r-problems/ Grin. Incidentally, I don't think it is quite true that I called you "that infernal guy" at useR. I might have done so (

[R] regression on data subsets in datafile

2011-09-12 Thread marcel
I have data of the form tC <- textConnection(" Subject Dateparameter1 bob 3/2/99 10 bob 4/2/99 10 bob 5/5/99 10 bob 6/27/99 NA bob 8/35/01 10 bob 3/2/02 10 steve 1/2/99 4 steve 2/2/00 7 steve 3/2/01 10 steve 4/2/02 NA steve 5/2/03 16 kevin 6/5/04 2

[R] Latex + R + sweave

2011-09-12 Thread Twaha Mlwilo
Hello all, Good day, I have problem on how to remove the source code from the pdf output.Here I mean this. code in sweave Rnw files <<>>= x<-c(1,2,3,4,5,6) x mean(x) sd(x) @ then would like it appear as mean = 3.5 sd=1.3 x=1,2,3,4,5,6 thank you in advance

[R] Multiple t.test

2011-09-12 Thread C.H.
Dear R experts, Suppose I have an data frame likes this: > example <- data.frame(age=c(1,2,3, 4,5,6), height=c(100,110,120,130,140,150), > disease=c(TRUE, TRUE, TRUE, FALSE, FALSE, FALSE)) > example age height disease 1 1100TRUE 2 2110TRUE 3 3120TRUE 4 4130

[R] Solve your R problems

2011-09-12 Thread Patrick Burns
R-help is all about solving R problems. So here ya go: http://www.portfolioprobe.com/2011/09/12/solve-your-r-problems/ -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The