Re: [R] Missing shapes in legend with scale_shape_manual

2023-10-31 Thread Rui Barradas

Às 20:55 de 30/10/2023, Kevin Zembower via R-help escreveu:

Hello,

I'm trying to plot a graph of blood glucose versus date. I also record
conditions, such as missing the previous night's medications, and
missing exercise on the previous day. My data looks like:


b2[68:74,]

# A tibble: 7 × 5
   Date   Time  bg missed_meds no_exercise
 
1 2023-10-17 08:50128 TRUEFALSE
2 2023-10-16 06:58144 FALSE   FALSE
3 2023-10-15 09:17137 FALSE   TRUE
4 2023-10-14 09:04115 FALSE   FALSE
5 2023-10-13 08:44136 FALSE   TRUE
6 2023-10-12 08:55122 FALSE   TRUE
7 2023-10-11 07:55150 TRUETRUE




This gets me most of the way to what I want:

ggplot(data = b2, aes(x = Date, y = bg)) +
 geom_line() +
 geom_point(data = filter(b2, missed_meds),
shape = 20,
size = 3) +
 geom_point(data = filter(b2, no_exercise),
shape = 4,
size = 3) +
 geom_point(aes(x = Date, y = bg, shape = missed_meds),
alpha = 0) + #Invisible point layer for shape mapping
 scale_y_continuous(name = "Blood glucose (mg/dL)",
breaks = seq(100, 230, by = 20)
) +
 geom_hline(yintercept = 130) +
 scale_shape_manual(name = "Conditions",
labels = c("Missed meds",
   "Missed exercise"),
values = c(20, 4),
## size = 3
)

However, the legend just prints an empty square in front of the labels.
What I want is a filled circle (shape 20) in front of "Missed meds" and
a filled circle (shape 4) in front of "Missed exercise."

My questions are:
  1. How can I fix my plot to show the shapes in the legend?
  2. Can my overall plotting method be improved? Would you do it this
way?

Thanks so much for your advice and guidance.

-Kevin



__
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.

Hello,

In ggplot2 graphics when you have more than one call to the same layer 
function, then you can probably simplify the code.


In this case you make several calls to geom_point. This can probably be 
avoided.


Create a new column named Condition.
Assign to it the column names wherever the values of those columns are 
TRUE. The simplest way of doing this is to use colus missed_meds and 
no_exercise as logical index columns, see code below.


Like this the values are mapped to shapes in just one call to geom_point.
That's what function aes() is meant for, to tell what variables define 
what in the plot.




b2$Date <- as.Date(b2$Date)
# this new column will be mapped to the shape aesthetic
b2$Conditions <- NA_character_
b2$Conditions[b2$missed_meds] <- names(b2)[4]
b2$Conditions[b2$no_exercise] <- names(b2)[5]

ggplot(data = b2, aes(x = Date, y = bg)) +
  geom_line() +
  geom_point(aes(shape = Conditions), size = 3) +
  geom_hline(yintercept = 130) +
  scale_y_continuous(
name = "Blood glucose (mg/dL)",
breaks = seq(100, 230, by = 20)
  ) +
  scale_shape_manual(
#name = "Conditions",
labels = c("Missed meds", "Missed exercise"),
values = c(20, 4),
na.translate = FALSE
  )



Hope this helps,

Rui Barradas


--
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] Missing shapes in legend with scale_shape_manual

2023-10-31 Thread Kevin Zembower via R-help
Tim, thanks, it helps very much. It works like a charm.

Wow, there's so much I don't understand about ggplot2 functions,
especially the aes() function. I just discovered the ggplot2-book.org
site, and I hope to read it slowly and carefully over the next couple
of weeks.

Thanks again, Tim, for all your help.

-Kevin

