[R] SNPRelate package error

2013-01-22 Thread sun-ye
Dear, I am using the R package SNPRelate but I found an error when I run the following command. Do you know what might be the problem? Thanks in advance. vcf.fn - system.file(extdata,str.vcf,package=SNPRelate) snpgdsVCF2GDS(vcf.fn,test.gds) Start snpgdsVCF2GDS ... Extracting

[R] simple reshape

2013-01-22 Thread Troels Ring
Dear friends - this is a very simple question - I have a data frame 'data.frame': 87 obs. of 3 variables: $ ID : int 1 1 1 2 2 2 3 3 3 4 ... $ prep : num 1.18 1.38 1.34 1.93 2.38 2.24 1.17 1.13 1.21 1.89 ... $ postp: num 0.63 0.71 0.75 1.01 1.12 1.07 0.87 0.64 0.7 0.8 ... - 29

Re: [R] SNPRelate package error

2013-01-22 Thread Pascal Oettli
Hello, Why do you think it is a package error? The error message says that the file [...] has different numbers of columns. Please check that file first. Regards, Pascal Le 22/01/2013 16:05, sun...@scib.ac.cn a écrit : Dear, I am using the R package SNPRelate but I found an error when I

[R] Simple use of dcast (reshape2 package)

2013-01-22 Thread Patrick Connolly
Suppose I have a small dataframe aa Target Eaten ID 50 TPP 0 1 51 TPP 1 2 52 TPP 3 3 53 TPP 1 4 54 TPP 2 5 50.1GPA 9 1 51.1GPA11 2 52.1GPA 8 3 53.1GPA 8 4 54.1GPA10 5 And I want to reshape it

[R] How to align group based on the common values of two columns in r

2013-01-22 Thread Tammy Ma
HI, I met this problem: I have the feature data frame: Feature OS 4 2 4 1 4 3 1 2 4 1 what I want to do is to autimatically create one more column called group: Feature OS Group

Re: [R] Ellipse in PCA with parameters a and bdefined.

2013-01-22 Thread mary
Ok... so, in my model my a is built using the standard deviation of the first principal component and b with the second, so my x and Y should be : PCA $ scores [, 1], PCA $ scores [, 2] but in this way I do not get out a confidence interval set on my parameters but many ellipses. Thanks Mary

Re: [R] How to align group based on the common values of two columnsinr

2013-01-22 Thread Gerrit Eichner
Hi, Tammy, maybe you find something interesting looking at ?interaction and/or try (with df being your data frame) df$Group - as.integer( with( df, interaction( Feature, OS)[, drop = TRUE])) HtH -- Gerrit On Tue, 22 Jan 2013, Tammy Ma wrote: HI, I met this problem: I have the

Re: [R] Simple use of dcast (reshape2 package)

