Re: [R-es] TeachingDemos

2023-10-06 Thread Javier Marcuzzi
Estimada Amable Moreno

En Mac, R actualizado, anda. Observe mi escritura y la respuesta.

> install.packages("TeachingDemos")
trying URL 
'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/TeachingDemos_2.12.tgz'
Content type 'application/x-gzip' length 1237702 bytes (1.2 MB)
==
downloaded 1.2 MB


Javier Rubén Marcuzzi

> El 6 oct 2023, a las 17:26, Amable Moreno  escribió:
> 
> TeachingDemos


[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] R Gigs

2023-10-06 Thread Jeff Newmiller via R-help
That list is _very_ low volume... most employers who would benefit from the 
skills of an R user don't know that R exists.

On October 6, 2023 1:50:17 PM PDT, Fred Kwebiha  wrote:
>Thanks Bert.
>
>I have Subscribed now to that list.
>
>*Best Regards,*
>
>*FRED KWEBIHA*
>*+256-782-746-154*
>
>
>On Fri, Oct 6, 2023 at 11:36 PM Bert Gunter  wrote:
>
>> May be an age gap here, but I assume "gigs" = freelance jobs. If so,
>> https://stat.ethz.ch/mailman/listinfo/r-sig-jobs
>> might be useful. As well as an online search in all the usual places.
>> Otherwise, please excuse my out-of-date ignorance.
>>
>> Cheers,
>> Bert
>>
>> On Fri, Oct 6, 2023 at 1:23 PM Fred Kwebiha  wrote:
>> >
>> > Dear Community,
>> >
>> > Where Can I get Gigs related to R programming language?
>> >
>> > Thanks in Advance for your help.
>> >
>> > *Best Regards,*
>> >
>> > *FRED KWEBIHA*
>> > *+256-782-746-154*
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > __
>> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > 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.
>>
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] R Gigs

2023-10-06 Thread Fred Kwebiha
Thanks Bert.

I have Subscribed now to that list.

*Best Regards,*

*FRED KWEBIHA*
*+256-782-746-154*


On Fri, Oct 6, 2023 at 11:36 PM Bert Gunter  wrote:

> May be an age gap here, but I assume "gigs" = freelance jobs. If so,
> https://stat.ethz.ch/mailman/listinfo/r-sig-jobs
> might be useful. As well as an online search in all the usual places.
> Otherwise, please excuse my out-of-date ignorance.
>
> Cheers,
> Bert
>
> On Fri, Oct 6, 2023 at 1:23 PM Fred Kwebiha  wrote:
> >
> > Dear Community,
> >
> > Where Can I get Gigs related to R programming language?
> >
> > Thanks in Advance for your help.
> >
> > *Best Regards,*
> >
> > *FRED KWEBIHA*
> > *+256-782-746-154*
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] R Gigs

2023-10-06 Thread Bert Gunter
May be an age gap here, but I assume "gigs" = freelance jobs. If so,
https://stat.ethz.ch/mailman/listinfo/r-sig-jobs
might be useful. As well as an online search in all the usual places.
Otherwise, please excuse my out-of-date ignorance.

Cheers,
Bert

On Fri, Oct 6, 2023 at 1:23 PM Fred Kwebiha  wrote:
>
> Dear Community,
>
> Where Can I get Gigs related to R programming language?
>
> Thanks in Advance for your help.
>
> *Best Regards,*
>
> *FRED KWEBIHA*
> *+256-782-746-154*
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R-es] TeachingDemos

2023-10-06 Thread Amable Moreno
Estimados colegas

Hasta el año pasado he usado el paquete "TeachingDemos"
Pero ahora, este paque no lo tengo instalado y no lo puedo volver a instalar
me marca error
Agradecweria me constesten, por favor, si alguien sabe porque ocurre

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R] R Gigs

2023-10-06 Thread Fred Kwebiha
Dear Community,

Where Can I get Gigs related to R programming language?

Thanks in Advance for your help.

*Best Regards,*

*FRED KWEBIHA*
*+256-782-746-154*

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] **Off Topic**, but perhaps of interest to many on this list