On Tue, 2023-10-31 at 12:35 +, Howard, Tim G (DEC) wrote:
> I believe the missing shapes are because you had set alpha=0 for the
> last geom point. 
> 
> I expect there are better ways, but one way to handle it would be to
> avoid the filtering, adding columns with med and exercise status,
> like the following:
> 
> # setup with data provided
> Date <- c('2023-10-17', '2023-10-16', '2023-10-15', '2023-10-14',
>  '2023-10-13', '2023-10-12', '2023-10-11')
> Time <- c('08:50', '06:58', '09:17', '09:04', '08:44', '08:55',
> '07:55') 
> bg <- c(128, 144, 137, 115, 136, 122, 150)
> missed_meds <- c(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE)
> no_exercise <- c(FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE)
> 
> b2 <- data.frame(Date, Time, bg, missed_meds, no_exercise)
> 
> b2$Date <- as.Date(b2$Date)
> # add "status" columns, could also be defined as factor. 
> b2$medStat <- c("missed_meds",NA, NA, NA, NA, NA, "missed_meds")
> b2$exercise <- c(NA, NA, "missed_exercise",NA,"missed_exercise",
> "missed_exercise", "missed_exercise")
> 
> Then your ggplot call would be like this:
> 
> ggplot(data = b2, aes(x = Date, y = bg)) +
>   geom_line() +
>   geom_point(aes(shape = medStat), size = 3)+
>   geom_point(aes(shape = exercise),size = 3)+
>   scale_y_continuous(name = "Blood glucose (mg/dL)",
>  breaks = seq(100, 230, by = 20)
>   ) +
>   geom_hline(yintercept = 130) +
>   scale_shape_manual(name = "Conditions",
>  labels = c("Missed meds",
>     "Missed exercise"),
>  values = c(20, 4)
>   )
> 
> 
> Note that this method then gets very close without the
> scale_shape_manual, too. 
> 
> Hope that helps. 
> Tim
> 
> 
> > Date: Mon, 30 Oct 2023 20:55:17 +
> > From: Kevin Zembower 
> > To: r-help@r-project.org 
> > Subject: [R] Missing shapes in legend with scale_shape_manual
> > Message-ID:
> >     <0100018b825e8f7f-646d2539-f8b5-4e1a-afc3-5d29f961967f-
> > 000...@email.amazonses.com>
> > 
> > Content-Type: text/plain; charset="utf-8"
> > 
> > Hello,
> > 
> > I'm trying to plot a graph of blood glucose versus date. I also
> > record
> > conditions, such as missing the previous night's medications, and
> > missing
> > exercise on the previous day. My data looks like:
> > 
> > > b2[68:74,]
> > # A tibble: 7 × 5
> >   Date   Time  bg missed_meds no_exercise
> >         
> > 1 2023-10-17 08:50    128 TRUE    FALSE
> > 2 2023-10-16 06:58    144 FALSE   FALSE
> > 3 2023-10-15 09:17    137 FALSE   TRUE
> > 4 2023-10-14 09:04    115 FALSE   FALSE
> > 5 2023-10-13 08:44    136 FALSE   TRUE
> > 6 2023-10-12 08:55    122 FALSE   TRUE
> > 7 2023-10-11 07:55    150 TRUE    TRUE
> > > 
> > 
> > This gets me most of the way to what I want:
> > 
> > ggplot(data = b2, aes(x = Date, y = bg)) +
> >     geom_line() +
> >     geom_point(data = filter(b2, missed_meds),
> >    shape = 20,
> >    size = 3) +
> >     geom_point(data = filter(b2, no_exercise),
> >    shape = 4,
> >    size = 3) +
> >     geom_point(aes(x = Date, y = bg, shape = missed_meds),
> >    alpha = 0) + #Invisible point layer for shape
> > mapping
> >     scale_y_continuous(name = "Blood glucose (mg/dL)",
> >    breaks = seq(100, 230, by = 20)
> >    ) +
> >     geom_hline(yintercept = 130) +
> >     scale_shape_manual(name = "Conditions",
> >    labels = c("Missed meds",
> >   "Missed exercise"),
> >    values = c(20, 4),
> >    ## size = 3
> >    )
> > 
> > However, the legend just prints an empty square in front of the
> > labels.
> > What I want is a filled circle (shape 20) in front of "Missed meds"
> > and a filled
> > circle (shape 4) in front of "Missed exercise."
> > 
> > My questions are:
> >  1. How can I fix my plot to show the shapes in the legend?
> >  2. Can my overall plotting method be improved? Would you do it
> > this way?
> > 
> > Thanks so much for your advice and guidance.
> > 
> > -Kevin
> > 
> > 
> > 
> > 



__
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] weights vs. offset (negative binomial regression)

2023-10-31 Thread Ben Bolker

  [Please keep r-help in the cc: list]

  I don't quite know how to interpret the difference between specifying 
effort as an offset vs. as weights; I would have to spend more time 
thinking about it/working through it than I have available at the moment.


   I don't know that specifying effort as weights is *wrong*, but I 