2013-01-22 Thread D. Rizopoulos
you could try the following: DF - read.table(textConnection( Target Eaten ID 50 TPP 0 1 51 TPP 1 2 52 TPP 3 3 53 TPP 1 4 54 TPP 2 5 50.1GPA 9 1 51.1GPA11 2 52.1GPA 8 3 53.1GPA 8 4 54.1GPA10 5),

Re: [R] simple reshape

2013-01-22 Thread Jim Lemon
On 01/22/2013 07:19 PM, Troels Ring wrote: Dear friends - this is a very simple question - I have a data frame 'data.frame': 87 obs. of 3 variables: $ ID : int 1 1 1 2 2 2 3 3 3 4 ... $ prep : num 1.18 1.38 1.34 1.93 2.38 2.24 1.17 1.13 1.21 1.89 ... $ postp: num 0.63 0.71 0.75 1.01 1.12 1.07

Re: [R] Simple use of dcast (reshape2 package)

2013-01-22 Thread Gerrit Eichner
Hi, Patrick, I think (with reshape from the stats package) reshape( aa, idvar = ID, v.names = Eaten, timevar = Target, direction = wide) does the trick (followed by renaming the columns of the resulting data frame). Hth -- Gerrit On Tue, 22 Jan 2013, Patrick Connolly wrote:

[R] Concatenate two lists, list by list

2013-01-22 Thread Alaios
Dear all, I would like to concatenate the lists below str(Part2$dataset) List of 3  $ : num [1:16001] 0 0 0 0 0 0 0 0 0 0 ...  $ : num [1:16001] 0 0 0 0 0 0 0 0 0 0 ...  $ : num [1:16001] 0 0 0 0 0 0 0 0 0 0 ... str(Part1$dataset) List of 3  $ : num [1:16001] 0 0 0 0 0 0 0 0 0 0 ...  $ : num

[R] FactoMineR

2013-01-22 Thread Dániel Kehl
Dear Users, I installed R Commander and the FactoMineR plug-in. Everything is fine, I can see the new menu, I can import datasets, but if I want to use any of the items in the FactoMineR menu, i get the following error: Error in get(.activeDataSet) : object '.activeDataSet' not found even if

Re: [R] Concatenate two lists, list by list

2013-01-22 Thread PIKAL Petr
Hi Maybe you could use mapply mapply(c, Part1$dataset,Part2$dataset) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Alaios Sent: Tuesday, January 22, 2013 11:26 AM To: R help Subject: [R] Concatenate two

[R] New book announcement: R and Data Mining - Examples and Case Studies

2013-01-22 Thread Yanchang Zhao
R and Data Mining: Examples and Case Studies Author: Yanchang Zhao Publisher: Academic Press, Elsevier Publish date: December 2012 ISBN: 978-0-12-396963-7 Length: 256 pages URL: http://www.rdatamining.com/books/rdm This book introduces into using R for data mining with examples and case studies.

Re: [R] Regex for ^ (the caret symbol)?

2013-01-22 Thread S Ellison
-Original Message- So what is the special behavior of the ^ symbol when not at the beginning of the string that occurs when it is not escaped? I think it retains its meaning as an assertion that it occurs at the beginning of the line, and so a pattern like a^b could never

[R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread Michael Haenlein
Dear all, I have a discrete distribution showing how age is distributed across a population using a certain set of bands: Age - matrix(c(74045062, 71978405, 122718362, 40489415), ncol=1, dimnames=list(c(18, 18-34, 35-64, 65+),c())) Age_dist - Age/sum(Age) For example I know that 23.94% of all

Re: [R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread Barry Rowlingson
On Tue, Jan 22, 2013 at 11:49 AM, Michael Haenlein haenl...@escpeurope.eu wrote: I would like to find a continuous approximation of this discrete distribution in order to estimate the probability that a person is for example 16 years old. Given that people age continuously (and

Re: [R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread Prof Brian Ripley
On 22/01/2013 11:49, Michael Haenlein wrote: Dear all, I have a discrete distribution showing how age is distributed across a population using a certain set of bands: Age - matrix(c(74045062, 71978405, 122718362, 40489415), ncol=1, dimnames=list(c(18, 18-34, 35-64, 65+),c())) Age_dist -

Re: [R] FactoMineR

2013-01-22 Thread John Fox
Dear Daniel, There were changes to the new version 1.9-3 of the Rcmdr so that it conforms to CRAN policies. These changes can break plug-ins that haven't been modified for compatibility. One change is that the environment in which the Rcmdr stores state information is no longer put on the

Re: [R] FactoMineR

2013-01-22 Thread Dániel Kehl
Dear John, great news, thank you for your kind answer and quick response. I am sure that the author is going to do his best as well. An other good experience why I love R! :) Have a nice day, daniel Feladó: John Fox [j...@mcmaster.ca] Küldve: 2013.

Re: [R] Simple use of dcast (reshape2 package)

2013-01-22 Thread Ista Zahn
Hi, ID is not the value column. Your casting call should be dcast(aa, ... ~ Target, value.var = Eaten) Best, Ista On Tue, Jan 22, 2013 at 4:23 AM, Patrick Connolly p_conno...@slingshot.co.nz wrote: Suppose I have a small dataframe aa Target Eaten ID 50 TPP 0 1 51 TPP

Re: [R] applying a formula from text

2013-01-22 Thread IlyaNovikov
Dear Arun, Thank you very much. Yours, Ilya On Sun, Jan 20, 2013 at 9:18 PM, arun kirshna [via R] ml-node+s789695n4656104...@n4.nabble.com wrote: Dear Ilya, Please check these links. http://stackoverflow.com/questions/4556524/whats-the-way-to-learn-r

[R] How to remove the vertical space between two graps

2013-01-22 Thread Purna chander
Hi, I have created a barplot using the following code. a-c(11,23,15,34,42,31) m-matrix(a,nrow=2) m[2,]-(-1)*m[2,] par(mar=c(4,4,4,0)) barplot(m[2,],horiz=T) par(mar=c(4,0,4,2)) barplot(m[1,],horiz=T,col=black) and the plot obtained is shown in plot1.tiff. I was not willing to see the gap

[R] Erro message in glmmADMB

2013-01-22 Thread peixotop
Hello everybody, I am using glmmADMB and when I run some models, I recieve the following message: Erro em glmmadmb(eumencells ~ 1 + (1 | owners), data = pred3, family = nbinom, : The function maximizer failed (couldn't find STD file) Furthermore: Lost warning messages: Command execution

[R] Remove my adress from mailing list

2013-01-22 Thread M. Maurice
Hello! I wish, that my email-adress is removed from the R-help mailing list. Thanks! [[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

[R] solve equations

2013-01-22 Thread paladini
Hello ! I have a rather mathematical than statistical question. I have a formula: P=R*T/(v-b) -a/(sqrt(T)*V*(V+b)) and I want to solve the equation for V , in terms of V= . Is this possible with R or have I to use another program perhaps octave? thanking you in anticipation Claudia

Re: [R] solve equations

2013-01-22 Thread Berend Hasselman
On 22-01-2013, at 14:20, paladini palad...@beuth-hochschule.de wrote: Hello ! I have a rather mathematical than statistical question. I have a formula: P=R*T/(v-b) -a/(sqrt(T)*V*(V+b)) and I want to solve the equation for V , in terms of V= . Is this possible with R or have I to use

Re: [R] Percentiles with R for a big data.frame

2013-01-22 Thread Simonas Kecorius
Hey Duncan, Neither me do imagine what formula OpenOffice uses for quantiles. I have checked a data string, 24 values, to calculate a quantiles with OpenOffice and R. The result is identical. The problem arises when I try to implement quantile calculation in this form:

Re: [R] Ellipse in PCA with parameters a and bdefined.

2013-01-22 Thread David L Carlson
Try x - mean(PCA$scores[,1]) and y - mean(PCA$scores[,2]) which should be the same as x - 0, y - 0 within rounding error. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original

Re: [R] Approximating discrete distribution by continuous distribution

2013-01-22 Thread peter dalgaard
On Jan 22, 2013, at 13:45 , Prof Brian Ripley wrote: On 22/01/2013 11:49, Michael Haenlein wrote: Dear all, I have a discrete distribution showing how age is distributed across a population using a certain set of bands: Age - matrix(c(74045062, 71978405, 122718362, 40489415), ncol=1,

Re: [R] How to remove the vertical space between two graps

2013-01-22 Thread David L Carlson
Most attachments are automatically stripped from r-help so we cannot see your results. You may be able to get what you want with pyramid.plot in package plotrix by changing the default values (it is designed for population pyramids) or you may be able to get there using the layout() function in

Re: [R] Help with interpolation

2013-01-22 Thread Jessica Streicher
Next time please provide sample data in a form we can easily read in (look at ?dput for example) If i understand this right: yourData-read.table(header=T,text= datedays rate 1996_01_02 155.74590 1996_01_02 505.67332 1996_01_02 785.60888 1996_01_02

Re: [R] Ellipse in PCA with parameters a and bdefined.

2013-01-22 Thread mary
thank you David, it was my first idea, but i don't know if it is right statistically speaking!!! -- View this message in context: http://r.789695.n4.nabble.com/Ellipse-in-PCA-with-parameters-a-and-b-defined-tp4656215p4656274.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Percentiles with R for a big data.frame

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 5:58 AM, Simonas Kecorius wrote: Hey Duncan, Neither me do imagine what formula OpenOffice uses for quantiles. I have checked a data string, 24 values, to calculate a quantiles with OpenOffice and R. The result is identical. The problem arises when I try to implement

Re: [R] A smart way to use $ in data frame

2013-01-22 Thread Yuan, Rebecca
Hello Greg, Thanks very much! This helps! Cheers, Rebecca From: Greg Snow [mailto:538...@gmail.com] Sent: Friday, January 18, 2013 5:17 PM To: Yuan, Rebecca Cc: R help Subject: Re: [R] A smart way to use $ in data frame The important thing to understand is that $ is a shortcut for [[ and you

[R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread Yuan, Rebecca
Hello, I do have two different time series A and B, they are different in length and starting point. A starts in Jan, 2012 and ends in Dec, 2012 and B starts in March, 2012 and ends in Nov, 2012. How can I plot those two series A and B in the same plot? I.E., from Jan. 2012 - Feb, 2012, it

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Yuan, Rebecca Sent: Tuesday, January 22, 2013 4:07 PM To: R help Subject: [R] plot two time series with different length and different starting point in one figure.

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread Yuan, Rebecca
Hello Petr, As the time series have the same column names, I got the error message like: m1-merge(A, B, by.x = time, by.y = balance) Error in fix.by(by.x, x) : 'by' must specify uniquely valid column(s)

Re: [R] Erro message in glmmADMB

2013-01-22 Thread Ben Bolker
peixotop peixotop at leuphana.de writes: I am using glmmADMB and when I run some models, I recieve the following message: Erro em glmmadmb(eumencells ~ 1 + (1 | owners), data = pred3, family = nbinom, : The function maximizer failed (couldn't find STD file) Furthermore: Lost warning

[R] Assistant

2013-01-22 Thread Adelabu Ahmmed
Good-day Sir, I am R.Language users but am try to  estimate parameter of beta distribution particular dataset but give this error, which is not clear to me: (Initial value in vmmin is not finite) beta.fit - fitdistr(data,densfun=dbeta,shape1=value , shape2=value) kindly assist. expecting

Re: [R] Simple use of dcast (reshape2 package)

2013-01-22 Thread arun
Hi, This could be done with ?aggregate() res-aggregate(aa$Eaten,by=list(ID=aa$ID),FUN=function(x) x) res1-data.frame(ID=res[,1],data.frame(res[[2]]))  names(res1)[2:3]-unique(aa$Target)  res1 #  ID TPP GPA #1  1   0   9 #2  2   1  11 #3  3   3   8 #4  4   1   8 #5  5   2  10 A.K. -

Re: [R] Remove my adress from mailing list

2013-01-22 Thread arun
HI, Please check the link: https://stat.ethz.ch/mailman/listinfo/r-help At the end, there is an option to unsubscribe: To unsubscribe from R-help, get a password reminder, or change your subscription options enter your subscription email address: Hope it helps: A.K. -

Re: [R] How to align group based on the common values of two columns in r

2013-01-22 Thread arun
Hi, I am not sure about the logic behind creation of groups, especially, how do you want to assign the group number to a particular combination of Feature and OS. One possible way would be:  dat1$Group-paste(dat1[,1],dat1[,2],sep=) dat1 #  Feature OS Group #1   4  2    42 #2   4  1   

Re: [R] simple reshape

2013-01-22 Thread arun
Hi, You could also do this by: set.seed(15) tr.df-data.frame(ID=rep(1:29,each=3),prep=runif(87,1,3),postp=runif(87,0.5,1.5)) tr.df$time-1:87 res- reshape(tr.df, varying=2:3, v.name=value, times=c(prep,postp),idvar=time,timevar=prepost,direction=long) res-res[order(res$ID,res$time),]  

Re: [R] Assistant

2013-01-22 Thread Jessica Streicher
You're not giving people much to work with. I googled the error, and it seems to come from the call to optim and has likely to do with bad starting parameters. That said, the documentation of fitdistr doesn't suggest it even supports dbeta, there is only a beta mentioned. On 22.01.2013, at

Re: [R] Assistant

2013-01-22 Thread Rui Barradas
Hello, You are calling the function in a wrong way. In the case of a beta fit, densfun should be the quoted string beta and the initial parameter values are elements of a named list. Like this: library(MASS) x - rbeta(1000, shape1 = 2, shape2 = 0.5) fitdistr(x, densfun = beta, start =

[R] c(), rbind and cbind functions - why type of resulting object is double

2013-01-22 Thread Lourdes Peña Castillo
Hello Everyone, I am using R 2.15.0 and I came across this behaviour and I was wondering why I don't get an integer vector or and integer matrix with the following code: z - c(1, 2:0, 3, 4:8) typeof(z) [1] double z - rbind(1, 2:0, 3, 4:8) Warning message: In rbind(1, 2:0, 3, 4:8) :

Re: [R] c(), rbind and cbind functions - why type of resulting object is double

2013-01-22 Thread William Dunlap
I was wondering why I don't get an integer vector or and integer matrix with the following code: z - c(1, 2:0, 3, 4:8) typeof(z) [1] double It is because the literals 1 and 3 have type double. Append L to make them literal integers. typeof(c(1L, 2:0, 3L, 4:8)) [1] integer The colon

Re: [R] c(), rbind and cbind functions - why type of resulting object is double

2013-01-22 Thread Patrick Burns
One place that talks about what Bill says is: http://www.burns-stat.com/documents/tutorials/impatient-r/more-r-key-objects/more-r-numbers/ Pat On 22/01/2013 17:35, William Dunlap wrote: I was wondering why I don't get an integer vector or and integer matrix with the following code: z - c(1,

[R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread Martin Batholdy
Hi, is there any way to change the width of the horizontal line of confidence intervals in the barplot2 function in the plotrix package (independent of the width of the bars)? example code: library(plotrix) # Example with confidence intervals and grid hh - t(VADeaths)[, 1] mybarcol - gray20

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 7:07 AM, Yuan, Rebecca wrote: Hello, I do have two different time series A and B, they are different in length and starting point. A starts in Jan, 2012 and ends in Dec, 2012 and B starts in March, 2012 and ends in Nov, 2012. How can I plot those two series A and B

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread Yuan, Rebecca
Hello Arun, This would help me to get the date type of data. A new question comes out that since the dates are not exactly the same on two date sets, there are some NA values in the merged data set, such as 2012-09-28 NA NA5400726 14861715970 2012-09-30 5035606 14832837436

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread Rolf Turner
There does not appear to be any such function as barplot2 in the current version (3.4-5) of the plotrix package. Moreover I can find no reference to such a function in the NEWS for plotrix. cheers, Rolf Turner On 01/23/2013 07:28 AM, Martin Batholdy wrote: Hi, is there any way

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread Yuan, Rebecca
Hello David, If I use plot with the following code: plot(A, type = o, col = plot_colors[plotcolor], axes = FALSE, ann = FALSE) par(new=TRUE) plot(B, type = o, col = plot_colors[plotcolor+1], axes = FALSE, ann = FALSE) box() I

[R] How to assign time series to a vector with one leap year

2013-01-22 Thread Janesh Devkota
Hello All, I am trying to do the time series analysis in R and I want to assign a vector as a time series. The data I provided is hourly. The data is from Jan 1 2008 to Dec 31 2009. How can I assign the data such that the first year is leap year and second is not ? airtemp -

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 11:42 AM, Yuan, Rebecca wrote: Hello David, If I use plot with the following code: plot(A, type = o, col = plot_colors[plotcolor], axes = FALSE, ann = FALSE) par(new=TRUE) plot(B, type = o, col = plot_colors[plotcolor+1],

[R] Creating a Data Frame from an XML

2013-01-22 Thread Adam Gabbert
Hello, I'm attempting to read information from an XML into a data frame in R using the XML package. I am unable to get the data into a data frame as I would like. I have some sample code below. *XML Code:* Header... Data I want in a data frame: data row BRAND=GMC NUM=1 YEAR=1999

[R] Introduction and help request

2013-01-22 Thread Ross Tinsley
Hello all I am a researcher in the field of tourism and have just recently installed R64 and RStudio onto my Mac (running latest OS). I am ran into some problems installing additional packages. I have looked through the General FAQs and Mac FAQS but haven't been able to find a solution. I

[R] plot.mob() fails with cut() error 'breaks' are not unique

2013-01-22 Thread Jason Musil
DeaR all, I am using mob() for model based partitioning, with a dichotomous variable (participant's correct/incorrect response to a test item) regressed onto a continuous predictor related to a given property of the test item. Although this variable is continuous, the value of this variable

Re: [R] How to align group based on the common values of two columns in r

2013-01-22 Thread arun
Hi, You could also try: dat1-read.table(text=  Feature    OS     4  2     4  1     4  3     1  2     4  1 ,sep=,header=TRUE)  dat1$Group- as.numeric(factor(Reduce(paste0,dat1))) A.K. - Original Message - From: Tammy Ma

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
Hi, dateA-seq.Date(as.Date(1jan2012,format=%d%b%Y),as.Date(31Dec2012,format=%d%b%Y),by=day)   dateB-seq.Date(as.Date(1Mar2012,format=%d%b%Y),as.Date(30Nov2012,format=%d%b%Y),by=day) set.seed(15)  A-data.frame(dateA,value=sample(1:300,366,replace=TRUE))  set.seed(25)  

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
Hi, You could also try this: dateA-seq.Date(as.Date(1jan2012,format=%d%b%Y),as.Date(31Dec2012,format=%d%b%Y),by=day)   dateB-seq.Date(as.Date(1Mar2012,format=%d%b%Y),as.Date(30Nov2012,format=%d%b%Y),by=day) set.seed(15)  A-data.frame(dateA,value=sample(1:300,366,replace=TRUE))  set.seed(25)  

Re: [R] fdHess function

2013-01-22 Thread Douglas Bates
Your question is better addressed to the R-help@R-project.org mailing list, which I am copying on this reply. You are confusing a statistical concept, the Fisher Information matrix, with a numerical concept, the Hessian matrix of a scalar function of a vector argument. The Fisher information

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
Hi Rebecca, Assuming that 'raw_data' is data.frame with first column as raw_time: You could convert the raw_time to date format by  as.Date(28FEB2002,format=%d%B%Y) #[1] 2002-02-28 In your data, it should  be: raw_data$raw_time- as.Date(raw_time,format=%d%B%Y) Could you just dput() a few

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 10:28 AM, Martin Batholdy wrote: Hi, is there any way to change the width of the horizontal line of confidence intervals in the barplot2 function in the plotrix package (independent of the width of the bars)? example code: library(plotrix) # Example with

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread Martin Batholdy
Ok, I have to apologize, I confused the packages. It's the function barplot2 from the gplots package! It calls itself an extenstion of barplot2 and has a ci.lwd argument. Might save you the time of doing what I thought might be needed, hacking te code. Unfortunately ci.lwd controls the

Re: [R] Introduction and help request

2013-01-22 Thread Berend Hasselman
On 22-01-2013, at 19:20, Ross Tinsley rtins...@htmi.ch wrote: Hello all I am a researcher in the field of tourism and have just recently installed R64 and RStudio onto my Mac (running latest OS). I am ran into some problems installing additional packages. I have looked through the

Re: [R] fdHess function

2013-01-22 Thread Mark Leeds
Hi Doug: I was just looking at this coincidentally. When X is a vector, the Fisher Information I_{theta} = the negative expectation of the second derivatives of the log likelihood. So it's a matrix. In other words, I_theta = E(partial^2 /partial theta^2(log(X,theta).) where X is a vector. But,

Re: [R] fdHess function

2013-01-22 Thread Mark Leeds
I neglected to mention that, once you get either I_theta or some empirical estimate of it, you then invert it to get an estimate of the asymptotic covariance matrix of the MLE. On Tue, Jan 22, 2013 at 3:48 PM, Mark Leeds marklee...@gmail.com wrote: Hi Doug: I was just looking at this

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
Hi Rebecca, In the previous email,   res-merge(Anew,Bnew) head(res) #   Anew Bnew #2012-01-01  181   NA #2012-01-02   59   NA #2012-01-03  290   NA #2012-01-04  196   NA #2012-01-05  111   NA #2012-01-06  297   NA   plot.zoo(res) # removes the NA values from Bnew.. (if NA was present in

Re: [R] user units in plotrix

2013-01-22 Thread Greg Snow
If you want to convert between different units using base graphics then look at the grconvertX and grconvertY functions (in the graphics package). These functions will convert from/to user coordinates, inches, device, figure, and plot coordinates. So you could use grconvertX to find out what

Re: [R] how to give a lengend in symbols functions

2013-01-22 Thread Greg Snow
I don't see a symbols function in the gtools package, do you mean the symbols function in the graphics package? If so, there is not a simple legend or key function to create the legend (the number of possible options would make it more complicated than building the legend by hand). You will need

[R] Create a Data Frame from an XML

2013-01-22 Thread Adam Gabbert
Hello, I'm attempting to read information from an XML into a data frame in R using the XML package. I am unable to get the data into a data frame as I would like. I have some sample code below. *XML Code:* Header... Data I want in a data frame: data row BRAND=GMC NUM=1 YEAR=1999

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread David L Carlson
Maybe a fortunate mistake. If you use the base graphics barplot(), you can use plotCI() in plotrix to add the confidence intervals with control over the width of the horizontal ends of the bars (if needed, the defaults are much narrower): out - barplot(hh, beside = TRUE, col = c(lightblue,

Re: [R] change confidence interval line length in barplot2 (plotrix package)

2013-01-22 Thread Marc Schwartz
On Jan 22, 2013, at 2:41 PM, Martin Batholdy batho...@googlemail.com wrote: Ok, I have to apologize, I confused the packages. It's the function barplot2 from the gplots package! It calls itself an extenstion of barplot2 and has a ci.lwd argument. Might save you the time of doing what

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
HI Rebecca, Try this: dateA-seq.Date(as.Date(28JAN2012,format=%d%B%Y),as.Date(28DEC2012,format=%d%B%Y),by=month) dateB-seq.Date(as.Date(30JAN2012,format=%d%B%Y),as.Date(30DEC2012,format=%d%B%Y),by=month) set.seed(15)  A-data.frame(dateA,value=cumsum(sample(1:50,12,replace=TRUE)))  set.seed(25)  

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread Yuan, Rebecca
Hello Arun, Thanks very much! In this way, it works! I convert both A and B to the same day of the month, and therefore there is no NA shown for different last business day and last calendar day of the month. You are very help! Cheers, Rebecca -Original Message- From: arun

[R] tapply and functions with more than one objects

2013-01-22 Thread Dominic Roye
Hello, How i can use a costum function in tapply which has more than one variable? I mean sum(x) only needs one object but what when i have a function function(x,y) with more, how i indicate where are the other variables to use?7 I hope someone can help me. Thank you!! Best regards, Dominic

[R] Adding a line to barchart

2013-01-22 Thread Jonathan Greenberg
R-helpers: I need a quick help with the following graph (I'm a lattice newbie): require(lattice) npp=1:5 names(npp)=c(A,B,C,D,E) barchart(npp,origin=0,box.width=1) # What I want to do, is add a single vertical line positioned at x = 2 that lays over the bars (say, using a dotted line). How do

[R] density of hist(freq = FALSE) inversely affected by data magnitude

2013-01-22 Thread J Toll
Hi, I have a couple of observations, a question or two, and perhaps a suggestion related to the plotting of density on the y-axis within the hist() function when freq=FALSE. I was using the function and trying to develop an intuitive understanding of what the density is telling me. After

Re: [R] plot two time series with different length and different starting point in one figure.

2013-01-22 Thread arun
Hi Rebecca, No problem. Just a doubt regarding the last calendar day and last business day. dateA-seq(as.Date(01FEB2012,format=%d%B%Y),length=15,by=1 month)-1   #gives the last calendar day/month dateB- seq.Date(as.Date(28MAR2012,format=%d%B%Y),as.Date(28DEC2012,format=%d%B%Y),by=month) #here I

[R] summarise subsets of a vector

2013-01-22 Thread Wim Kreinen
Hello, I have vector called test. And now I wish to measure the mean of the first 10 number, the second 10 numbers etc How does it work? Thanks Wim dput (test) c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: [R] How to assign time series to a vector with one leap year

2013-01-22 Thread arun
HI, You can check this link: http://r.789695.n4.nabble.com/leap-years-in-temporal-series-command-ts-td3309014.html Also, this may help you: library(lubridate), ?leap_year()  leap_year(2008) #[1] TRUE  ymd(2008-2-29)  1 parsed with %Y-%m-%d #[1] 2008-02-29 UTC A.K. - Original Message -

Re: [R] tapply and functions with more than one objects

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 2:24 PM, Dominic Roye wrote: Hello, How i can use a costum function in tapply which has more than one variable? I mean sum(x) only needs one object but what when i have a function function(x,y) with more, how i indicate where are the other variables to use?7 You can

Re: [R] density of hist(freq = FALSE) inversely affected by data magnitude

2013-01-22 Thread William Dunlap
The probability density function is not unitless - it is the derivative of the [cumulative] probability distribution function so it has units delta-probability-mass over delta-x. It must integrate to 1 (over the all possible x). hist(freq=FALSE,x) or hist(prob=TRUE,x) displays an estimate of

Re: [R] What is the convergence criterion for binomial logit in glm?

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 2:55 PM, Dimitri Liakhovitski wrote: Dear R-ers, I am running logistics regression using package glm: glm(myDV ~ ., data=mydata, family=binomial(logit)) I have a general question: in glm (binary logit) - what convergence criterion is being used? You should look at

Re: [R] Adding a line to barchart

2013-01-22 Thread arun
Hi, May be this helps:  barchart(npp,origin=0,box.width=1,  panel=function(x,y,...){  panel.barchart(x,y,...)  panel.abline(v=2,col.line=red,lty=3)}) A.K. - Original Message - From: Jonathan Greenberg j...@illinois.edu To: r-help r-help@r-project.org Cc: Sent: Tuesday, January 22,

Re: [R] summarise subsets of a vector

2013-01-22 Thread arun
Hi, try this:  unlist(lapply(split(test,((seq_along(test)-1)%/% 10)+1),mean)) #   1    2    3    4    5    6    7    8 #0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.146375   #     9   10   11 #0.00 0.194500 0.00 A.K. -

Re: [R] What is the convergence criterion for binomial logit in glm?

2013-01-22 Thread Dimitri Liakhovitski
I already looked. This help file for loglin ( http://127.0.0.1:12583/library/stats/html/loglin.html) says: The Iterative Proportional Fitting algorithm as presented in Haberman (1972) is used for fitting the model. At most iter iterations are performed, convergence is taken to occur when the

Re: [R] What is the convergence criterion for binomial logit in glm?

2013-01-22 Thread David Winsemius
On Jan 22, 2013, at 3:59 PM, Dimitri Liakhovitski wrote: I already looked. This help file for loglin (http://127.0.0.1:12583/library/stats/html/loglin.html) says: The Iterative Proportional Fitting algorithm as presented in Haberman (1972) is used for fitting the model. At most iter

[R] How to construct a valid seed for l'Ecuyer's method with given .Random.seed?

2013-01-22 Thread Marius Hofert
Dear expeRts, I struggle with the following problem using snow clusters for parallel computing: I would like to specify l'Ecuyer's random number generator. Base R creates a .Random.seed of length 7, the first value indicating the kind fo random number generator. I would thus like to use the

Re: [R] Create a Data Frame from an XML

2013-01-22 Thread Duncan Temple Lang
Hi Adam [You seem to have sent the same message twice to the mailing list.] There are various strategies/approaches to creating the data frame from the XML. Perhaps the approach that most closely follows your approach is xmlRoot(doc)[ row ] which returns a list of XML nodes whose node

[R] csv mask order

2013-01-22 Thread Todd Sformo
I have imported a CSV file: rfishR - read.csv(file=rfishR.csv,stringsAsFactors = FALSE, strip.white = TRUE, na.strings = c(NA,) ) attach(rfishR) When I call it up in R, it starts with line 2066 rather than 1 and some of the headers (used Headers = TRUE, too) are masked?

Re: [R] density of hist(freq = FALSE) inversely affected by data magnitude

2013-01-22 Thread J Toll
Bill, Thank you. I got it. That can require a fair amount of work to interpret the density, especially with odd or irregular bin sizes. Thanks again, James On Tue, Jan 22, 2013 at 5:33 PM, William Dunlap wdun...@tibco.com wrote: The probability density function is not unitless - it is the

Re: [R] What is the convergence criterion for binomial logit in glm?

2013-01-22 Thread Dimitri Liakhovitski
Thanks a lot, David. Yes, now I see it - it's 1e-8 Dimitri On Tue, Jan 22, 2013 at 7:08 PM, David Winsemius dwinsem...@comcast.netwrote: glm.control -- Dimitri Liakhovitski gfk.com http://marketfusionanalytics.com/ [[alternative HTML version deleted]]

Re: [R] Creating a Data Frame from an XML

2013-01-22 Thread Ben Tupper
On Jan 22, 2013, at 3:11 PM, Adam Gabbert wrote: Hello, I'm attempting to read information from an XML into a data frame in R using the XML package. I am unable to get the data into a data frame as I would like. I have some sample code below. *XML Code:* Header... Data I want in

Re: [R] csv mask order

2013-01-22 Thread Peter Langfelder
Do your lines start with the hash mark #? If so, they are considered comment. Set comment.char= in your call to read.csv. Another frequent culprit (personal experience) are apostrophes ('). If you have any in your file, use the argument quote = \ or, if you are sure the data are not quoted, use

Re: [R] Creating a Data Frame from an XML

2013-01-22 Thread Gabor Grothendieck
On Tue, Jan 22, 2013 at 3:11 PM, Adam Gabbert adamjgabb...@gmail.com wrote: Hello, I'm attempting to read information from an XML into a data frame in R using the XML package. I am unable to get the data into a data frame as I would like. I have some sample code below. *XML Code:*

Re: [R] user units in plotrix

2013-01-22 Thread Murat Tasan
oo, sounds like exactly what i want! thanks! -m On Tue, Jan 22, 2013 at 4:13 PM, Greg Snow 538...@gmail.com wrote: If you want to convert between different units using base graphics then look at the grconvertX and grconvertY functions (in the graphics package). These functions will

Re: [R] Adding a line to barchart

2013-01-22 Thread PIKAL Petr
Hi This function adds line to each panel addLine - function (a = NULL, b = NULL, v = NULL, h = NULL, ..., once = F) { tcL - trellis.currentLayout() k - 0 for (i in 1:nrow(tcL)) for (j in 1:ncol(tcL)) if (tcL[i, j] 0) { k - k + 1 trellis.focus(panel, j, i,

  1   2   >