Re: [R] Mean using different group for a real r beginner

2013-05-17 Thread arun
Hi, Try either: tolerance - read.csv(http://www.ats.ucla.edu/stat/r/examples/alda/data/tolerance1.txt;)  aggregate(exposure~male,data=tolerance,mean)  # male exposure #1    0 1.246667 #2    1 1.12 #or  library(plyr)  ddply(tolerance,.(male),summarize,exposure=mean(exposure)) #  male

Re: [R] How to use character in C code?

2013-05-17 Thread Jan van der Laan
Characters in R are zero terminated (although I couldn't find that in the R extensions manual). So, you could use: void dealWithCharacter(char **chaine, int *size){ Rprintf(The string is '%s'\n, chaine[0]); } Jan On 05/10/2013 03:51 PM, cgenolin wrote: Hi the list, I include some C

[R] Find the indices of non-NA elements of a sequence

2013-05-17 Thread jpm miao
Hi, I have a sequence whose 1st, 3rd, 4th, 6th are non-NAs. How could I let R return 1,3,4,6, the indices? I know only how to find the non-NA elements. Thanks, Miao test-c(2,NA,6,8,NA,12) test[is.na(test)==FALSE] [1] 2 6 8 12 [[alternative HTML version deleted]]

Re: [R] convert a data.frame to matrix

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 01:59 , David Winsemius wrote: On May 16, 2013, at 1:46 PM, Hermann Norpois wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). jam vec1 vec3

Re: [R] Find the indices of non-NA elements of a sequence

2013-05-17 Thread Berend Hasselman
On 17-05-2013, at 08:36, jpm miao miao...@gmail.com wrote: Hi, I have a sequence whose 1st, 3rd, 4th, 6th are non-NAs. How could I let R return 1,3,4,6, the indices? I know only how to find the non-NA elements. Thanks, Miao test-c(2,NA,6,8,NA,12) test[is.na(test)==FALSE] [1] 2

[R] Selecting A List of Columns

2013-05-17 Thread Sparks, John James
Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column names as in: x=as.data.frame(matrix(c(1,2,3, 1,2,3, 1,2,2, 1,2,2,

Re: [R] peering inside functions in a package?

2013-05-17 Thread Barry Rowlingson
On Fri, May 17, 2013 at 2:56 AM, Seth Myers sjmyers3...@gmail.com wrote: Let's say I would like to look inside the function corBrownian in library (ape). When I type in the function name I get the following, which is not nearly the detail that goes into this function. I am wondering how to

Re: [R] Rcmdr Bug?

2013-05-17 Thread Pascal Oettli
Hi, Which command? But I would say that the first row is imported as column names. Regards, Pascal 2013/5/17 Knut Krueger r...@knut-krueger.de may be it is a bug: if a excel file is not containing headlines the first data row will not be imported Knut

Re: [R] Find the indices of non-NA elements of a sequence

2013-05-17 Thread Pascal Oettli
Hi, For example: which(complete.cases(test)) [1] 1 3 4 6 Probably a more elegant way exists. Regards, Pascal 2013/5/17 jpm miao miao...@gmail.com Hi, I have a sequence whose 1st, 3rd, 4th, 6th are non-NAs. How could I let R return 1,3,4,6, the indices? I know only how to find the

Re: [R] read excel files problem [was] Rcmdr Bug

2013-05-17 Thread Knut Krueger
Am 17.05.2013 09:09, schrieb Pascal Oettli: Hi, Which command? But I would say that the first row is imported as column names. maybe its a general problem of importing excel files. First of all I am using only sheeets with headlines ;_) but Students do sometimes not. ;-) So gdata -

Re: [R] Selecting A List of Columns

2013-05-17 Thread Pascal Oettli
Hello, It works for me if I replace ImportantVars - as.character(ImportantVars) by ImportantVars - ImportantVars$Vars Hope this helps, Pascal 2013/5/17 Sparks, John James jspa...@uic.edu Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select

[R] pearson correlation significant level

2013-05-17 Thread Elaine Kuo
Hello I am using package Hmisc to calculate the pearson correlation and the significant level for the matrix of t_i and t_r. (temperature minimum and temperature range) However, I have difficulty interpreting the result, even after checking the manual. Please kindly help to indicate if the

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 12:02 , peter dalgaard wrote: On May 17, 2013, at 08:51 , Sparks, John James wrote: Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 08:51 , Sparks, John James wrote: Dear R Helpers, I need help with a slightly unusual situation in which I am trying to select some columns from a data frame. I know how to use the subset statement with column names as in: Notice that subset() is a convenience

[R] Repeating sequence elements

2013-05-17 Thread Stefan Petersson
I want to create a sequence, repeating each element according to a vector. I have this: v - c(4, 4, 4, 3, 3, 2) And want to create this: 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5 6 6 TIA // s R version 3.0.0 (2013-04-03) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8

Re: [R] peering inside functions in a package?

2013-05-17 Thread Duncan Murdoch
On 13-05-16 9:56 PM, Seth Myers wrote: Let's say I would like to look inside the function corBrownian in library (ape). When I type in the function name I get the following, which is not nearly the detail that goes into this function. I am wondering how to begin cracking this function open

Re: [R] How could I see the source code of functions in an R package?

2013-05-17 Thread Duncan Murdoch
On 13-05-17 12:01 AM, David Winsemius wrote: Do this search with your favorite search tool Accessing the sources ligges (Uwe Ligges is the author of a comprehensive article on the topic in R News.) That article is also linked from the R help system. After help.start(), look for technical

Re: [R] Repeating sequence elements

2013-05-17 Thread Rui Barradas
Hello, At an R prompt, type ?rep Then use v - c(4, 4, 4, 3, 3, 2) rep(1:6, v) Hope this helps, Rui Barradas Em 17-05-2013 11:53, Stefan Petersson escreveu: I want to create a sequence, repeating each element according to a vector. I have this: v - c(4, 4, 4, 3, 3, 2) And want to

Re: [R] Repeating sequence elements

2013-05-17 Thread Jorge I Velez
Try rep(1:length(v), v) HTH, Jorge.- On Fri, May 17, 2013 at 8:53 PM, Stefan Petersson ste...@inizio.se wrote: I want to create a sequence, repeating each element according to a vector. I have this: v - c(4, 4, 4, 3, 3, 2) And want to create this: 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5

Re: [R] Rcmdr Bug?

2013-05-17 Thread John Fox
Dear Knut, This is really more a limitation than a bug. Like most of the dialogs in the Rcmdr, the dialog to read Excel files uses existing facilities in R and R packages. I'll see whether it's possible to add an option to read a data set without variable names. The obvious workaround is to

Re: [R] Repeating sequence elements

2013-05-17 Thread arun
Hi, rep(seq_along(v),v)  #[1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5 6 6 A.K. - Original Message - From: Stefan Petersson ste...@inizio.se To: r-help@r-project.org Cc: Sent: Friday, May 17, 2013 6:53 AM Subject: [R] Repeating sequence elements I want to create a sequence, repeating each

Re: [R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-17 Thread Adams, Jean
To make it easier for R-help readers to help you, please you provide the before UUU[2] data using the dput() function. dput(UUU[2]) Jean On Thu, May 16, 2013 at 11:12 AM, Aldi a...@dsgmail.wustl.edu wrote: Hi, If I have an R object UUU, where the second element is U2, based on g column of

[R] n in pglm() and relogit()

2013-05-17 Thread f . leyendecker84
Dear all, How do I obtain the number of countries that my panel models estimated by pglm() and relogit() (the latter one is in the Zelig library) use? I couldn't find any information on that in the help files. Thank you very much in advance. Best wishes

[R] Homals: Nonlinear PCA

2013-05-17 Thread l. calciano
Hello! I'm using the NLPCA to reduce the dimensionality of nine variables (4 nominal / 3 ordinal /2 numeric) to obtain the object-scores to be used as dependent variable in a regression model. I'm using the package homals (http://www.jstatsoft.org/v31/i04/paper). The output is: Call: homals

[R] Using grubbs test for residuals to find outliers

2013-05-17 Thread Karthik Srinivasan
Hi, I am a new user of R. This is a conceptual doubt regarding screeing out outliers from the dataset in regression. I read up that Cook's distance can be used and if we want to remove influential observations, we can use the metric (4/n) (n=no of observations) to remove any outliers. I also

Re: [R] Contour lines in a persp plot

2013-05-17 Thread Matthew
Thanks a lot, that is all i want. If someone is interessed, see the code below panel.3d.contour - function(x, y, z, rot.mat, distance, nlevels = 20, zlim.scaled, ...) # les3 points de suspension pour dire les autres paramètres sont ceux données par défaut { add.line -

[R] Log scales

2013-05-17 Thread Emily Gleeson
Dear All, I have a query about using log scales for filled.contour plots. I have used log values on the x and y axes but labelled the axes with their linear (non-log) values. I's like to do the same with the contour values. I want the range to go from -100% to +100%. To use log I just added

[R] External access to fft routines

2013-05-17 Thread Peter Craig
Dear colleagues (especially those with an understanding of the inner workings of R), For some years, I have been using R's fft (Fast Fourier Transform) routines from within C code as part of an R package. With R-3.0.1, fft_factor and fft_work are no longer available as entry points declared in

[R] zigzag confidence interval in a plot

2013-05-17 Thread Ozgul Inceoglu
Dear All, When I plot the values and linear regression line for one data set, it is fine. But for another one I see zigzags, when I plot the confidence interval cd Depth CHAOsep12RNA 9,94804 25,06 1476,83 40,04 1540,561404 50,11 1575,17 52,46 349,22 54,92 1941,5

Re: [R] R looping help

2013-05-17 Thread Adams, Jean
It's difficult to see where your error is when you provide no accompanying data for us to test your code out on (X? Y? Stand?). However, it looks like you are making your code more complex than it needs to be. Are you simply trying to a fit a separate linear regression to each subset of your

Re: [R] Rcmdr Bug?

2013-05-17 Thread Knut Krueger
Am 17.05.2013 13:36, schrieb John Fox: Dear Knut, This is really more a limitation than a bug. Like most of the dialogs in the Rcmdr, the dialog to read Excel files uses existing facilities in R and R packages. I'll see whether it's possible to add an option to read a data set without

[R] out of the mailing list

2013-05-17 Thread Mario Garrido
Hello, I want to stop receiveng mails from R help forum, thanks. This is my data : Mario Garrido Escudero Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Fac. de Farmacia Campus Unamuno Universidad de Salamanca gaiarr...@usal.es [[alternative HTML version

Re: [R] out of the mailing list

2013-05-17 Thread Pascal Oettli
Hello, It is not the correct procedure. Go to the bottom of the following webpage to unsubscribe. https://stat.ethz.ch/mailman/listinfo/r-help Regards, Pascal 2013/5/17 Mario Garrido gaiarr...@usal.es Hello, I want to stop receiveng mails from R help forum, thanks. This is my data :

[R] update an array of plots in 'real-time' without drawing lags

2013-05-17 Thread Martin Batholdy
Hi, I know R is not made for this, but I still wanted to ask if there are possibilities to do this; I repeatedly collect data from a database for a given time interval. Now I would like to monitor the change of this data with some nice plots. I actually have to draw 15 plots to get the whole

[R] mirt package error in ESTIMATION...

2013-05-17 Thread kende jan
Hello everyone, I am trying to undertake an item bifactor analysis of graded response data from a questionnaire. I am using the mirt package, especially the bfactor function.My dataset is called data.items, it contains about 2000 observations and 31 variables (variables represent the items in

Re: [R] how to calculate the mean in a period of time?

2013-05-17 Thread arun
Hi, Try this:  dat1$idx-with(dat1,ifelse(is.na(delais)|delais45 delais20, 1,ifelse(delais60 delais=45,2,ifelse(delais=90 delais=60,3,NA dat1$idx1-c(dat1$idx[-head(dat1$idx,1)],1) library(zoo) res1-do.call(rbind,lapply(split(dat1,dat1$patient_id),function(x)

[R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
Dear all, I'm trying to get a Brownian bridge kernel (kernelbb) for each combination of  two consecutive animal locations (see commands below) and put them, with a loop, inside a list. It works well at the beginning but after 42 runs, it appears the following warning : Error in

[R] R and libre office base

2013-05-17 Thread Johan Lassen
Dear community . I would like to connect r to libre office base. Does anyone know if and how this can be done? I think of the pendant to rodbc for libre office. I am using windows 7. Thanks in advance and best regards johan [[alternative HTML version deleted]]

Re: [R] R and libre office base

2013-05-17 Thread Marc Schwartz
On May 17, 2013, at 9:47 AM, Johan Lassen johanlas...@gmail.com wrote: Dear community . I would like to connect r to libre office base. Does anyone know if and how this can be done? I think of the pendant to rodbc for libre office. I am using windows 7. Thanks in advance and best regards

Re: [R] points overlay axis

2013-05-17 Thread Jonathan Phillips
Apologies to John - I should have thought to give an example. However, xpd is what I was looking for. Thanks for the help! On 14 May 2013 14:55, David Carlson dcarl...@tamu.edu wrote: Let's try again after restraining Outlook's desire to use html. set.seed(42) dat - matrix(c(runif(48), 0,

Re: [R] max length of a factor variable

2013-05-17 Thread bennose
Technically this is correct for raw R functionality. in practice various modules impose their own limits on variables so you have to check. For example the coxreg package truncates all variables to 16 characters. for example the test below res Call: coxreg(formula = Surv(vtime, vstatus) ~

Re: [R] zigzag confidence interval in a plot

2013-05-17 Thread Peter Ehlers
On 2013-05-17 06:03, Ozgul Inceoglu wrote: Dear All, When I plot the values and linear regression line for one data set, it is fine. But for another one I see zigzags, when I plot the confidence interval cd Depth CHAOsep12RNA 9,94804 25,06 1476,83 40,04 1540,561404 50,11

Re: [R] zigzag confidence interval in a plot

2013-05-17 Thread Rui Barradas
Hello, Try the following. lmR - lm(cd$Depth ~ cd$CHAOsep12RNA) pconfR - predict(lmR,interval=confidence) pcR - pconfR[order(pconfR[, 1]), ] # Add this line plot(cd$CHAOsep12RNA,cd$Depth, ylim = rev(range(0:100)), xlab=CHAO, ylab=Depth, pch=15, las=2, main=Sep12-RNA, cex.main=1) abline(lmR)

Re: [R] Problem with ordiellipse coloured factor in Vegan

2013-05-17 Thread John Kane
No data. The list tends to strip out many kinds of attachements including csv files. I'd suggest trying .txt or parking the data at someplace like [url=http://www.mediafire.com/][b]MediaFire[/b][/url] or Dropbox [url=https://www.dropbox.com/][b]Dropbox[/b][/url] John Kane Kingston ON Canada

Re: [R] pearson correlation significant level

2013-05-17 Thread Jose Iparraguirre
Dear Elaine, One of the elements you obtain the P matrix, which is the matrix of asymptotic p-values. In your case, you get that the asymptotic p-value of the association between t_i and t_r is 0. That is, there would exist a perfect association (look also at the first result, the matrix of

[R] Comma separated vector

2013-05-17 Thread Manta
Hi all, I have a vector of numbers, and to be able to pass it to RMySQL and use the IN clause I need to have this vector to be a single list numeric and comma separated. I saw the post below but it is about strings, which I do not need (I cannot pass strings in this SQL query, I need something

Re: [R] Comma separated vector

2013-05-17 Thread jim holtman
is this what you want x - c(1, 2, 3, 4, 5) paste0(where ASSETT in (, paste(x, collapse = ','), )) [1] where ASSETT in (1,2,3,4,5) On Fri, May 17, 2013 at 11:46 AM, Manta mantin...@libero.it wrote: Hi all, I have a vector of numbers, and to be able to pass it to RMySQL and use the IN

Re: [R] Comma separated vector

2013-05-17 Thread Jeff Newmiller
You are wrong... since the SQL query you wish to create is itself a string. Of course, you cannot send a SQL fragment such as you used as an example, so be sure to form a complete, syntactically correct SQL statement before giving it to your database query function. Oh, and if you need more

[R] Problems using lmer {lme4}

2013-05-17 Thread Andrea Goijman
Dear R list, I'm attaching a sample of my data which consists on the presence/absence (punto6, binomial n=5 occasions) of different species (sp), on different sites (site) within routes ('route). First, I want to be able to find if there is autocorrelation of the response variable between the

[R] inverse for formula transformations on LHS

2013-05-17 Thread Paul Johnson
This is an R formula handling question. It arose in class. We were working on the Animals data in the MASS package. In order to see a relationship, you need to log brain and body weight. It's a fun one for teaching regression, if you did not try it yet. There are outliers too! Students wanted

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Bert Gunter
It would be better to post this on the r-sig-mixed-models list, I think. -- Bert On Fri, May 17, 2013 at 10:02 AM, Andrea Goijman agoij...@cnia.inta.gov.ar wrote: Dear R list, I'm attaching a sample of my data which consists on the presence/absence (punto6, binomial n=5 occasions) of

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread agoijman
Thanks! I didn't know about that list. I forwarded my question there Andrea Bert Gunter wrote It would be better to post this on the r-sig-mixed-models list, I think. -- Bert On Fri, May 17, 2013 at 10:02 AM, Andrea Goijman lt; agoijman@.gov gt; wrote: Dear R list, I'm attaching a

Re: [R] update an array of plots in 'real-time' without drawing lags

2013-05-17 Thread David Winsemius
On May 17, 2013, at 7:04 AM, Martin Batholdy wrote: Hi, I know R is not made for this, but I still wanted to ask if there are possibilities to do this; I repeatedly collect data from a database for a given time interval. Now I would like to monitor the change of this data with some

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread David Winsemius
On May 17, 2013, at 7:44 AM, Rémi Lesmerises wrote: Dear all, I'm trying to get a Brownian bridge kernel (kernelbb) for each combination of two consecutive animal locations (see commands below) and put them, with a loop, inside a list. It works well at the beginning but after 42 runs, it

Re: [R] pearson correlation significant level

2013-05-17 Thread Peter Ehlers
On 2013-05-17 08:37, Jose Iparraguirre wrote: Dear Elaine, One of the elements you obtain the P matrix, which is the matrix of asymptotic p-values. In your case, you get that the asymptotic p-value of the association between t_i and t_r is 0. That is, there would exist a perfect association

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
This is the problematic data, especially the line 43, but when I removed that line, it bugs at line 62 and so on.           sig1                    time                        id     UTMnorthin UTMeasting 40      4.5766      2012.05.30 08:00:00     Ade-55419576     390052 41      4.5766      

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Patrick Coulombe
Hi Andrea, I'm not exactly sure what you're trying to do, but you've included a random effect for a site coefficient that's not even in your list of fixed effects... you're basically allowing the coefficient for site to vary across routes, but you're never including the coefficient in the first

Re: [R] pearson correlation significant level

2013-05-17 Thread Don McKenzie
Just stating the obvious that Peter left unsaid: The OP calculated a matrix, whose diagonal is the correlations between each variable and itself, with the off-diagonal entries being the ones of interest. On 17-May-13, at 11:06 AM, Peter Ehlers wrote: On 2013-05-17 08:37, Jose Iparraguirre

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
There was some mistakes in my previous sending. The following are correct. This is the problematic data, especially the line 43, but when I removed that line, it bugs at line 62 and so on.           sig1                    time                        id       UTMnorthin  UTMeasting 40      

[R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread Tim
#question I have the following data set: Date-c(9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/8/2010) EstimatedQuantity-c(3535,2772,3279,3411,3484,3274,3305) ScowNo-c(4001,3002,4002,BR 8,4002,BR 8,4001) dataset- data.frame(EstimatedQuantity,Date,ScowNo) #I'm trying to convert the

[R] time-series aggregation of information

2013-05-17 Thread Chirag Maru
I have following data for which I need to calculate the weighted aggregate value of the parameter at each time. Date,Parameter,Weight 2012-01-31,90,200 2012-01-31,80,400 2012-01-31,70,500 2012-01-31,60,800 2012-02-29,120,220 2012-02-29,110,410 2012-02-29,75,520 2012-02-29,65,840

[R] help

2013-05-17 Thread masumeh akhgar
Hello, I fail to tranfer data from a dataframe to a matrix. var is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). var vec1 vec3 d1 d2 1 172 173 223 356 dput (var) structure(list(vec1 = 172L, vec3 = 173L, d1 = 223L, d2 = 356L), .Names =

[R] help

2013-05-17 Thread masumeh akhgar
hi deer all Estimate KM survival probabilities for each categories of RX means ‘treatment’ and ‘placebo’ separately surv.Rx-survfit(Surv(SURVT,STATUS)~strata(RX),data=rem.data) when write that command. it doesnt run. what should i do? thanks __

Re: [R] help

2013-05-17 Thread Kevin E. Thorpe
On 05/17/2013 02:34 PM, masumeh akhgar wrote: hi deer all Estimate KM survival probabilities for each categories of RX means ‘treatment’ and ‘placebo’ separately surv.Rx-survfit(Surv(SURVT,STATUS)~strata(RX),data=rem.data) when write that command. it doesnt run. what should i do? thanks

Re: [R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread David Winsemius
On May 17, 2013, at 9:46 AM, Tim wrote: #question I have the following data set: Date-c(9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/7/2010,9/8/2010) EstimatedQuantity-c(3535,2772,3279,3411,3484,3274,3305) ScowNo-c(4001,3002,4002,BR 8,4002,BR 8,4001) dataset-

Re: [R] help

2013-05-17 Thread Berend Hasselman
On 17-05-2013, at 20:15, masumeh akhgar akhgar.masu...@gmail.com wrote: Hello, I fail to tranfer data from a dataframe to a matrix. var is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). var vec1 vec3 d1 d2 1 172 173 223 356 dput

Re: [R] help

2013-05-17 Thread John Kane
m - as.matrix(var) John Kane Kingston ON Canada -Original Message- From: akhgar.masu...@gmail.com Sent: Fri, 17 May 2013 22:45:22 +0430 To: r-help@r-project.org Subject: [R] help Hello, I fail to tranfer data from a dataframe to a matrix. var is from a dataframe (and

Re: [R] time-series aggregation of information

2013-05-17 Thread David Winsemius
On May 17, 2013, at 11:48 AM, Chirag Maru wrote: I have following data for which I need to calculate the weighted aggregate value of the parameter at each time. Date,Parameter,Weight 2012-01-31,90,200 2012-01-31,80,400 2012-01-31,70,500 2012-01-31,60,800 2012-02-29,120,220

[R] help

2013-05-17 Thread masumeh akhgar
hi all this command used tt function for all variables. How can i define a different function for each variable? exCox.all-coxph(Surv(SURVT,STATUS) ~ RX+LOGWBC+SEX+tt(RX)+tt(LOGWBC)+tt(SEX), data=rem.data,tt=function(x,t,...) log(t)*x)) thank you __

Re: [R] time-series aggregation of information

2013-05-17 Thread arun
Hi, May be this helps: dat- read.table(text= Date,Parameter,Weight 2012-01-31,90,200 2012-01-31,80,400 2012-01-31,70,500 2012-01-31,60,800 2012-02-29,120,220 2012-02-29,110,410 2012-02-29,75,520 2012-02-29,65,840 2012-03-31,115,210 2012-03-31,100,405 2012-03-31,70,500 2012-03-31,60,800

Re: [R] help

2013-05-17 Thread David Winsemius
On May 17, 2013, at 11:55 AM, masumeh akhgar wrote: hi all this command used tt function for all variables. How can i define a different function for each variable? exCox.all-coxph(Surv(SURVT,STATUS) ~ RX+LOGWBC+SEX+tt(RX)+tt(LOGWBC)+tt(SEX), data=rem.data,tt=function(x,t,...) log(t)*x))

[R] Bivariate - multivariate linear regression

2013-05-17 Thread Jesse Gervais
Hi there, I want to do several bivariate linear regressions and, than, do a multivariate linear regression including only variables significantly associated *(p 0.15)* with y in bivariate analysis, without having to look manually to those p values. So, here what I got for the moment.

[R] formatting column names of data frame

2013-05-17 Thread Patrick Leyshock
Is there any way to format the headers of data frames, for printing? I am using Sweave to generate formatted reports. In Sweave, I read in a data.frame: result - read.table(path.to.table); then display it: print.data.frame(result); This gives me what I expect in

[R] image and color gradient

2013-05-17 Thread Hermann Norpois
Hello, I have a nice function that makes an image of an matrix e.g.: qt[1:3,1:3] rs655246 rs943795 rs955612 rs655246 NA NA NA rs943795 9.610070e-04 NA NA rs955612 5.555616e-05 7.915982e-07 NA myimage - function(x, cex.axis = 0.7,

Re: [R] inverse for formula transformations on LHS

2013-05-17 Thread Roger Koenker
Paul, Inverting log(y) is just the beginning of the problem, after that you need to teach predict.lm() that E(y |x) = exp(x'betahat + .5*sigmahat^2) and then further lessons are required to get it to understand how to adapt its confidence and prediction bands… and then you need to generalize

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Andrea Goijman
Hi Patrick, Thanks for you reply. I tried adding site fixed effect as you told me, but the program failed again (R stopped working). Basically, what I am trying to do is to test for auto-correlation between sites within routes. My survey takes place in routes, but each route is divided in

Re: [R] image and color gradient

2013-05-17 Thread David Winsemius
On May 17, 2013, at 12:58 PM, Hermann Norpois wrote: Hello, I have a nice function that makes an image of an matrix e.g.: qt[1:3,1:3] rs655246 rs943795 rs955612 rs655246 NA NA NA rs943795 9.610070e-04 NA NA rs955612 5.555616e-05

Re: [R] formatting column names of data frame

2013-05-17 Thread Rainer Schuermann
Have you tried xtable? library( xtable ) x - structure(list(Record = 1:3, Average = c(34L, 14L, 433L), Maximum = c(899L, 15L, 1003L)), .Names = c(Record, Average, Maximum), class = data.frame, row.names = c(NA, -3L)) x - xtable( x ) print( x ) % latex table generated in R 2.15.2 by xtable

Re: [R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread arun
Hi, library(plyr) res-dcast(dataset,Date~ScowNo,sum,value.var=EstimatedQuantity)  rownames(res)- res[,1] res[,-1] # 3002 4001 4002 BR 8 #9/7/2010 2772 3535 6763 6685 #9/8/2010    0 3305    0    0 A.K. - Original Message - From: Tim t...@mde.state.md.us To: r-help@r-project.org

[R] filter rows by value

2013-05-17 Thread Ye Lin
Hey All, I want to delete rows based on the last 2 digits on the value in one column but I dont know how to do that. Suppose my data looks like this: Var Time 1 51 2 151 3 251 *4234* *5 331* 6351 I want to delete the rows that

Re: [R] filter rows by value

2013-05-17 Thread Rui Barradas
Hello, Try the following. dat - read.table(text = Var Time 1 51 2 151 3 251 4234 5 331 6351 , header = TRUE) dat[dat$Time %% 100 == 51, ] Em 17-05-2013 22:01, Ye Lin escreveu: Hey All, I want to delete rows based on the

Re: [R] Bivariate - multivariate linear regression

2013-05-17 Thread Peter Ehlers
On 2013-05-17 12:45, Jesse Gervais wrote: Hi there, I want to do several bivariate linear regressions and, than, do a multivariate linear regression including only variables significantly associated *(p 0.15)* with y in bivariate analysis, without having to look manually to those p values.

Re: [R] filter rows by value

2013-05-17 Thread arun
Hi, dat1- read.table(text= Var  Time 1  51 2  151 3  251 4    234 5  331 6    351 ,sep=,header=TRUE) dat1[!is.na(match(gsub(.*(\\d{2})$,\\1,dat1$Time),51)),] #  Var Time #1   1   51 #2   2  151 #3   3  251 #6   6  351 #or

Re: [R] filter rows by value

2013-05-17 Thread Ye Lin
it works!Thanks! On Fri, May 17, 2013 at 2:28 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Try the following. dat - read.table(text = Var Time 1 51 2 151 3 251 4234 5 331 6351 , header = TRUE) dat[dat$Time

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Michael Sumner
I presume it's related to the fact that the X coordinate is duplciated in the two records, and the grid generated by adehabitatHR is a single column, Here's a test: require(adehabitatHR) m - matrix(c(5419574 ,390051, 5419490 , 390051), ncol = 2, byrow = TRUE) tt - as.POSIXct(c(2012-05-30

[R] Heterogeneous negative binomial

2013-05-17 Thread Joseph Hilbe
I have seen several queries about parameterizing the negative binomial scale parameter. This is called the heterogeneous negative binomial. I have written a function called nbinomial which is in the msme package on CRAN. Type ?nbinomial to see the help file. The default model is a negative