don't know that it's right or what it is doing: if I were the reviewer 
of a paper (for example) I would require you to explain what the 
difference is and convince me that it was appropriate. (Furthermore, "I 
want to do it this way because it gives me significant effects" is 
automatically suspicious.)


  This would be a good question for CrossValidated 
(https://stats.stackexchange.com), you could try posting it there (I 
would be interested in the answer!)


  cheers
Ben Bolker


On 2023-10-30 8:19 p.m., 유준택 wrote:

Dear Mr. Bolker,

Thank you for the fast response.

I also know that a poisson (or negative binomial ) regression of glm is  
generally modelled using an offset variable.


In this case, when a weights term instead of the offset is used, this 
gave me significant coefficients of covariance.
I understand that the weights function for exponential family 
distributions in glm affects the variance of response variable.


I was just wondering whether my first model is a completely wrong model 
and the use of offset variable is valid in the case that
response variable is  not proportional to offset variable such as my 
dataset.


Sincerely,


Joon-Taek

2023년 10월 29일 (일) 오전 3:25, Ben Bolker >님이 작성:


    Using an offset of log(Effort) as in your second model is the more
standard way to approach this problem; it corresponds to assuming that
catch is strictly proportional to effort. Adding log(Effort) as a
covariate (as illustrated below) tests whether a power-law model (catch
propto (Effort)^(b+1), b!=0) is a better description of the data.  (In
this case it is not, although the confidence intervals on b are very
wide, indicating that we have very little information -- this is not
surprising since the proportional range of effort is very small
(246-258) in this data set.

    In general you should *not* check overdispersion of the raw data
(i.e., the *marginal distribution* of the data, you should check
overdispersion of a fitted (e.g. Poisson) model, as below.

    cheers
     Ben Bolker


edata <- data.frame(Catch, Effort, xx1, xx2, xx3)

## graphical exploration

library(ggplot2); theme_set(theme_bw())
library(tidyr)
edata_long <- edata |> pivot_longer(names_to="var", cols =-c("Catch",
"Effort"))
ggplot(edata_long, aes(value, Catch)) +
      geom_point(alpha = 0.2, aes(size = Effort)) +
      facet_wrap(~var, scale="free_x") +
      geom_smooth(method = "glm", method.args = list(family =
"quasipoisson"))
#

library(MASS)
g1 <- glm.nb(Catch~xx1+xx2+xx3+offset(log(Effort)), data=edata)
g2 <- update(g1, . ~ . + log(Effort))
g0 <- glm(Catch~xx1+xx2+xx3+offset(log(Effort)), data=edata,
            family = poisson)
performance::check_overdispersion(g0)
summary(g1)
summary(g2)
options(digits = 3)
confint(g2)
summary(g1)



On 2023-10-28 3:30 a.m., 유준택 wrote:
 > Colleagues,
 >
 >
 >
 > I have a dataset that includes five variables.
 >
 > - Catch: the catch number counted in some species (ind.)
 >
 > - Effort: fishing effort (the number of fishing vessels)
 >
 > - xx1, xx2, xx3: some environmental factors
 >
 > As an overdispersion test on the “Catch” variable, I modeled with
negative
 > binomial distribution using a GLM. The “Effort” variable showed a
gradually
 > decreasing trend during the study period. I was able to get the
results I
 > wanted when considered “Effort” function as a weights function in the
 > negative binomial regression as follows:
 >
 >
 >
 > library(qcc)
 >
 >
Catch=c(25,2,7,6,75,5,1,4,66,15,9,25,40,8,7,4,36,11,1,14,141,9,74,38,126,3)
 >
 >

Effort=c(258,258,258,258,258,258,258,254,252,252,252,252,252,252,252,252,252,252,252,248,246,246,246,246,246,246)
 >
 >

xx1=c(0.8,0.5,1.2,0.5,1.1,1.1,1.0,0.6,0.9,0.5,1.2,0.6,1.2,0.7,1.0,0.6,1.6,0.7,0.8,0.6,1.7,0.9,1.1,0.5,1.4,0.5)
 >
 >

xx2=c(1.7,1.6,2.7,2.6,1.5,1.5,2.8,2.5,1.7,1.9,2.2,2.4,1.6,1.4,3.0,2.4,1.4,1.5,2.2,2.3,1.7,1.7,1.9,1.9,1.4,1.4)
 >
 >

xx3=c(188,40,2,10,210,102,117,14,141,28,48,15,220,115,10,14,320,20,3,10,400,150,145,160,460,66)
 >
 > #
 >
 > edata <- data.frame(Catch, Effort, xx1, xx2, xx3)
 >
 > #
 >
 > qcc.overdispersion.test(edata$Catch, type="poisson")
 >
 > #
 >
 > summary(glm.nb(Catch~xx1+xx2+xx3, weights=Effort, data=edata))
 >
 > summary(glm.nb(Catch~xx1+xx2+xx3+offset(log(Effort)), data=edata))
 >
  

Re: [R] Virus alert because of an R-help e-mail

2023-10-31 Thread Bert Gunter
No attachments. Most are deleted by  ETH mailman ... because they might
contain viruses.

-- Bert

On Tue, Oct 31, 2023 at 8:59 AM David Croll  wrote:

> I just received a virus warning from my e-mail provider, GMX. See the
> attached image below.
>
> The virus detection can be spurious - but the e-mail was automatically
> deleted by GMX.
>
> With the best regards,
>
>
> David
> __
> 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.


[R] Virus alert because of an R-help e-mail

2023-10-31 Thread David Croll

I just received a virus warning from my e-mail provider, GMX. See the
attached image below.

The virus detection can be spurious - but the e-mail was automatically
deleted by GMX.

With the best regards,


David
__
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] Missing shapes in legend with scale_shape_manual

2023-10-31 Thread Howard, Tim G (DEC) via R-help
I believe the missing shapes are because you had set alpha=0 for the last geom 
point. 

I expect there are better ways, but one way to handle it would be to avoid the 
filtering, adding columns with med and exercise status, like the following:

# setup with data provided
Date <- c('2023-10-17', '2023-10-16', '2023-10-15', '2023-10-14',
 '2023-10-13', '2023-10-12', '2023-10-11')
Time <- c('08:50', '06:58', '09:17', '09:04', '08:44', '08:55', '07:55') 
bg <- c(128, 144, 137, 115, 136, 122, 150)
missed_meds <- c(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE)
no_exercise <- c(FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE)

b2 <- data.frame(Date, Time, bg, missed_meds, no_exercise)

b2$Date <- as.Date(b2$Date)
# add "status" columns, could also be defined as factor. 
b2$medStat <- c("missed_meds",NA, NA, NA, NA, NA, "missed_meds")
b2$exercise <- c(NA, NA, "missed_exercise",NA,"missed_exercise", 
"missed_exercise", "missed_exercise")

Then your ggplot call would be like this:

ggplot(data = b2, aes(x = Date, y = bg)) +
  geom_line() +
  geom_point(aes(shape = medStat), size = 3)+
  geom_point(aes(shape = exercise),size = 3)+
  scale_y_continuous(name = "Blood glucose (mg/dL)",
 breaks = seq(100, 230, by = 20)
  ) +
  geom_hline(yintercept = 130) +
  scale_shape_manual(name = "Conditions",
 labels = c("Missed meds",
"Missed exercise"),
 values = c(20, 4)
  )


Note that this method then gets very close without the scale_shape_manual, too. 

Hope that helps. 
Tim


> Date: Mon, 30 Oct 2023 20:55:17 +
> From: Kevin Zembower 
> To: r-help@r-project.org 
> Subject: [R] Missing shapes in legend with scale_shape_manual
> Message-ID:
> <0100018b825e8f7f-646d2539-f8b5-4e1a-afc3-5d29f961967f-
> 000...@email.amazonses.com>
> 
> Content-Type: text/plain; charset="utf-8"
> 
> Hello,
> 
> I'm trying to plot a graph of blood glucose versus date. I also record
> conditions, such as missing the previous night's medications, and missing
> exercise on the previous day. My data looks like:
> 
> > b2[68:74,]
> # A tibble: 7 × 5
>   Date   Time  bg missed_meds no_exercise
> 
> 1 2023-10-17 08:50128 TRUEFALSE
> 2 2023-10-16 06:58144 FALSE   FALSE
> 3 2023-10-15 09:17137 FALSE   TRUE
> 4 2023-10-14 09:04115 FALSE   FALSE
> 5 2023-10-13 08:44136 FALSE   TRUE
> 6 2023-10-12 08:55122 FALSE   TRUE
> 7 2023-10-11 07:55150 TRUETRUE
> >
> 
> This gets me most of the way to what I want:
> 
> ggplot(data = b2, aes(x = Date, y = bg)) +
> geom_line() +
> geom_point(data = filter(b2, missed_meds),
>shape = 20,
>size = 3) +
> geom_point(data = filter(b2, no_exercise),
>shape = 4,
>size = 3) +
> geom_point(aes(x = Date, y = bg, shape = missed_meds),
>alpha = 0) + #Invisible point layer for shape mapping
> scale_y_continuous(name = "Blood glucose (mg/dL)",
>breaks = seq(100, 230, by = 20)
>) +
> geom_hline(yintercept = 130) +
> scale_shape_manual(name = "Conditions",
>labels = c("Missed meds",
>   "Missed exercise"),
>values = c(20, 4),
>## size = 3
>)
> 
> However, the legend just prints an empty square in front of the labels.
> What I want is a filled circle (shape 20) in front of "Missed meds" and a 
> filled
> circle (shape 4) in front of "Missed exercise."
> 
> My questions are:
>  1. How can I fix my plot to show the shapes in the legend?
>  2. Can my overall plotting method be improved? Would you do it this way?
> 
> Thanks so much for your advice and guidance.
> 
> -Kevin
> 
> 
> 
> 

__
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] [Rd] R 4.3.2 is released

