Re: [R] about fitting a regression line

2017-06-14 Thread PIKAL Petr
Hi But X can be some function like - sin, cos, log, exp... Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of lily li > Sent: Thursday, June 15, 2017 1:28 AM > To: MacQueen, Don > Cc: R mailing list > Subject: Re: [R] about fitting a regr

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Rolf Turner
On 15/06/17 13:51, David Winsemius wrote: On Jun 14, 2017, at 5:52 PM, Jeff Newmiller wrote: Sigh. I never load packages in .Rprofile to avoid the irreproducibility trap. Might seem drastic to some, but I don't feel much pain because I almost always edit my code in a file rather than on the

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread David Winsemius
> On Jun 14, 2017, at 5:52 PM, Jeff Newmiller wrote: > > Sigh. I never load packages in .Rprofile to avoid the irreproducibility trap. > Might seem drastic to some, but I don't feel much pain because I almost > always edit my code in a file rather than on the fly at the console, and > re-run

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Jeff Newmiller
Sigh. I never load packages in .Rprofile to avoid the irreproducibility trap. Might seem drastic to some, but I don't feel much pain because I almost always edit my code in a file rather than on the fly at the console, and re-run it frequently from a fresh R process to check my progress. -- Se

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Rolf Turner
On 15/06/17 10:27, David Winsemius wrote: On Jun 14, 2017, at 1:53 PM, Rolf Turner wrote: Why does this (apparently) not happen to anyone else? Why does the universe pick on *me*? What is the function "alpha()"? Where is it to be found? I discovered some time ago that I no longer nee

Re: [R] [FORGED] Re: about fitting a regression line

2017-06-14 Thread Rolf Turner
On 15/06/17 11:28, lily li wrote: Thanks. I thought lm() function is for linear model, such as the correlation below: Y= aX + b On Wed, Jun 14, 2017 at 5:25 PM, MacQueen, Don wrote: Start with the lm() function; i.e., see ?lm And you don't think that Y = a*cos(X) + b is a linear model?

Re: [R] [FORGED] about fitting a regression line

2017-06-14 Thread Rolf Turner
On 15/06/17 10:40, lily li wrote: Hi R users, I have some data points (Xi, Yi), and they may follow such a pattern Yi = cCOS(Xi) + d, how to find the c and d in R? which function to use? Also, how to get the R2 and p value for this correlation? Thanks for any kind of help. If I understand you

Re: [R] about fitting a regression line

2017-06-14 Thread lily li
Thanks. I thought lm() function is for linear model, such as the correlation below: Y= aX + b On Wed, Jun 14, 2017 at 5:25 PM, MacQueen, Don wrote: > Start with the lm() function; i.e., see > > ?lm > > -Don > > -- > Don MacQueen > > Lawrence Livermore National Laboratory > 7000 East Ave., L-62

Re: [R] about fitting a regression line

2017-06-14 Thread MacQueen, Don
Start with the lm() function; i.e., see ?lm -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 6/14/17, 3:40 PM, "R-help on behalf of lily li" wrote: Hi R users, I have some data points (Xi, Yi), and they ma

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Jeff Newmiller
Package 'scales' has the alpha function... associated with ggplot2. A bit out of place here if that is the origin. Yes, we are squarely in non-reproducible example territory, also known as the Twilight Zone. -- Sent from my phone. Please excuse my brevity. On June 14, 2017 1:53:21 PM PDT, Rolf

[R] about fitting a regression line

2017-06-14 Thread lily li
Hi R users, I have some data points (Xi, Yi), and they may follow such a pattern Yi = cCOS(Xi) + d, how to find the c and d in R? which function to use? Also, how to get the R2 and p value for this correlation? Thanks for any kind of help. [[alternative HTML version deleted]] ___

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread David Winsemius
> On Jun 14, 2017, at 1:53 PM, Rolf Turner wrote: > > On 15/06/17 05:29, David Winsemius wrote: >>> On Jun 14, 2017, at 10:18 AM, David Winsemius >>> wrote: >>> >>> On Jun 14, 2017, at 9:46 AM, Jeff Newmiller wrote: I don't see a question. If your question is whether R

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Jim Lemon
Hi Jean-Phillipe, Thanks for the plug on plotrix. Because of that I will suggest a gross hack that will do almost what you want: # your code down to draw.circle segments(c(-12.7,-12.7),c(-11.2,-10.6),c(-12,-12), c(-10.75,-10.15),col="white",lwd=28) draw.circle(-12.85,-10.9,0.85,nv=1000,border=NUL

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread jeanphilippe.fontaine
Envoyé depuis mon appareil Samsung Message d'origine De : Rolf Turner Date : 14/06/2017 22:53 (GMT+01:00) À : David Winsemius Cc : r-help@r-project.org Objet : Re: [R] [FORGED] Re:  draw stripes in a circle in R On 15/06/17 05:29, David Winsemius wrote: > >>

