Re: [R] Checking if a matrix exists/is defined

2014-10-19 Thread Steven Yen
Thank you Rich. It works like a charm! Earlier I worked around by judging its determinant: dd<-NULL if (invH) dd<-det(obj$hessian) if (invH & exists("dd")){ ... } Now I do if (!is.null(obj$hessian) & invH){ ... } which is more direct. Thanks again. Steven At 01:50 AM 10/19/2014, Richard M.

[R] Plotting sum rather than count in hexbin

2014-10-19 Thread Camilo Mora
Hi everyone, This may be a trivial solution but I would appreciate any help. I have a database with three variables. I would like to plot the first two variables in a xy plot making the color of points proportional to the values in the third variable. Given that many points overlap, I decided

Re: [R] Sum of two consecutive number in dataset.

2014-10-19 Thread Frederic Ntirenganya
Dear All, Thanks for the useful ideas. This is how I solved the problem and it works well. sowdays=function(data,Year){ Year = unique(data$Year) #gives you sum of rain in 2 consecutive days twodays <- rowSu

Re: [R] ggplot: Stacked bar/pie chart - Objects above the bar/pie

2014-10-19 Thread Jim Lemon
On Fri, 17 Oct 2014 12:52:04 PM Gunnar Oehmichen wrote: > Hello, > > I would like to draw a circle on top of a pie chart (The plot does not > need to fullfill scientific standards). The circle represents the > relation of a reference-value in comparison to the summed values of the > pie-pieces. T

Re: [R] Plotting sum rather than count in hexbin

2014-10-19 Thread Jim Lemon
On Sun, 19 Oct 2014 08:09:28 AM Camilo Mora wrote: > Hi everyone, > > This may be a trivial solution but I would appreciate any help. > > I have a database with three variables. I would like to plot the first two > variables in a xy plot making the color of points proportional to the > values in

[R] Trace of product of matrices

2014-10-19 Thread Wagner Bonat
Dear, I have to compute the trace of a product between four matrices. For example, I know the matrices Wi, Wj and C, I need to compute this -trace(Wi%*%C^-1%*%Wj%*%C^-1) I would like to avoid compute the complete matrix and after take the diagonal, something like sum(diag( solve(Wi,C)%*% solve

Re: [R] Trace of product of matrices

2014-10-19 Thread peter dalgaard
> On 19 Oct 2014, at 16:43 , Wagner Bonat wrote: > > Dear, > > I have to compute the trace of a product between four matrices. For > example, I know the matrices Wi, Wj and C, I need to compute this > > -trace(Wi%*%C^-1%*%Wj%*%C^-1) > > > I would like to avoid compute the complete matrix and

Re: [R] Trace of product of matrices

2014-10-19 Thread Spencer Graves
On 10/19/2014 8:42 AM, peter dalgaard wrote: On 19 Oct 2014, at 16:43 , Wagner Bonat wrote: Dear, I have to compute the trace of a product between four matrices. For example, I know the matrices Wi, Wj and C, I need to compute this -trace(Wi%*%C^-1%*%Wj%*%C^-1) I would like to avoid compute

Re: [R] Trace of product of matrices

2014-10-19 Thread Spencer Graves
On 10/19/2014 8:42 AM, peter dalgaard wrote: On 19 Oct 2014, at 16:43 , Wagner Bonat wrote: Dear, I have to compute the trace of a product between four matrices. For example, I know the matrices Wi, Wj and C, I need to compute this -trace(Wi%*%C^-1%*%Wj%*%C^-1) I would like to avoid compute

Re: [R] seqinr ?: Splitting a factor name into several columns. Dealing with metabarcoding data.

2014-10-19 Thread Anna Zakrisson Braeunlich
Hi Jeff an many thank's for your time. I meant that it was easy as in not requiring som many steps... I have managed to get it to run and it has solved my problem perfectly. Thank you for all your tips and instructions! Up until now, I have used excel for all problems similar to this one and on

Re: [R] how to overwrite a Unary operator ?

2014-10-19 Thread PO SU
TKS , but i still have a question that maybe i can write a new S3 method for +, but how can i create a new operator which can pass one param? becasue + is far away from ++ to let me know that 2 will be 3. So, it's still a question.. -- PO SU mail: desolato...@163.com Majored in Statisti

Re: [R] how to overwrite a Unary operator ?

2014-10-19 Thread PO SU
It's a good way to use RF OOS, but it's not my needing, actually, i want is there exists a way to write a  %++% form function that can pass one param to it? So i can use  1%++%  to get 2 ,a<-2 , a%++% to get a<-3 . It seems that the operator overwrite system in R, must pass two params. Is it tru

Re: [R] Plotting sum rather than count in hexbin

2014-10-19 Thread Camilo Mora
Thanks Jim, Sorry for the confusion. Is there a way to plot the hexbin using the colors generated based on the sums of the values of the points at each hexbin? My problem is not so much about the use of a color scale as it is for Hexbin to display the sum of the bins rather than the count. Tha

Re: [R] Trace of product of matrices

2014-10-19 Thread peter dalgaard
> On 19 Oct 2014, at 19:00 , Spencer Graves > wrote: > > On 10/19/2014 8:42 AM, peter dalgaard wrote: >>> On 19 Oct 2014, at 16:43 , Wagner Bonat wrote: >>> >>> Dear, >>> >>> I have to compute the trace of a product between four matrices. For >>> example, I know the matrices Wi, Wj and C, I

[R] distance from fitted line

2014-10-19 Thread eliza botto
Dear useRs, I have the following dataset. > dput(EB) c(77.724, 76.708, 84.836, 85.09, 118.11, 65.024, 121.412, 63.5, 102.87, 81.3, 108.7, 110.7, 71.9, 42.2, 101, 151.4, 94, 112, 48, 73.4, 76.6, 62.2, 59.4, 114.3, 214.3, 110.5, 46, 84.7, 128.1, 45.2, 109.5, 102.3, 77.5, 61, 97.3, 78, 142, 88.2, 5

Re: [R] Plotting sum rather than count in hexbin

2014-10-19 Thread Camilo Mora
I figure out a way to display the hexbins color coded proportional to a third attribute of the points falling on a given hexbin. I share it for future reference or in case anyone has a way to improve it. Cheers C library(plotrix) library(hexbin) #creates a

[R] CRAN (and crantastic) updates this week

2014-10-19 Thread Crantastic
CRAN (and crantastic) updates this week New packages * bio3d (2.1-1) Maintainer: Barry Grant Author(s): Barry Grant, Xin-Qiu Yao, Lars Skjaerven, Julien Ide License: GPL (>= 2) http://crantastic.org/packages/bio3d Utilities to process, organize and explore protein structur

[R] How to read tif format file?

2014-10-19 Thread PO SU
Dear expeRts,    I want to read a  a.tif file into  R.  When i  try this: readGDAL("a.tif"), i get the following error: a.tif has GDAL driver GTiff  and has 7200 rows and 7200 columns error: can't allocate 395.5 mb vector but i can GDAL.open("a.tif") it. SO what's wrong with readGDAL? --

[R] HOW to call R code from matlab?

2014-10-19 Thread PO SU
Dear expeRts,    I am fammilar with matlab , i want to call some r codes from it , what can i refer?  I tried R.matlab. But it seems can't work well. so, do you have any other suggestions? -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU _

Re: [R] HOW to call R code from matlab?

2014-10-19 Thread Henrik Bengtsson
On Oct 19, 2014 7:33 PM, "PO SU" wrote: > > > > Dear expeRts, >I am fammilar with matlab , i want to call some r codes from it , what can i refer? > I tried R.matlab. But it seems can't work well. Correct, R.matlab can only be used to call MATLAB from R, but not the other way around. I'll l

Re: [R] How to read tif format file?

2014-10-19 Thread Michael Sumner
What's wrong is that readGDAL tries to allocate all the memory required and build an object to essentially replace the file, and your machine cannot provide sufficient resources for that. GDAL.open provides an open connnection to the file that can be queried in different ways to read parts of the f

[R] pasteFromExcel

2014-10-19 Thread Dan Murphy
To Users of Excel: Following advice from Brian and Markus, I created an RMarkdown "vignette" that shows an example of how the pasteFromExcel function in the excelRio package on github could be used by an actuary to transfer a triangle from Excel to R. See today's post at http://trinostics.blogspot

[R] 2 missing observation of LSD analysis in R

2014-10-19 Thread Jomy Jose
How to deal with the analysis of 2 missing observations in case of Latin square design [[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 http:/