2023-10-06 Thread Bert Gunter
** Please Do Not Respond**
This is only FYI for those who care to follow the link below.

Explanation: Many questions that appear on this list are about how to
organize and format data -- unsurprising, as data structures are an
essential component of software and algorithm development in general,
and data science in particular. Those who are interested in such
queries and/or  the related area of reproducible research may find the
stupefying mess that biologist microscopists have to contend with to
be of interest:

(from Nature)
"How open-source software could finally get the world’s microscopes
speaking the same language"

https://www.nature.com/articles/d41586-023-03064-9

Best to all,
Bert

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] save(), load(), saveRDS(), and readRDS()

2023-10-06 Thread Micha Silver



Jim always went beyond just posting answers. He helped me along in 
learning R, always showing solutions together with insightful 
explanations. His patience and good humor were remarkable.


Condolences to his family.


On 05/10/2023 1:36, Jim Lemon wrote:

Hello,
I am very sad to let you know that my husband Jim died on 18th September. I
apologise for not letting you know earlier but I had trouble finding the
password for his phone.
Kind regards,
Juel

On Fri, 29 Sep 2023, 01:48 Shu Fai Cheung 
Hi All,

There is a thread about the use of save(), load(), saveRDS(), and
loadRDS(). It led me to think about a question regarding them.

In my personal work, I prefer using saveRDS() and loadRDS() as I don't like
the risk of overwriting anything in the global environment. I also like the
freedom to name an object when reading it from a file.

However, for teaching, I have to teach save() and load() because, in my
discipline, it is common for researchers to share their datasets on the
internet using the format saved by save(), and so students need to know how
to use load() and what will happen when using it. Actually, I can't recall
encountering datasets shared by the .rds format. I have been wondering why
save() was usually used in that case.

That discussion led me to read the help pages again and I noticed the
following warning, from the help page of saveRDS():

"Files produced by saveRDS (or serialize to a file connection) are not
suitable as an interchange format between machines, for example to download
from a website. The files produced by save
 have a header identifying
the file type and so are better protected against erroneous use."

When will the problem mentioned in the warning occur? That is, when will a
file saved by saveRDS() not be read correctly? Saved in Linux and then read
in Windows? Is it possible to create a reproducible error?

