rmendelss gmail
2016-Jul-06 16:45 UTC
[R] dplyr : row total for all groups in dplyr summarise
> On Jul 6, 2016, at 9:36 AM, David Winsemius <dwinsemius at comcast.net> wrote: > > n this case the text was cut from the R session console text and pasted without modification into Mail.app version 8.2. In replicating this action, I see now that hitting "return" then unfortunately converts the final double-quote to a "smart-quote?.Speaking of this, this happens to me a lot when I post, so any example code can not be copied and paste to be reproducible. Does anyone know of a workaround for this? Thanks, -Roy
David Winsemius
2016-Jul-06 18:42 UTC
[R] dplyr : row total for all groups in dplyr summarise
> On Jul 6, 2016, at 9:45 AM, rmendelss gmail <rmendelss at gmail.com> wrote: > > >> On Jul 6, 2016, at 9:36 AM, David Winsemius <dwinsemius at comcast.net> wrote: >> >> n this case the text was cut from the R session console text and pasted without modification into Mail.app version 8.2. In replicating this action, I see now that hitting "return" then unfortunately converts the final double-quote to a "smart-quote?. > > Speaking of this, this happens to me a lot when I post, so any example code can not be copied and paste to be reproducible. Does anyone know of a workaround for this?Google search: Mail.app changes quotes https://discussions.apple.com/thread/7065405?tstart=0 If this is on a Mac then the answer it to change setting on the Keyboard/text Control Panel: uncheck the Use smart quotes and dashes: Test: mtcars %>% group_by (am, gear) %>% summarise (n=n()) %>% mutate(rel.freq = paste0(round(100 * n/sum(n), 0), "%")) %>% ungroup() %>% plyr::rbind.fill(data.frame( n=nrow(mtcars),rel.freq="100%")) Seems to work. -- David> > Thanks, > > -Roy > >
Jeff Newmiller
2016-Jul-06 18:44 UTC
[R] dplyr : row total for all groups in dplyr summarise
My point is that this is highly software-dependent. Certain email programs and editors are worse than others in inclusion of configuration settings that allow you to avoid this problem. In general you need to look for "plain text" options, and some software has "Auto-Correct" options turned on by default. -- Sent from my phone. Please excuse my brevity. On July 6, 2016 9:45:48 AM PDT, rmendelss gmail <rmendelss at gmail.com> wrote:> >> On Jul 6, 2016, at 9:36 AM, David Winsemius <dwinsemius at comcast.net> >wrote: >> >> n this case the text was cut from the R session console text and >pasted without modification into Mail.app version 8.2. In replicating >this action, I see now that hitting "return" then unfortunately >converts the final double-quote to a "smart-quote?. > >Speaking of this, this happens to me a lot when I post, so any example >code can not be copied and paste to be reproducible. Does anyone know >of a workaround for this? > >Thanks, > >-Roy
Roy Mendelssohn - NOAA Federal
2016-Jul-06 18:59 UTC
[R] dplyr : row total for all groups in dplyr summarise
Thanks muchly. I hate the smart quotes! -Roy> On Jul 6, 2016, at 11:42 AM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Jul 6, 2016, at 9:45 AM, rmendelss gmail <rmendelss at gmail.com> wrote: >> >> >>> On Jul 6, 2016, at 9:36 AM, David Winsemius <dwinsemius at comcast.net> wrote: >>> >>> n this case the text was cut from the R session console text and pasted without modification into Mail.app version 8.2. In replicating this action, I see now that hitting "return" then unfortunately converts the final double-quote to a "smart-quote?. >> >> Speaking of this, this happens to me a lot when I post, so any example code can not be copied and paste to be reproducible. Does anyone know of a workaround for this? > > Google search: Mail.app changes quotes > > https://discussions.apple.com/thread/7065405?tstart=0 > > If this is on a Mac then the answer it to change setting on the Keyboard/text Control Panel: uncheck the Use smart quotes and dashes: > > > <PastedGraphic-1.tiff> > > Test: > > mtcars %>% > group_by (am, gear) %>% > summarise (n=n()) %>% > mutate(rel.freq = paste0(round(100 * n/sum(n), 0), "%")) %>% > ungroup() %>% plyr::rbind.fill(data.frame( n=nrow(mtcars),rel.freq="100%")) > > > Seems to work. > -- > David >> >> Thanks, >> >> -Roy >> >> >********************** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ********************** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new address and phone*** 110 Shaffer Road Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.