Re: [R] [FORGED] Re: draw stripes in a circle in R

2017-06-14 Thread Rolf Turner
On 15/06/17 05:29, David Winsemius wrote: On Jun 14, 2017, at 10:18 AM, David Winsemius wrote: On Jun 14, 2017, at 9:46 AM, Jeff Newmiller wrote: I don't see a question. If your question is whether R supports pattern fills, AFAIK it does not. If that is not your question, ask one. -- Sen

Re: [R] reading data

2017-06-14 Thread Ashta
Hi Jim, With a little dig on my side , I have found the issue as to why the script is skipping that file. The file is "ISO-8859 text, with CRLF line terminators" The file should be ASCII and I changed using dos2unix and CRLF line terminators is eliminated but still I am not reading it. How can

Re: [R] draw stripes in a circle in R

2017-06-14 Thread David Winsemius
> On Jun 14, 2017, at 10:18 AM, David Winsemius wrote: > > >> On Jun 14, 2017, at 9:46 AM, Jeff Newmiller wrote: >> >> I don't see a question. If your question is whether R supports pattern >> fills, AFAIK it does not. If that is not your question, ask one. >> -- >> Sent from my phone. Ple

Re: [R] draw stripes in a circle in R

2017-06-14 Thread David Winsemius
> On Jun 14, 2017, at 9:46 AM, Jeff Newmiller wrote: > > I don't see a question. If your question is whether R supports pattern fills, > AFAIK it does not. If that is not your question, ask one. > -- > Sent from my phone. Please excuse my brevity. > > On June 14, 2017 7:57:41 AM PDT, jean-ph

Re: [R] draw stripes in a circle in R

2017-06-14 Thread jeanphilippe.fontaine
Sorry for that. Yes my question was whether or not and how is it possible to fill a circle of yellow stripes in R? Is it something that I have to precise in the color argument? Thanks, best Envoyé depuis mon appareil Samsung Message d'origine De : Jeff Newmiller Date

Re: [R] draw stripes in a circle in R

2017-06-14 Thread Jeff Newmiller
I don't see a question. If your question is whether R supports pattern fills, AFAIK it does not. If that is not your question, ask one. -- Sent from my phone. Please excuse my brevity. On June 14, 2017 7:57:41 AM PDT, jean-philippe wrote: >dear R users, > >I would like to fill a circle with y

[R] draw stripes in a circle in R

2017-06-14 Thread jean-philippe
dear R users, I would like to fill a circle with yellow stripes instead of a uniform yellow color. To draw the circle I used the following command after having loaded the (very nice !) plotrix library : library(plotrix) pdf("MWE.pdf",width=8, height=8) plot(seq(-12.5,-8.7,length.out=100),seq(

Re: [R] Plot MArginal distribution in the correct place

2017-06-14 Thread Pedro páramo
Please can you send me some orientation? Many thanks in advance. Only if posible one book o similar example to understand why it is not what I try. El 8 jun. 2017 7:50 PM, "Pedro páramo" escribió: > Many thanks Jim. > > What I,m trying to show with the fhist plot is the empirical distribution

Re: [R] Plot MArginal distribution in the correct place

2017-06-14 Thread Jim Lemon
Hi Pedro, If you keep that same margins for the second plot: par(mar=c(10,0,6,6)) barplot(fhist$counts,axes=FALSE, space=0,horiz=TRUE,col="lightgray") it looks reasonably well aligned to me. Because you are plotting the counts of the values in Simulation, the ordinate (vertical axis) of the bar p