Re: [R-pkg-devel] Using data.table in a package
Question one is a matter of personal preference. I personally stick to explicitly state a double column depency with data.table. Question two. Just replacing the dot by list is sufficient AFAIK. Hope this helps Le ven. 5 mars 2021 à 14:28, Martin Møller Skarbiniks Pedersen < traxpla...@gmail.com> a écrit : > Hi, > > I am converting a couple of functions into a R-package. Many of the > functions use data.table. > I have two questions using data.table in my own package. > Normally I would put each question in separate emails but I think they > might be connected. > > First question is short and I think the answer is yes. > 1. Do I always need to prefix data.table each time I use something from > that package? > Eg. DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), > v=1:9) > > Second question is longer. > 2. In this small example code: > hello <- function() { > DT <- data.table::data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), > v=1:9) > DT[, .(sum(v))] > } > > I get these warnings from R CMD check: > hello: no visible global function definition for ‘.’ > hello: no visible binding for global variable ‘v’ > Undefined global functions or variables: > . v > > According to: vignette("datatable-importing", package = "data.table") > The solution is > hello <- function() { > v <- NULL > . <- NULL > > And it works but looks a bit weird. > Is there a better solution? > > Regards > Martin > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] ggplot2 axis title with various size fonts
OK. I'll post it to rstudio. Thanks i deed for suggestions Le mar. 8 déc. 2020 à 13:34, Gábor Csárdi a écrit : > The best place for ggplot2 related questions is > https://community.rstudio.com/ > > Make sure you use the ggplot2 tag for your question. > > Gabor > > On Tue, Dec 8, 2020 at 9:25 AM neonira Arinoem wrote: > > > > Is it possible to compose a string to be used as axis title in ggplot2, > > with the main part being drawn using one given font and font size, and > the > > last part being drawn with another font and font size. See below for an > > example > > > > *my axis title **(units)* > > > > Currently struggling to achieve this. > > Thanks in advance for suggestions. > > > > [[alternative HTML version deleted]] > > > > __ > > R-package-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-package-devel > [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] ggplot2 axis title with various size fonts
Is it possible to compose a string to be used as axis title in ggplot2, with the main part being drawn using one given font and font size, and the last part being drawn with another font and font size. See below for an example *my axis title **(units)* Currently struggling to achieve this. Thanks in advance for suggestions. [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Fwd: PDF generation issue from manual page
Hi R gurus Got an issue risen by CRAN about using unknown characters from Latex. Here is the error message, in the context of PDF generated form manual pages *Check: PDF version of manual, Result: WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Undefined control sequence.\blacktriangleright * * l.237 STRATUM $\blacktriangleright $ LAYER\_3 ! Undefined control sequence. \blacktriangleright * * l.239 PHASING $\blacktriangleright $ RUN ! Undefined control sequence.\blacktriangleright * * l.241 INTENT $\blacktriangleright $ FEEDBACK* I understand that the \blacktriangleright is an unknown control sequence from latex ... and that sounds strange to me, as I uses it often in vignettes without any issue so far. I did some tests on my machine with R CMD Rd2pdf --force --output=x.pdf man/*.Rd and it reproduces the issue. In the incriminated manual page, the code generating this sequence is the following *\ifelse{latex}{\out{$\blacktriangleright$}}{\ifelse{html}{\out{}}{\u25b6}}* Apparently I need to add the \usepackage{amssymb} to the manual page. Do not know yet, how to achieve this. Yours ideas and hints welcome and this point or any other solution to this tricky issue. I know that I can still change *\backtriangleright* with any available control sequence and it will work. Indeed, not the way I prefer. Really wish to get my *\blacktriangleright* display. Best. Neonira [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] How to provide a finalized PDF file in a package?
Absolutely right Gabor. Thanks for suggestion Henrik. I tried to put the PDF directly in /inst/doc but apparently content is overwritten during vignettes generation, although there exists no name clash. Will probably have to try R.rsp! Le mar. 21 janv. 2020 à 17:32, Gábor Csárdi a écrit : > While R.rsp is a great workaround, I wish we had a better solution for > including a static PDF file in a package, one that does not require 6 > additional packages to leave a file exactly as it is > > Gabor > > On Tue, Jan 21, 2020 at 4:30 PM Henrik Bengtsson > wrote: > > > > It sounds like you want the PDF to have it appear as a package > > vignette. You can use the R.rsp::asis vignette engine > > (https://cran.r-project.org/package=R.rsp) to add static PDFs as > > vignettes to your package. The PDF is included as-is during the > > package *build* process (R CMD build) like other package vignettes and > > you don't have to LaTeX or other tools installed. See > > > https://cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-Static_PDF_and_HTML_vignettes.pdf > > for instructions. > > > > /Henrik > > (disclaim: I'm the author) > > > > On Tue, Jan 21, 2020 at 7:50 AM neonira Arinoem > wrote: > > > > > > I create a cheat sheet using MS-OFFICE and converted it at a PDF > format. > > > > > > I wonder in which folder of my package I should place it to be > installed > > > with the package. > > > > > > I tried instinctively in vignettes, but it doesn't seem to work > correctly, > > > as I do not find it back in my package installation folder. > > > > > > Best. > > > Neonira > > > > > > [[alternative HTML version deleted]] > > > > > > __ > > > R-package-devel@r-project.org mailing list > > > https://stat.ethz.ch/mailman/listinfo/r-package-devel > > > > __ > > R-package-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-package-devel > [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] How to provide a finalized PDF file in a package?
I create a cheat sheet using MS-OFFICE and converted it at a PDF format. I wonder in which folder of my package I should place it to be installed with the package. I tried instinctively in vignettes, but it doesn't seem to work correctly, as I do not find it back in my package installation folder. Best. Neonira [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel