[R-pkg-devel] Cache in vignette not working when checking a package
Jose Barrera
jo@e@b@rrer@ @end|ng |rom |@g|ob@|@org
Tue Feb 2 11:22:36 CET 2021
Dear Dirk,
Thanks for clarifying, now I can see Thierry's point. But the issue is that
doing that my vignette would lose the "reproducible research" property
because the Rnw would need all those artefacts to reproduce the pdf. I know
I could combine Thierry's suggestion with playing with echo = TRUE/FALSE,
eval = TRUE/FALSE and purl = TRUE/FALSE in the chunks so that the pdf (and
the purled R file) looks like I don't save/retrieve partial results but I
would like to find a more elegant solution in which the Rnw reproduces the
pdf from scratch while taking advantage of "cache = TRUE" present in some
chunks, as we can do locally.
Best,
Jose Barrera
Statistician, Associate Lecturer
*IS**Global*
Barcelona Institute for Global Health - Campus MAR
Barcelona Biomedical Research Park (PRBB) (Room Hypatia)
Doctor Aiguader, 88
08003 Barcelona, Spain
Tel. +34 93 2147383
jose.barrera using isglobal.org
<https://www.linkedin.com/in/josebarrera>
Personal website: sites.google.com/view/josebarrera
www.isglobal.org
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege.
If you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly
prohibited by law. If this message has been received in error, please
immediately notify us via e-mail and delete it.
DATA PROTECTION. We inform you that your personal data, including your
e-mail address and data included in your email correspondence, are included
in the ISGlobal Foundation filing system. Your personal data will be used
for the purpose of contacting you and sending information on the activities
of the above foundations. You can exercise your rights to access to
personal data, rectification, erasure, restriction of processing, data
portability and object by contacting the following address: *lopd using isglobal.org
<lopd using isglobal.org>*. ISGlobal Privacy Policy at *www.isglobal.org
<http://www.isglobal.org/>*.
-----------------------------------------------------------------------------------------------------------------------------
CONFIDENCIALIDAD. Este mensaje y sus anexos se dirigen exclusivamente a su
destinatario y puede contener información confidencial, por lo que la
utilización, divulgación y/o copia sin autorización está prohibida por la
legislación vigente. Si ha recibido este mensaje por error, le rogamos lo
comunique inmediatamente por esta misma vía y proceda a su destrucción.
PROTECCIÓN DE DATOS. Sus datos de carácter personal utilizados en este
envío, incluida su dirección de e-mail, forman parte de ficheros de
titularidad de la Fundación ISGlobal para cualquier finalidades de
contacto, relación institucional y/o envío de información sobre sus
actividades. Los datos que usted nos pueda facilitar contestando este
correo quedarán incorporados en los correspondientes ficheros, autorizando
el uso de su dirección de e-mail para las finalidades citadas. Puede
ejercer los derechos de acceso, rectificación, supresión, limitación del
tratamiento, portabilidad y oposición dirigiéndose a *lopd using isglobal.org
<lopd using isglobal.org>* . Política de privacidad en *www.isglobal.org
<http://www.isglobal.org/>*.
El mar, 2 feb 2021 a las 3:38, Dirk Eddelbuettel (<edd using debian.org>)
escribió:
>
> On 1 February 2021 at 20:21, Jose Barrera wrote:
> | Many thanks for your help Thierry but unfortunately I can't see the link
> | between your first reply and my issue (of course, that's my fault).
>
> Thierry very gently (yet correctly) suggested to have the "cached" results
> as
> "precomputed" artifacts in the package to not require any compution at all.
> So write, for example, a data.frame df as
> saveRDS(df, "inst/cachedData/data.rds")
> and then in your vignette retrieve it as
> df <- readRDS(system.file("cachedData", "data.rds", package="mypkg"))
> replacing "mypkg" with your package name.
>
> Cheers, Dirk
>
> --
> https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>
--
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by professional privilege.
If
you are not the intended recipient you are hereby notified that any
dissemination, copy or disclosure of this communication is strictly
prohibited
by law. If this message has been received in error, please
immediately notify
us via e-mail and delete it.
DATA PROTECTION. We
inform you that your personal data, including your
e-mail address and data
included in your email correspondence, are included in
the ISGlobal
Foundation files. Your personal data will be used for the purpose
of
contacting you and sending information on the activities of the above
foundations. You can exercise your rights of access, rectification,
cancellation and opposition by contacting the following address:
lopd using isglobal.org <mailto:lopd using isglobal.org>. ISGlobal
Privacy Policy at
www.isglobal.org <http://www.isglobal.org/>.
-----------------------------------------------------------------------------------------------------------------------------
CONFIDENCIALIDAD. Este mensaje y sus anexos se dirigen exclusivamente a
su
destinatario y puede contener información confidencial, por lo que la
utilización,
divulgación y/o copia sin autorización está prohibida por la
legislación
vigente. Si ha recibido este mensaje por error, le rogamos lo
comunique
inmediatamente por esta misma vía y proceda a su destrucción.
PROTECCIÓN DE DATOS. Sus datos de carácter personal utilizados en este
envío, incluida su dirección de e-mail, forman parte de ficheros de
titularidad
de la Fundación ISGlobal para cualquier
finalidades de
contacto, relación institucional y/o envío de información sobre
sus
actividades. Los datos que usted nos pueda facilitar contestando este
correo quedarán incorporados en los correspondientes ficheros, autorizando
el
uso de su dirección de e-mail para las finalidades citadas. Puede
ejercer los
derechos de acceso, rectificación, cancelación y oposición
dirigiéndose a lopd using isglobal.org <mailto:lopd using isglobal.org>* *. Política de
privacidad
en www.isglobal.org <http://www.isglobal.org/>.
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list