Hello All I want to convert a scatter plot to a continuous contour plot. I have "x" as a variable and "y" as another variable. is there any package for this? can anybody halp me? Thanks -------------------------------------------- On Sun, 2/23/14, r-help-request at r-project.org <r-help-request at r-project.org> wrote: Subject: R-help Digest, Vol 132, Issue 23 To: r-help at r-project.org Date: Sunday, February 23, 2014, 3:00 AM Send R-help mailing list submissions to ??? r-help at r-project.org To subscribe or unsubscribe via the World Wide Web, visit ??? https://stat.ethz.ch/mailman/listinfo/r-help or, via email, send a message with subject or body 'help' to ??? r-help-request at r-project.org You can reach the person managing the list at ??? r-help-owner at r-project.org When replying, please edit your Subject line so it is more specific than "Re: Contents of R-help digest..." Today's Topics: ???1. Math symbols in ggplot facets (Lars Bishop) ???2. Re: dependent column(s) in data frame (PQuery) ???3. Exposures in bernoulli glm() (Marco Inacio) ???4. Learn R in a Day - new ebook (Steve Murray) ???5. Hi everybody, your help would be very [[elided Yahoo spam]] ? ? ? (varin sacha) ???6. hist: argument '...' is not made use of (Jennifer Lyon) ???7. create video? (Spencer Graves) ???8. Re: how to plot a logarithmic regression line (arun) ???9. Re: dependent column(s) in data frame (David Winsemius) ? 10. Re: how to plot a logarithmic regression line (David Winsemius) ? 11. Re: Math symbols in ggplot facets (Dennis Murphy) ? 12. equivalent of $\check Y$ in plotmath (Ranjan Maitra) ? 13. seeking alternative method to copy a large section of my R ? ? ? program (Julie Royster) ? 14. Re: seeking alternative method to copy a large section of my ? ? ? R??? program (Jeff Newmiller) ? 15. Re: seeking alternative method to copy a large section of my ? ? ? R??? program (David Winsemius) ---------------------------------------------------------------------- Message: 1 Date: Sat, 22 Feb 2014 12:24:13 +0100 From: Lars Bishop <lars52r at gmail.com> To: "r-help at r-project.org" <r-help at r-project.org> Subject: [R] Math symbols in ggplot facets Message-ID: ??? <CAO7OmOiLa2Obmgz3MtQCsgV8QZHGhr52WkUeQwq7qohNbp7AcA at mail.gmail.com> Content-Type: text/plain Hello, I would like to show in my facet labels the equivalent in LaTex of $\sigma_{0}= \sqrt{2}$. I think I'm close below, but not yet as it shows $(\sigma_{0}, \sqrt{2})$ m <- mpg levels(m$drv) <- c("sigma[0]=sqrt(2)", "sigma[0]=2 * sqrt(2)", "sigma[0]= 3 * sqrt(2)") ggplot(m, aes(x = displ, y = cty)) + geom_point() + ? facet_grid(. ~ drv, labeller = label_parsed) Thanks, Lars. ??? [[alternative HTML version deleted]] ------------------------------ Message: 2 Date: Sat, 22 Feb 2014 04:28:03 -0800 (PST) From: PQuery <pierre.khoueiry at embl.de> To: r-help at r-project.org Subject: Re: [R] dependent column(s) in data frame Message-ID: <1393072083649-4685684.post at n4.nabble.com> Content-Type: text/plain; charset=us-ascii Many thanks David, I will have a look on logistic regression for my case. Do you know about a good example regarding logistic regression ? I was thinking also of using Multiple Factor Analysis too (MFA - like in FactoMineR). However I am not sure how successful this is going to be. Best, P. -- View this message in context: http://r.789695.n4.nabble.com/dependent-column-s-in-data-frame-tp4685561p4685684.html Sent from the R help mailing list archive at Nabble.com. ------------------------------ Message: 3 Date: Sat, 22 Feb 2014 11:29:56 -0300 From: Marco Inacio <marcoigarapava at gmail.com> To: R help <r-help at r-project.org> Subject: [R] Exposures in bernoulli glm() Message-ID: <5308B464.7010305 at gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, is it possible to add exposures to a glm with family=binomial()? It's easy to do it for a Poisson/negative binomial: just multiply the mean by the exposure, that is, offset(log(exposure)): but this obviously wrong for a binomial/Bernoulli since the mean must be no bigger than 1. My goal was do it it with pscl::zeroinfl and pscl::hurdle, but answering for binomial/Bernoulli would already help. ------------------------------ Message: 4 Date: Sat, 22 Feb 2014 15:48:44 +0000 From: Steve Murray <smurray444 at hotmail.com> To: "r-help at r-project.org" <r-help at r-project.org> Subject: [R] Learn R in a Day - new ebook Message-ID: <DUB115-W46569916EEC0D272530CBD88840 at phx.gbl> Content-Type: text/plain Dear all, I'd like to make you aware of my new ebook - Learn R in a Day - which provides the reader with key programming skills through an examples-oriented approach and is ideally suited for academics, scientists, mathematicians and engineers. Amazon.com: http://www.amazon.com/Learn-R-Day-Steven-Murray-ebook/dp/B00GC2LKOK/ref=sr_1_1?s=digital-text&ie=UTF8&qid=1393005750&sr=1-1&keywords=learn+r+in+a+day Amazon UK: http://www.amazon.co.uk/Learn-R-Day-Steven-Murray-ebook/dp/B00GC2LKOK The book assumes no prior knowledge of computer programming and progressively covers all the essential steps needed to become confident and proficient in using R within a day. Topics include how to input, manipulate, format, iterate (loop), query, perform basic statistics on, and plot data, via a step-by-step technique and demonstrations using in-built datasets which the reader is encouraged to replicate on their computer. Each chapter also includes exercises (with solutions) to practice key skills and empower the reader to build on the essentials gained during this introductory course. Steve Murray ? ??? ???????? ?????? ??? ? ??? [[alternative HTML version deleted]] ------------------------------ Message: 5 Date: Sat, 22 Feb 2014 16:14:01 +0000 (GMT) From: varin sacha <varinsacha at yahoo.fr> To: "r-help at r-project.org" <r-help at r-project.org> Subject: [R] Hi everybody, your help would be very appreciate, thanks ??? ! Message-ID: ??? <1393085641.78161.YahooMailNeo at web171304.mail.ir2.yahoo.com> Content-Type: text/plain Hi everybody, I have realized a multiple linear regression.? To know how well my model does in terms of prediction, I can compute prediction intervals bands and decide if they are narrow enough to be of use. If they are too wide, then they probably are not useful. Using R, I have written these R codes. LinearModel.1 <- lm(GDP.per.head ~ Competitivness.score + Quality.score,? ? data=Dataset) summary(LinearModel.1) predict(LinearModel.1, se.fit = FALSE, scale = NULL, df Inf,interval = c("none", "confidence", "prediction"),level 0.95, type = c("response", "terms"),terms = NULL) Now, I am trying to draw?one graph / plot,?where I can have?the straight regression line?and?the prediction interval bands?in?the same graph / plot to see if the bands are narrow enough to be of use. Could you please help me with my R codes ? Thanks for your precious help, ??? [[alternative HTML version deleted]] ------------------------------ Message: 6 Date: Sat, 22 Feb 2014 12:06:06 -0700 From: Jennifer Lyon <jennifer.s.lyon at gmail.com> To: r-help at r-project.org Subject: [R] hist: argument '...' is not made use of Message-ID: ??? <CAKstpn6+BPbx=5GQm3BvsUW9SsosF3TH0qw9CNgdzspgMa=X2g at mail.gmail.com> Content-Type: text/plain Hi: When converting some code to use plot = F in a call to hist(), I received the following warning (with a much simplified example). moo<-1:10 hist(moo, las=1, plot=F) Warning message: In hist.default(moo, las = 1, plot = F) : argument '...' is not made use of >From the help page, I was able to figure out that it was the las=1 argument, which is not needed with plot = F that was my issue. My question is whether this was the intended warning (instead of mentioning las = 1 explicitly, which might be hard to implement) and if so if there might be some more direct way to figure out what was wrong from say args(hist), since I initially thought I'd in some way unintentionally passed ... as an argument? sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8? ? ???LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8? ? ? ? LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8? ? LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8? ? ???LC_NAME=C [9] LC_ADDRESS=C? ? ? ? ? ? ???LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats? ???graphics? grDevices utils? ???datasets? methods???base Thanks! Jen ??? [[alternative HTML version deleted]] ------------------------------ Message: 7 Date: Sat, 22 Feb 2014 11:25:03 -0800 From: Spencer Graves <spencer.graves at structuremonitoring.com> To: R list <R-help at r-project.org> Subject: [R] create video? Message-ID: <5308F98F.6050601 at structuremonitoring.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello: ? ? ???Might someone have experience with video production?? The "animation" package in R can produce video clips.? These could presumably be merged and synced with audio using something like Avidemux.? I have not done this, but it looks like it might be a relatively easy way for an R user to create a video from audio and slides. ? ? ???I'd like something that would give me more control than screencasting.? For this, I'm thinking of recording the audio, then measuring each phrase with something like Audacity.? I'd then use that with R and Avidemux as outlined above. ? ? ???Can anyone suggest something different or provide details on ways to make this easy? ? ? ???Thanks, ? ? ???Spencer Graves ------------------------------ Message: 8 Date: Sat, 22 Feb 2014 13:06:52 -0800 (PST) To: "R. Help" <r-help at r-project.org> Subject: Re: [R] how to plot a logarithmic regression line Message-ID: ??? <1393103212.42547.YahooMailNeo at web142603.mail.bf1.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 HI, Try ?curve fit <- lm(Mean_Percent_of_Range~log(No.ofPoints)) ?coef(fit) ?# ?? (Intercept) log(No.ofPoints) ? # ??? -74.52645???????? 46.14392 ?plot(Mean_Percent_of_Range ~ No.ofPoints) curve(coef(fit)[[1]]+coef(fit)[[2]]*log(x),add=TRUE,col=2) A.K. I realize this is a stupid question, and I have honestly tried to find the answer online, but nothing I have tried has worked. I have two vectors of data: "Mean_percent_of_range" 10.90000 ?17.50000 ?21.86667 ?25.00000 ?25.40000 ?26.76667 ?29.53333 ?32.36667 ?43.13333 ?41.80000 50.56667 ?49.26667 ?50.36667 ?51.93333 ?59.70000 ?63.96667 ?62.53333 ?60.80000 ?64.23333 ?66.00000 74.03333 ?70.40000 ?77.06667 ?76.46667 ?78.13333 ?89.46667 ?88.90000 ?90.03333 ?91.60000 ?94.30000 95.50000 ?96.20000 ?96.50000 ?91.40000 ?98.20000 ?96.60000 ?97.40000 ?99.00000 100.00000 and "No.ofPoints" 5 ?6 ?7 ?8 ?9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 When I plot these, I get a logarithmic curve (as I should for this type of data) > plot(Mean_Percent_of_Range ~ No.ofPoints) All that I want to do is plot best fit regression line for that curve. From what I have read online, it seems like the code to do that should be > abline(lm(log(Mean_Percent_of_Range) ~ log(No.ofPoints))) but that gives me a straight line that isn't even close to fitting the data How do I plot the line and get the equation of that line and a correlation coefficient? Thanks ------------------------------ Message: 9 Date: Sat, 22 Feb 2014 13:17:11 -0800 From: David Winsemius <dwinsemius at comcast.net> To: PQuery <pierre.khoueiry at embl.de> Cc: r-help at r-project.org Subject: Re: [R] dependent column(s) in data frame Message-ID: <7F4E15EB-C7C8-4B29-9F7B-84E71B05A49C at comcast.net> Content-Type: text/plain; charset=us-ascii On Feb 22, 2014, at 4:28 AM, PQuery wrote: > Many thanks David, > > I will have a look on logistic regression for my case. > Do you know about a good example regarding logistic regression ? > I was thinking also of using Multiple Factor Analysis too (MFA - like in > FactoMineR). However I am not sure how successful this is going to be. Your data (exclusively 0/1 values) did not look like it would be suitable for factor analysis. Perhaps you mean to use that package's correspondence analysis methods? -- David Winsemius Alameda, CA, USA ------------------------------ Message: 10 Date: Sat, 22 Feb 2014 16:57:31 -0800 From: David Winsemius <dwinsemius at comcast.net> Cc: "R. Help" <r-help at r-project.org> Subject: Re: [R] how to plot a logarithmic regression line Message-ID: <40376E77-6E00-4D16-B568-3FB8AE9B53B3 at comcast.net> Content-Type: text/plain; charset=windows-1252 On Feb 22, 2014, at 1:06 PM, arun wrote: > HI, > Try ?curve > > fit <- lm(Mean_Percent_of_Range~log(No.ofPoints)) >? coef(fit) >? #? ? (Intercept) log(No.ofPoints) >???#? ???-74.52645? ? ? ???46.14392 > > > >? plot(Mean_Percent_of_Range ~ No.ofPoints) > curve(coef(fit)[[1]]+coef(fit)[[2]]*log(x),add=TRUE,col=2) > > > A.K. > > > > I realize this is a stupid question, and I have honestly tried to find > the answer online, but nothing I have tried has worked. I have two > vectors of data: > > "Mean_percent_of_range" > 10.90000? 17.50000? 21.86667? 25.00000? 25.40000? 26.76667? 29.53333 >? 32.36667? 43.13333? 41.80000 50.56667? 49.26667? 50.36667? 51.93333 >? 59.70000? 63.96667? 62.53333? 60.80000? 64.23333? 66.00000 74.03333 >? 70.40000? 77.06667? 76.46667? 78.13333? 89.46667? 88.90000? 90.03333 >? 91.60000? 94.30000 95.50000? 96.20000? 96.50000? 91.40000? 98.20000 >? 96.60000? 97.40000? 99.00000 100.00000 > > and > "No.ofPoints" > 5? 6? 7? 8? 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 > 39 40 41 42 43 > > When I plot these, I get a logarithmic curve (as I should for this type of data) >> plot(Mean_Percent_of_Range ~ No.ofPoints) > > All that I want to do is plot best fit regression line for that > curve. From what I have read online, it seems like the code to do that > should be >> abline(lm(log(Mean_Percent_of_Range) ~ log(No.ofPoints))) > but that gives me a straight line that isn't even close to fitting the data > > How do I plot the line and get the equation of that line and a correlation coefficient? The 'abline' function is not what you want. Use 'lines' to plot multiple points. Perhaps: mod <- lm(log(Mean_percent_of_range) ~ log(No.ofPoints)) plot(log(Mean_percent_of_range), log(No.ofPoints)) lines( log(No.ofPoints), predict(mod)) #------------ > summary(mod) Call: lm(formula = log(Mean_percent_of_range) ~ log(No.ofPoints)) Residuals: ? ???Min? ? ???1Q???Median? ? ???3Q? ? ? Max -0.32617 -0.04839? 0.00962? 0.05316? 0.17316 Coefficients: ? ? ? ? ? ? ? ???Estimate Std. Error t value Pr(>|t|)? ? (Intercept)? ? ???1.19840? ? 0.08060???14.87???<2e-16 *** log(No.ofPoints)? 0.94228? ? 0.02609???36.12???<2e-16 *** --- Signif. codes:? 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Residual standard error: 0.09455 on 37 degrees of freedom Multiple R-squared:? 0.9724,??? Adjusted R-squared:? 0.9717 F-statistic:? 1305 on 1 and 37 DF,? p-value: < 2.2e-16 David Winsemius Alameda, CA, USA ------------------------------ Message: 11 Date: Sat, 22 Feb 2014 18:18:57 -0800 From: Dennis Murphy <djmuser at gmail.com> To: Lars Bishop <lars52r at gmail.com> Cc: "r-help at r-project.org" <r-help at r-project.org> Subject: Re: [R] Math symbols in ggplot facets Message-ID: ??? <CADv2QyE=sV9086T=44QoGkha5JR1SHch7HSn=H_gNDEXzof_LQ at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi: You were close... library(ggplot2) m <- mpg # Set the factor labels with plotmath code (note the ==) m$drv <- factor(m$drv, labels = c("sigma[0] == sqrt(2)", ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "sigma[0] == 2 * sqrt(2)", ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "sigma[0] == 3 * sqrt(2)")) ggplot(m, aes(x = displ, y = cty)) + geom_point() + ? facet_grid(. ~ drv, labeller = label_parsed) Dennis On Sat, Feb 22, 2014 at 3:24 AM, Lars Bishop <lars52r at gmail.com> wrote: > Hello, > > I would like to show in my facet labels the equivalent in LaTex of > $\sigma_{0}= \sqrt{2}$. I think I'm close below, but not yet as it shows > $(\sigma_{0}, \sqrt{2})$ > > m <- mpg > levels(m$drv) <- c("sigma[0]=sqrt(2)", "sigma[0]=2 * sqrt(2)", "sigma[0]= 3 > * sqrt(2)") > > ggplot(m, aes(x = displ, y = cty)) + geom_point() + >???facet_grid(. ~ drv, labeller label_parsed) > > > Thanks, > Lars. > >? ? ? ???[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ------------------------------ Message: 12 Date: Sat, 22 Feb 2014 21:29:03 -0600 From: Ranjan Maitra <maitra.mbox.ignored at inbox.com> To: <r-help at stat.math.ethz.ch> Subject: [R] equivalent of $\check Y$ in plotmath Message-ID: <20140222212903.e2fe6dcbc1a9a3a11d014c8d at inbox.com> Content-Type: text/plain; charset="us-ascii" Hi, I am trying to put the expression which in LaTeX would be $\check Y$? as a label on the axis of a plot. How does one get the \check part of the above to produce a similar symbol in plotmath in R? I looked around plotmath's help but could not see this in the documentation. Many thanks for any suggestions, and best wishes, Ranjan -- Important Notice: This mailbox is ignored: e-mails are set to be deleted on receipt. Please respond to the mailing list if appropriate. For those needing to send personal or professional e-mail, please use appropriate addresses. ____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks [[elided Yahoo spam]] ------------------------------ Message: 13 Date: Sat, 22 Feb 2014 16:57:14 -0500 From: "Julie Royster" <jsdroyster at nc.rr.com> To: <r-help at r-project.org> Subject: [R] seeking alternative method to copy a large section of my ??? R??? program Message-ID: <000501cf3019$0c22da00$24688e00$@rr.com> Content-Type: text/plain Is there any way I can insert markers at the beginning and end of a large section of R statements and then copy all text in between to clipboard? I have trouble scrolling to select long sections, so if there is another way [[elided Yahoo spam]] Julie (for husband Larry) ??? [[alternative HTML version deleted]] ------------------------------ Message: 14 Date: Sat, 22 Feb 2014 22:34:02 -0800 From: Jeff Newmiller <jdnewmil at dcn.davis.CA.us> To: Julie Royster <jsdroyster at nc.rr.com>, r-help at r-project.org Subject: Re: [R] seeking alternative method to copy a large section of ??? my??? R??? program Message-ID: <bfb3ed6b-33f6-4956-9430-daab0fe6adf0 at email.android.com> Content-Type: text/plain; charset=UTF-8 This is a function of the editor you use and the operating system you use, neither of which is on topic here. That said, many popular GUI editors allow you to select by holding the shift key down while moving the cursor with arrow keys. Note that in the long run using the source function to have R process a whole file is much easier to remember how to do later than remembering which chunks of code to copy and paste. In addition, sometimes the amount of text that the clipboard can hold will be less than you want to run, leading to mysterious error messages from R. --------------------------------------------------------------------------- Jeff Newmiller? ? ? ? ? ? ? ? ? ? ? ? The? ???.....? ? ???.....? Go Live... DCN:<jdnewmil at dcn.davis.ca.us>? ? ? ? Basics: ##.#.? ? ???##.#.? Live Go... ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Live:???OO#.. Dead: OO#..? Playing Research Engineer (Solar/Batteries? ? ? ? ? ? O.O#.? ? ???#.O#.? with /Software/Embedded Controllers)? ? ? ? ? ? ???.OO#.? ? ???.OO#.? rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On February 22, 2014 1:57:14 PM PST, Julie Royster <jsdroyster at nc.rr.com> wrote: >Is there any way I can insert markers at the beginning and end of a >large >section of R statements and then copy all text in between to clipboard? > >I have trouble scrolling to select long sections, so if there is >another way [[elided Yahoo spam]] > >Julie (for husband Larry) > >??? [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code. ------------------------------ Message: 15 Date: Sat, 22 Feb 2014 22:36:12 -0800 From: David Winsemius <dwinsemius at comcast.net> To: "Julie Royster" <jsdroyster at nc.rr.com> Cc: r-help at r-project.org Subject: Re: [R] seeking alternative method to copy a large section of ??? my R??? program Message-ID: <C4ECBAED-6528-49D9-88D9-F319E170A057 at comcast.net> Content-Type: text/plain; charset=us-ascii On Feb 22, 2014, at 1:57 PM, Julie Royster wrote: > Is there any way I can insert markers at the beginning and end of a large > section of R statements and then copy all text in between to clipboard? > > I have trouble scrolling to select long sections, so if there is another way [[elided Yahoo spam]] Each interface is going to be a bit different, but on both the Mac and Windoze I can position the cursor at one end , hold down the shift-key, scroll to the other end and release the shift-key and I will have the target ready for either an Edit/Cut or a cmd-C/ctrl-C. -- David Winsemius Alameda, CA, USA ------------------------------ _______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. End of R-help Digest, Vol 132, Issue 23