Regards,
Shu Fai

 [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jeff Newmiller via R-help
Doesn't the outcome of this suggestion still depend on which fonts and output 
device you are using? ... and that is to some degree still system dependent...

On October 6, 2023 7:50:00 AM PDT, Rui Barradas  wrote:
>Às 10:09 de 06/10/2023, Chris Evans via R-help escreveu:
>> The reason I am asking is that I would like to mark areas on a plot using 
>> geom_polygon() and aes(fill = variable) to fill various polygons forming the 
>> background of a plot with different colours. Then I would like to overlay 
>> that with points representing direction of change: improved, no reliable 
>> change, deteriorated. The obvious symbols to use for those three directions 
>> are an upward arrow, a circle or square and a downward pointing arrow.  
>> There is a solid upward point triangle symbol in R (ph = 17) and there are 
>> both upward and downward pointing open triangle symbols (pch 21 and 25) but 
>> to fill those with a solid colour so they will be visible over the 
>> background requires that I use a fill aesthetic and that gets me a mess with 
>> the legend as I will have used a different fill mapping to fill the 
>> polygons.  This silly reprex shows the issue I think.
>> 
>> library(tidyverse)
>> tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> tmpTibPoints
>> tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> tmpTibArea1
>> tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
>> tmpTibArea2
>> tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
>> tmpTibArea3
>> tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
>> tmpTibArea4
>> bind_rows(tmpTibArea1,
>>    tmpTibArea2,
>>    tmpTibArea3,
>>    tmpTibArea4) -> tmpTibAreas
>> ggplot(data = tmpTib,
>>     aes(x = x, y = y)) +
>>    geom_polygon(data = tmpTibAreas,
>>     aes(x = x, y = y, fill = a)) +
>>    geom_point(data = tmpTibPoints,
>>   aes(x = x, y = y, fill = c),
>>   pch = 24,
>>   size = 6)
>> 
>> Does anyone know a way to create a solid downward pointing symbol?  Or 
>> another workaround?
>> 
>> TIA,
>> 
>> Chris
>> 
>Hello,
>
>Maybe you can solve the problem with unicode characters.
>See the two scale_*_manual at the end of the plot.
>
>
>
># Unicode characters for black up- and down-pointing characters
>pts_shapes <- c("\U25B2", "\U25BC") |> setNames(c("A", "B"))
>pts_colors <- c("blue", "red") |> setNames(c("A", "B"))
>
>ggplot(data = tmpTibAreas,
>   aes(x = x, y = y)) +
>  geom_polygon(data = tmpTibAreas,
>   aes(x = x, y = y, fill = a)) +
>  geom_point(data = tmpTibPoints,
> aes(x = x, y = y, color = c, shape = c),
> size = 6) +
>  scale_shape_manual(values = pts_shapes) +
>  scale_color_manual(values = pts_colors)
>
>
>
>

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Rui Barradas

Às 10:09 de 06/10/2023, Chris Evans via R-help escreveu:
The reason I am asking is that I would like to mark areas on a plot 
using geom_polygon() and aes(fill = variable) to fill various polygons 
forming the background of a plot with different colours. Then I would 
like to overlay that with points representing direction of change: 
improved, no reliable change, deteriorated. The obvious symbols to use 
for those three directions are an upward arrow, a circle or square and a 
downward pointing arrow.  There is a solid upward point triangle symbol 
in R (ph = 17) and there are both upward and downward pointing open 
triangle symbols (pch 21 and 25) but to fill those with a solid colour 
so they will be visible over the background requires that I use a fill 
aesthetic and that gets me a mess with the legend as I will have used a 
different fill mapping to fill the polygons.  This silly reprex shows 
the issue I think.


library(tidyverse)
tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> tmpTibPoints
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> 
tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
   tmpTibArea2,
   tmpTibArea3,
   tmpTibArea4) -> tmpTibAreas
ggplot(data = tmpTib,
    aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
    aes(x = x, y = y, fill = a)) +
   geom_point(data = tmpTibPoints,
  aes(x = x, y = y, fill = c),
  pch = 24,
  size = 6)

Does anyone know a way to create a solid downward pointing symbol?  Or 
another workaround?


TIA,

Chris


Hello,

Maybe you can solve the problem with unicode characters.
See the two scale_*_manual at the end of the plot.



# Unicode characters for black up- and down-pointing characters
pts_shapes <- c("\U25B2", "\U25BC") |> setNames(c("A", "B"))
pts_colors <- c("blue", "red") |> setNames(c("A", "B"))

ggplot(data = tmpTibAreas,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a)) +
  geom_point(data = tmpTibPoints,
 aes(x = x, y = y, color = c, shape = c),
 size = 6) +
  scale_shape_manual(values = pts_shapes) +
  scale_color_manual(values = pts_colors)




--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença 
de vírus.
www.avg.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan
Another thing that I considered, but doesn't seem to be supported, is 
rotating the symbols. I noticed that that does work with text. So you 
could use a arrow symbol and then specify the angle aesthetic. But this 
still relies on text and unfortunately there are no arrowlike symbols in 
ASCII: except perhaps 'V'.


I can't say how the support for non-ascii text is over different OS-es 
and localities. 
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding-issues 
gives some 'hints'





On 06-10-2023 14:21, Chris Evans via R-help wrote:
Thanks again Jan.  That is lovely and clean and I probably should have 
seen that option.


