[R] Works on Mac, but not Windows: Using tempdir() to determine image location works with .tex file

2015-10-31 Thread Green Stone
I am writing an R package that generates a .pdf file for users that outputs summarizations of data. I have a .Rnw script in the package (here, my MWE of it is called test.Rnw). The user can do: knit2pdf("test.Rnw", clean=T) This makes the process easy for them, because it automatically creates th

Re: [R] [FORGED] Re: If else

2015-10-31 Thread Val
Hi All, I am sorry for the confusion and yes I understand this due to limited knowledge of R. I am working on that. Thank you again. On Sat, Oct 31, 2015 at 7:06 PM, Rolf Turner wrote: > > Jim: I'm sure that this is much more sophisticated than anything that the > OP ever dreamed of deal

Re: [R] [FORGED] Re: If else

2015-10-31 Thread Rolf Turner
Jim: I'm sure that this is much more sophisticated than anything that the OP ever dreamed of dealing with. And irrespective of that, the issue is not about there being more than two sexes in some contexts but rather of the folly of treating categorical data as numeric. Moreover your "neithe

Re: [R] If else

2015-10-31 Thread Rolf Turner
Ted: You are either being deliberately obtuse or playing Devil's advocate or just stirring. It is clear from his/her posts that the OP has limited understanding of both R and statistics. Your sophisticated philosophising about the possibility of "three sexes" is very unlikely to have anyth

Re: [R] If else

2015-10-31 Thread Jim Lemon
Having had to face this problem myself more than once, I sympathize with Ted's argument. First let me confess that I regard sex as a measure of the reproductive phenotype. Given the ongoing experimentation with both sex and gender, I have had to add "U" (Unstated - includes all those acronyms that

Re: [R] If else

2015-10-31 Thread Duncan Murdoch
On 31/10/2015 3:47 PM, (Ted Harding) wrote: > [Apologies if the message below should arrive twice. When first > sent there was apparently something wrong with the email address > to r-help, and it was held for moderation because "Message has > implicit destination" (whatever that means). I have mad

Re: [R] If else

2015-10-31 Thread Val
Thank you very much Ted for expressing my feeling!. I am working on field data and the sex of an individual is not recorded sometimes and hence and I give it a category of NA. Thank you all for the help. On Sat, Oct 31, 2015 at 2:47 PM, Ted Harding wrote: > [Apologies if the message belo

Re: [R] If else

2015-10-31 Thread Ted Harding
[Apologies if the message below should arrive twice. When first sent there was apparently something wrong with the email address to r-help, and it was held for moderation because "Message has implicit destination" (whatever that means). I have made sure that this time the email address is correct.]

Re: [R] ASR tree with highlighted state-changes

2015-10-31 Thread Jeff Newmiller
Have you read [1]? Plotting usually comes after analysis, so if you haven't pulled your data into R yet then there may yet be a huge number of possible ways to proceed. You should probably also read the Posting Guide mentioned at the bottom of every email on this list. In particular, sending yo

Re: [R] Vector of symbols?

2015-10-31 Thread Boris Steipe
You are describing an awkward way of doing this (and your example is unreadable because you are not following posting instructions for the list) ... but the following contains the essence of what I think is needed: parse() and eval(). v <- character() v[1] <- sprintf("%d ^ %s", 2, "duck") v[2]

Re: [R] Vector of symbols?

2015-10-31 Thread Jeff Newmiller
I believe it is possible, but R is not really a full-fledged symbolic algebra system so it wouldn't be an intuitive tool to use and what would you do with it once you had it? It is much more useful in R to do something like f1 <- function( M, A, B, C ) { M %*% c( A, B, C ) } m <- matrix( c(

Re: [R] If else

2015-10-31 Thread Jeff Newmiller
Rolf gave you two ways. There are others. They all misrepresent the data (there are only two sexes but you are effectively acting as if there are three); hence the inquisition in hopes of diverting you to a more correct method of analysis. However, this is not the support forum for whatever othe

Re: [R] How to calculate the shared area of 2 plots?

2015-10-31 Thread Viechtbauer Wolfgang (STAT)
Something like this? http://stats.stackexchange.com/questions/12209/percentage-of-overlapping-regions-of-two-normal-distributions Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD Ma

Re: [R] If else

2015-10-31 Thread Val
Hi Jeff, I thought I answered. Yes I was not clear about it. The further analysis will no be done by R. It is another software that will not accept a character response variable. Why R is so complicated to do that. If it is SAS then I can do it on one statement. . On Sat, Oct 31, 2015 at 11

Re: [R] If else

2015-10-31 Thread Jeff Newmiller
You haven't actually answered John's question as to the type of analysis you plan to do. It still looks from here like you should be using factor data rather than numeric, but since you are not being clear we cannot give specifics as to how to proceed. ---

[R] Vector of symbols?

2015-10-31 Thread Judson
Is there a way to multiply a matrix times a vector of symbols? For instance, could I do this: 1 0 0 a 01 0 times b -1 2 1 c which should result in :

[R] ASR tree with highlighted state-changes

2015-10-31 Thread Richard Harris
Sent from Windows Mail Hi, I am looking for possible code (if any code exists) for creating a tree/ graphical representation of ancestral state reconstruction that clearly highlights state-changes or where state changes are estimated? I am using binary for my trait distinctions.

[R] How to calculate the shared area of 2 plots?

2015-10-31 Thread Jackson Rodrigues
Dear all, I have 2 data sets (A and B) with normal distributions. When I plot them together, they overlay/share one part of plot. I want to extract from each A and B that shared area. Actually I want to sum A+B and then to compare the result with the individual shared area of A and B to know how m

Re: [R] If else

2015-10-31 Thread Val
Hi All, Yes I need to change to numeric because I am preparing a data set for further analysis. The variable to be changed from character to numeric (in this case, sex) will be a response variable. Some records have missing observation on sex and it is blank. id sex 1 2

Re: [R] Nested ANOVA yields surprising results

2015-10-31 Thread peter dalgaard
> On 30 Oct 2015, at 18:46 , Daniel Wagenaar wrote: > > Dear R users: > > All textbook references that I consult say that in a nested ANOVA (e.g., > A/B), the F statistic for factor A should be calculated as > > F_A = MS_A / MS_(B within A). > That would depend on which hypothesis you test

Re: [R] If else

2015-10-31 Thread John Kane
In line. John Kane Kingston ON Canada > -Original Message- > From: valkr...@gmail.com > Sent: Fri, 30 Oct 2015 20:40:03 -0500 > To: istaz...@gmail.com > Subject: Re: [R] If else > > I am trying to change the mydata$sex from character to numeric Why? As Ista (mydata$confusingWillCaus

Re: [R] How to add legend to 2 different data frame overplot?

2015-10-31 Thread Jeff Newmiller
Remove show_guide = FALSE? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playi

Re: [R] How to add legend to 2 different data frame overplot?

2015-10-31 Thread Jim Lemon
Hi C W, I would guess you are trying to use the base graphics "legend" function. Have you tried one of the scale_* functions in ggplot? Jim On Sat, Oct 31, 2015 at 3:10 PM, C W wrote: > Hi, > > I am trying to do add a legend to an overplot, something like this: > > ggplot() + > geom_densit