2023-10-31 Thread Peter Dalgaard via R-help
The build system rolled up R-4.3.2.tar.gz (codename "Eye Holes") this morning.

This is a minor update, with a few bug fixes.

The list below details the changes in this release. 

You can get the source code from

https://cran.r-project.org/src/base/R-4/R-4.3.2.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you.

Binaries for various platforms will appear in due course.


For the R Core Team,

Peter Dalgaard


These are the checksums (md5 and SHA-256) for the freshly created files, in 
case you wish
to check that they are uncorrupted:

MD5 (AUTHORS) = 320967884b547734d6279dedbc739dd4
MD5 (COPYING) = eb723b61539feef013de476e68b5c50a
MD5 (COPYING.LIB) = a6f89e2100d9b6cdffcea4f398e37343
MD5 (FAQ) = 97a3ddc25aab502a70bfb1a79ab6f862
MD5 (INSTALL) = 7893f754308ca31f1ccf62055090ad7b
MD5 (NEWS) = b9ad3b7a9f54856444ec9849a69b18e3
MD5 (NEWS.0) = bfcd7c147251b5474d96848c6f57e5a8
MD5 (NEWS.1) = 4108ab429e768e29b1c3b418c224246e
MD5 (NEWS.2) = b38d94569700664205a76a7de836ba83
MD5 (NEWS.3) = e55ed2c8a547b827b46e08eb7137ba23
MD5 (R-latest.tar.gz) = 3217f2606bbde5a76fe4deaa4b4d3321
MD5 (README) = f468f281c919665e276a1b691decbbe6
MD5 (RESOURCES) = a79b9b338cab09bd665f6b62ac6f455b
MD5 (THANKS) = 45b6d2e88a6ecb5b24fa33a781351cd5
MD5 (VERSION-INFO.dcf) = 8d6576e0a33475e8b6dcb61f8e49a2b4
MD5 (R-4/R-4.3.2.tar.gz) = 3217f2606bbde5a76fe4deaa4b4d3321