I had anxieties about the portability of using text.  (The function will 
end up in my
https://github.com/cpsyctc/CECPfuns package so I'd like it to be fairly 
immune to character

sets and different platforms in different countries.

I'm morphing this question a lot now but I guess it's still on topic 
really.  I know
I need to put in some time to understand the complexities of R and 
platforms (I'm
pretty exclusively on Linux, Ubuntu or Debian now so have mostly done 
the ostrich thing
about these issues though I do hit problems exchanging things with my 
Spanish speaking
colleagues).  Jan or anyone: any simple reassurance or pointers to 
resources I should

best use for homework about these issues?

TIA (again!)

Chris

On 06/10/2023 12:55, Jan van der Laan wrote:

You are right, sorry.

Another possible solution then: use geom_text instead of geom_point 
and use a triangle shape as text:


ggplot(data = tmpTibPoints,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a)) +
  geom_text(data = tmpTibPoints,
 aes(x = x, y = y, label = "▼", color = c),
 size = 6) + guides(color = FALSE)


[much snipped]




__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Chris Evans via R-help
Thanks again Jan.  That is lovely and clean and I probably should have 
seen that option.


I had anxieties about the portability of using text.  (The function will 
end up in my
https://github.com/cpsyctc/CECPfuns package so I'd like it to be fairly 
immune to character

sets and different platforms in different countries.

I'm morphing this question a lot now but I guess it's still on topic 
really.  I know
I need to put in some time to understand the complexities of R and 
platforms (I'm
pretty exclusively on Linux, Ubuntu or Debian now so have mostly done 
the ostrich thing
about these issues though I do hit problems exchanging things with my 
Spanish speaking
colleagues).  Jan or anyone: any simple reassurance or pointers to 
resources I should

best use for homework about these issues?

TIA (again!)

Chris

On 06/10/2023 12:55, Jan van der Laan wrote:

You are right, sorry.

Another possible solution then: use geom_text instead of geom_point 
and use a triangle shape as text:


ggplot(data = tmpTibPoints,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a)) +
  geom_text(data = tmpTibPoints,
 aes(x = x, y = y, label = "▼", color = c),
 size = 6) + guides(color = FALSE)


[much snipped]


--
Chris Evans (he/him)
Visiting Professor, UDLA, Quito, Ecuador & Honorary Professor, 
University of Roehampton, London, UK.

Work web site: https://www.psyctc.org/psyctc/
CORE site: http://www.coresystemtrust.org.uk/
Personal site: https://www.psyctc.org/pelerinage2016/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [ESS] why a release from time to time would be nice

2023-10-06 Thread Manuel Teodoro via ESS-help
Hi Stephen,

I am not part of ESS team but I'm wondering what kind of problems you have
with Rmd files, maybe we can give you some advices.

I do all my Rmd and Qmd files in Emacs without any problem. In my
experience it works very well, even better than org-mode babel for R. For
the yaml part I use different snippets via yasnippet. And if you are still
missing something I am sure there should be tools for Emacs other than ESS
that can help you.

I'll be glad to help you or share an advice.

Manuel Teodoro

On Fri, Oct 6, 2023, 10:13 Stephen Bond via ESS-help 
wrote:

> Hello,
>
> I would like to request better support of Rmd, but that is not ESS
> really. I apologize if this is considered too much off topic.
> Do you know who can improve rmarkdown?
> Currently there is zero support for the meta/yaml section at the
> beginning, which makes it inconvenient to the point I am using Rstudio
> to output my Rmd files.
>
> Regards
> Stephen
>
> On Tue, 2023-10-03 at 17:28 +, Sparapani, Rodney via ESS-help
> wrote:
> > Hi Gang:
> >
> > Resurrecting this old thread from 09/2021
> >
> > For the last few years, the lack of an ESS release has been decried.
> > And, deservedly so.  Now, Im happy to report that we intend to
> > create a new release roughly by XMAS.  The reason that I am
> > telling all of you this: we are very interested in hearing what
> > issues that you are experiencing.  As you all know, Emacs has
> > evolved rapidly recently from v26 to 29: a more rapid release
> > schedule than we have been used to.  Speaking for myself,
> > there have been Emacs changes that have impacted ESS
> > features that I use frequently.  So, Im assuming that others
> > have seen the same and, potentially, have nice workarounds.
> > If you check github, then you will see that we have not really
> > started.  But, hopefully, that should change over the next month.
> > Thanks
> >
> > --
> > Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
> > Vice President, Wisconsin Chapter of the American Statistical
> > Association
> > Institute for Health and Equity, Division of Biostatistics
> > Medical College of Wisconsin, Milwaukee Campus
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > ESS-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/ess-help
>
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
>

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan

You are right, sorry.

Another possible solution then: use geom_text instead of geom_point and 
use a triangle shape as text:


ggplot(data = tmpTibPoints,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a)) +
  geom_text(data = tmpTibPoints,
 aes(x = x, y = y, label = "▼", color = c),
 size = 6) + guides(color = FALSE)



On 06-10-2023 12:11, Chris Evans via R-help wrote:
Sadly, no.  Still shows the same legend with both sets of fill 
mappings.  I have found a workaround, sadly
much longer than yours (!) that does get me what I want but it is a real 
bodge.  Still interested to see
if there is a way to create a downward pointing solid symbol but here is 
my bodge using new_scale_fill()
and new_scale_color() from the ggnewscale package (many thanks to Elio 
Campitelli for that).


library(tidyverse)
library(ggnewscale) # allows me to change the scales used
tibble(x = 2:9, y = 2:9,
    ### I have used A:C to ensure the changes sort in the correct 
order to avoid the messes of using shape to scale an ordinal variable
    ### have to say that seems a case where it is perfectly sensible 
to map shapes to an ordinal variable, scale_shape_manual() makes

    ### this difficult hence this bodge
    c = c(rep("A", 5), "B", rep("C", 2)),
    change = c(rep("Deteriorated", 5), "No change", rep("Improved", 
2))) %>%

   ### this is just keeping the original coding but not used below
   mutate(change = ordered(change,
   levels = c("Deteriorated", "No change", 
"Improved"))) -> tmpTibPoints

### create the area mapping
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> 
tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
   tmpTibArea2,
   tmpTibArea3,
   tmpTibArea4) -> tmpTibAreas
### now plot
ggplot(data = tmpTib,
    aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
    aes(x = x, y = y, fill = a),
    alpha = .5) +
   scale_fill_manual(name = "Areas",
     values = c("orange", "purple", "yellow", "brown"),
     labels = letters[1:4]) +
   ### next two lines use ggnewscale functions to reset the scale mappings
   new_scale_fill() +
   new_scale_colour() +
   ### can now use the open triangles and fill aesthetic to map them
   geom_point(data = tmpTibPoints,
  aes(x = x, y = y, shape = c, fill = c, colour = c),
  size = 6) +
   ### use the ordered variable c to get mapping in desired order
   ### which, sadly, isn't the alphabetical order!
   scale_shape_manual(name = "Change",
    values = c("A" = 24,
   "B" = 23,
   "C" = 25),
    labels = c("Deteriorated",
   "No change",
   "Improved")) +
   scale_colour_manual(name = "Change",
    values = c("A" = "red",
   "B" = "grey",
   "C" = "green"),
    labels = c("Deteriorated",
   "No change",
   "Improved")) +
   scale_fill_manual(name = "Change",
    values = c("A" = "red",
   "B" = "grey",
   "C" = "green"),
    labels = c("Deteriorated",
   "No change",
   "Improved"))

That gives the attached plot which is really what I want.  Long bodge 
though!*

*

On 06/10/2023 11:50, Jan van der Laan wrote:


Does adding

, show.legend = c("color"=TRUE, "fill"=FALSE)

to the geom_point do what you want?

Best,
Jan

On 06-10-2023 11:09, Chris Evans via R-help wrote:

library(tidyverse)
tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> 
tmpTibPoints
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> 
tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
   tmpTibArea2,
   tmpTibArea3,
   tmpTibArea4) -> tmpTibAreas