60a0d150e6fc1f424be76ad7b645d236b56e747692a4679f81ce6536c550e949  AUTHORS
e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4  COPYING
6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  COPYING.LIB
3a47bca1e2a7db27c0ca12be388c238e2608ff2f768e627650a71a0ffc826038  FAQ
f87461be6cbaecc4dce44ac58e5bd52364b0491ccdadaf846cb9b452e9550f31  INSTALL
ec6844344589b717144d51ca3d5d1dbe5bc453d69287c06430f9bb2263abe01f  NEWS
4e21b62f515b749f80997063fceab626d7258c7d650e81a662ba8e0640f12f62  NEWS.0
5de7657c5e58e481403c0dd1a74a5c090b3ef481ce75a91dfe05d4b03f63163f  NEWS.1
cde079b6beab7d700d3d4ecda494e2681ad3b7f8fab13b68be090f949393ec62  NEWS.2
1910a2405300b9bc7c76beeb0753a5249cf799afe175ce28f8d782fab723e012  NEWS.3
b3f5760ac2eee8026a3f0eefcb25b47723d978038eee8e844762094c860c452a  
R-latest.tar.gz
2fdd3e90f23f32692d4b3a0c0452f2c219a10882033d1774f8cadf25886c3ddc  README
8b7d3856100220f4555d4d57140829f2e81c27eccec5b441f5dce616e9ec9061  RESOURCES
8319c5415de58ee10d4bc058d79c370fd8e6b2ad09e25d7a1e04b74ca5f380a6  THANKS
f3acaa77b0034a44c9c9b02767a2d383a7c2c2e2a3e7fec929fa20c5102304c5  
VERSION-INFO.dcf
b3f5760ac2eee8026a3f0eefcb25b47723d978038eee8e844762094c860c452a  
R-4/R-4.3.2.tar.gz

This is the relevant part of the NEWS file

CHANGES IN R 4.3.2:

  NEW FEATURES:

* The default initialization of the "repos" option from the
  repositories file at startup can be skipped by setting
  environment variable R_REPOSITORIES to NULL such that
  getOption("repos") is empty if not set elsewhere.

* qr.X() is now an implicit S4 generic in methods.

* iconv(to = "ASCII//TRANSLIT") is emulated using substitution on
  platforms which do not support it (notably Alpine Linux).  This
  should give a human-readable conversion in ASCII on all platforms
  (rather than NA_character_).

* trans3d() gains options continuous and verbose addressing the
  problem of possible "wrap around" when projecting too long
  curves, as reported by Achim Zeileis in PR#18537.

* tools::showNonASCII() has been rewritten to work better on macOS
  14 (which has a changed implementation of iconv()).

* tiff(type = "quartz") (the default on macOS) now warns if
  compression is specified: it continues to be ignored.

  INSTALLATION on a UNIX-ALIKE:

* There is some support for building with Intel's LLVM-based
  compilers on x86_64 Linux, such as (C) icx, (C++) ipcx and
  (Fortran) ifx from oneAPI 2023.x.y.

* There is support for using LLVM's flang-new as the Fortran
  compiler from LLVM 16.0.x (preferably 17.0.0 or later).

  UTILITIES:

* R CMD check reports the use of the Fortran 90 random number
  generator RANDOM_NUMBER() and the subroutines to initialize it.

  'Writing R Extensions' has example code to use R's RNGs from
  Fortran.

  BUG FIXES:

* substr(x, n, L) <- cc now works (more) correctly for multibyte
  UTF-8 strings x when L > nchar(x), thanks to a report and patch
  by 'Architect 95'.

* contrib.url(character()) now returns 0-length character() as
  documented, which also avoids spurious warnings from
  available.packages() et al. in the edge case of an empty vector
  of repository URLs.

* readChar(., 4e8) no longer fails, thanks to Kodi Arfer's report
  (PR#18557).

* lapply(, as.data.frame) no longer warns falsely for some
  base vector components.

* Communication between parent and child processes in the multicore
  part of parallel could fail on platforms that do not support an
  arbitrarily large payload in system functions 

[R] [R-pkgs] Introducing the makeit package

2023-10-31 Thread Arni Magnusson
Dear R community,

Just a quick note about a new package on CRAN called makeit. Yesterday, I
added a vignette and released as 1.0.1:
https://cran.r-project.org/package=makeit
https://cran.r-project.org/web/packages/makeit/vignettes/makeit.html

It provides a simple but powerful function make() that works the same way
as GNU Make. In short, it runs an R script if underlying files have
changed, otherwise it does nothing. The first example in the vignette is:
  make("analysis.R", "input.dat", "output.dat")
The second example involves three scripts:
  make("01_model.R", "data.dat", "results.dat")
  make("02_plots.R", "results.dat", c("plots/A.png", "plots/B.png"))
  make("03_tables.R", "results.dat", c("tables/A.csv", "tables/B.csv"))

For R workflows, it can provide the same functionality as GNU Make but with
fewer software requirements in terms of software installed and system path.
The make calls() can be grouped together in a dedicated script, called
something like _make.R, or conveniently called from within scripts to
decide whether a certain part of the analysis needs to be (re)run or not.

Any feedback is appreciated, via email or GitHub issues
.

Best regards,
Arni

P.S. I originally wanted to call the package simply 'make', but was
politely informed by the CRAN Team that this could mess with their
extensive makefile infrastructure. So there we have it, makeit :)

[[alternative HTML version deleted]]

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

__
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.