ggplot(data = tmpTib,
    aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
    aes(x = x, y = y, fill = a)) +
   geom_point(data = tmpTibPoints,
  aes(x = x, y = y, fill = c),
  pch = 24,
  size = 6)



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Chris Evans via R-help
Sadly, no.  Still shows the same legend with both sets of fill 
mappings.  I have found a workaround, sadly
much longer than yours (!) that does get me what I want but it is a real 
bodge.  Still interested to see
if there is a way to create a downward pointing solid symbol but here is 
my bodge using new_scale_fill()
and new_scale_color() from the ggnewscale package (many thanks to Elio 
Campitelli for that).


library(tidyverse)
library(ggnewscale) # allows me to change the scales used
tibble(x = 2:9, y = 2:9,
   ### I have used A:C to ensure the changes sort in the correct 
order to avoid the messes of using shape to scale an ordinal variable
   ### have to say that seems a case where it is perfectly sensible 
to map shapes to an ordinal variable, scale_shape_manual() makes

   ### this difficult hence this bodge
   c = c(rep("A", 5), "B", rep("C", 2)),
   change = c(rep("Deteriorated", 5), "No change", rep("Improved", 
2))) %>%

  ### this is just keeping the original coding but not used below
  mutate(change = ordered(change,
  levels = c("Deteriorated", "No change", 
"Improved"))) -> tmpTibPoints

### create the area mapping
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
  tmpTibArea2,
  tmpTibArea3,
  tmpTibArea4) -> tmpTibAreas
### now plot
ggplot(data = tmpTib,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a),
   alpha = .5) +
  scale_fill_manual(name = "Areas",
    values = c("orange", "purple", "yellow", "brown"),
    labels = letters[1:4]) +
  ### next two lines use ggnewscale functions to reset the scale mappings
  new_scale_fill() +
  new_scale_colour() +
  ### can now use the open triangles and fill aesthetic to map them
  geom_point(data = tmpTibPoints,
 aes(x = x, y = y, shape = c, fill = c, colour = c),
 size = 6) +
  ### use the ordered variable c to get mapping in desired order
  ### which, sadly, isn't the alphabetical order!
  scale_shape_manual(name = "Change",
   values = c("A" = 24,
  "B" = 23,
  "C" = 25),
   labels = c("Deteriorated",
  "No change",
  "Improved")) +
  scale_colour_manual(name = "Change",
   values = c("A" = "red",
  "B" = "grey",
  "C" = "green"),
   labels = c("Deteriorated",
  "No change",
  "Improved")) +
  scale_fill_manual(name = "Change",
   values = c("A" = "red",
  "B" = "grey",
  "C" = "green"),
   labels = c("Deteriorated",
  "No change",
  "Improved"))

That gives the attached plot which is really what I want.  Long bodge 
though!*

*

On 06/10/2023 11:50, Jan van der Laan wrote:


Does adding

, show.legend = c("color"=TRUE, "fill"=FALSE)

to the geom_point do what you want?

Best,
Jan

On 06-10-2023 11:09, Chris Evans via R-help wrote:

library(tidyverse)
tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> 
tmpTibPoints
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> 
tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
   tmpTibArea2,
   tmpTibArea3,
   tmpTibArea4) -> tmpTibAreas
ggplot(data = tmpTib,
    aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
    aes(x = x, y = y, fill = a)) +
   geom_point(data = tmpTibPoints,
  aes(x = x, y = y, fill = c),
  pch = 24,
  size = 6)



--
Chris Evans (he/him)
Visiting Professor, UDLA, Quito, Ecuador & Honorary Professor, 
University of Roehampton, London, UK.

Work web site: https://www.psyctc.org/psyctc/
CORE site: http://www.coresystemtrust.org.uk/
Personal site: https://www.psyctc.org/pelerinage2016/
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan



Does adding

, show.legend = c("color"=TRUE, "fill"=FALSE)

to the geom_point do what you want?

Best,
Jan

On 06-10-2023 11:09, Chris Evans via R-help wrote:

library(tidyverse)
tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> tmpTibPoints
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> 
tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
   tmpTibArea2,
   tmpTibArea3,
   tmpTibArea4) -> tmpTibAreas
ggplot(data = tmpTib,
    aes(x = x, y = y)) +
   geom_polygon(data = tmpTibAreas,
    aes(x = x, y = y, fill = a)) +
   geom_point(data = tmpTibPoints,
  aes(x = x, y = y, fill = c),
  pch = 24,
  size = 6)


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Chris Evans via R-help
The reason I am asking is that I would like to mark areas on a plot 
using geom_polygon() and aes(fill = variable) to fill various polygons 
forming the background of a plot with different colours. Then I would 
like to overlay that with points representing direction of change: 
improved, no reliable change, deteriorated. The obvious symbols to use 
for those three directions are an upward arrow, a circle or square and a 
downward pointing arrow.  There is a solid upward point triangle symbol 
in R (ph = 17) and there are both upward and downward pointing open 
triangle symbols (pch 21 and 25) but to fill those with a solid colour 
so they will be visible over the background requires that I use a fill 
aesthetic and that gets me a mess with the legend as I will have used a 
different fill mapping to fill the polygons.  This silly reprex shows 
the issue I think.


library(tidyverse)
tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> tmpTibPoints
tibble(x = c(1, 5, 5, 1), y = c(1, 1, 5, 5), a = rep("a", 4)) -> tmpTibArea1
tibble(x = c(5, 10, 10, 5), y = c(1, 1, 5, 5), a = rep("b", 4)) -> 
tmpTibArea2
tibble(x = c(1, 5, 5, 1), y = c(5, 5, 10, 10), a = rep("c", 4)) -> 
tmpTibArea3
tibble(x = c(5, 10, 10, 5), y = c(5, 5, 10, 10), a = rep("d", 4)) -> 
tmpTibArea4

bind_rows(tmpTibArea1,
  tmpTibArea2,
  tmpTibArea3,
  tmpTibArea4) -> tmpTibAreas
ggplot(data = tmpTib,
   aes(x = x, y = y)) +
  geom_polygon(data = tmpTibAreas,
   aes(x = x, y = y, fill = a)) +
  geom_point(data = tmpTibPoints,
 aes(x = x, y = y, fill = c),
 pch = 24,
 size = 6)

Does anyone know a way to create a solid downward pointing symbol?  Or 
another workaround?


TIA,

Chris

--
Chris Evans (he/him)
Visiting Professor, UDLA, Quito, Ecuador & Honorary Professor, 
University of Roehampton, London, UK.

Work web site: https://www.psyctc.org/psyctc/
CORE site: http://www.coresystemtrust.org.uk/
Personal site: https://www.psyctc.org/pelerinage2016/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [ESS] why a release from time to time would be nice

2023-10-06 Thread Stephen Bond via ESS-help
Hello,

I would like to request better support of Rmd, but that is not ESS
really. I apologize if this is considered too much off topic. 
Do you know who can improve rmarkdown?
Currently there is zero support for the meta/yaml section at the
beginning, which makes it inconvenient to the point I am using Rstudio
to output my Rmd files.

Regards
Stephen

On Tue, 2023-10-03 at 17:28 +, Sparapani, Rodney via ESS-help
wrote:
> Hi Gang:
> 
> Resurrecting this old thread from 09/2021
> 
> For the last few years, the lack of an ESS release has been decried.
> And, deservedly so.  Now, Im happy to report that we intend to
> create a new release roughly by XMAS.  The reason that I am
> telling all of you this: we are very interested in hearing what
> issues that you are experiencing.  As you all know, Emacs has
> evolved rapidly recently from v26 to 29: a more rapid release
> schedule than we have been used to.  Speaking for myself,
> there have been Emacs changes that have impacted ESS
> features that I use frequently.  So, Im assuming that others
> have seen the same and, potentially, have nice workarounds.
> If you check github, then you will see that we have not really
> started.  But, hopefully, that should change over the next month.
> Thanks
> 
> --
> Rodney Sparapani, Associate Professor of Biostatistics, He/Him/His
> Vice President, Wisconsin Chapter of the American Statistical
> Association
> Institute for Health and Equity, Division of Biostatistics
> Medical College of Wisconsin, Milwaukee Campus
> 
> [[alternative HTML version deleted]]
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help