Displaying 20 results from an estimated 20000 matches similar to: "Is the page number in a document created with "pdf()" accessible?"
2003 Apr 12
1
system()
I am new to R but have used Splus for many years. When I create many
graphics in sequence in Splus/Linux, each time that I complete a
page, I send a message to my command line interface using the
following function:
FOOT <- function(PAGENO,TEXT)
{
mtext(outer=T, TEXT, side=1)
unix("cat", c(paste("Finished with page", PAGENO)),FALSE, FALSE)
2008 Dec 15
3
opening a PDF document
Colleagues,
I am interesting in opening a PDF document via the command line from
both Windows, OS X, and Linux ( R version 2.8.0). I found a command
openPDF in Biobase. However, I would rather execute the command
myself. For example, in OS X:
> system("open filename.pdf")
is successful.
Is there a comparable command line command for Windows or Linux?
Dennis
Dennis Fisher
2010 Mar 20
1
Printing Unicode characters in a PDF document
Colleagues,
OS: OS X
R: 2.10.1
I want a mu (?) to appear in text that is created using a PDF device. However, the ? does not appear as intended; instead, it is replaced by two dots. A minimal example is:
> pdf("mu.pdf")
> plot(1,1, type="n")
> text(1,1, "\u3BC")
> dev.off()
The "text" command yields the following warning messages:
>
2017 Sep 22
1
Embedding PDF into RTF document via R language
R 3.4.1
OS X and Windows
Colleagues
I have a complicated problem that includes several components:
R
RTF
PDF
Using R (and a slew of RTF commands), I assemble a text document with an RTF extension. The document contains text, tables, and images (JPEG format, previously created with R).
To ?import? the JPEG images into the document, I use the following R code:
cat("\\pard\\qc
2011 Jul 13
1
UNIX diff function
Colleagues,
(R: 2.13.0; OS X)
I often receive sequential datasets in which there are new rows interposed between existing rows. For example:
SET1 <- data.frame(list(LETTERS=LETTERS[c(1:4, 6:10)], NUMBERS=c(1:4, 6:10)))
SET2 <- data.frame(list(LETTERS=LETTERS[1:10], NUMBERS=1:10))
> SET1
LETTERS NUMBERS
1 A 1
2 B 2
3 C 3
4 D 4
5
2011 Sep 18
1
Removing a single element from an array
R 2.13.1
OS X
Colleagues
I frequently encounter a situation in which I want to remove a single element of an array. For example, if I am reading in a bunch of CSV files, I create the list of files to be read with:
LIST <- dir()
However, sometimes I want to exclude one or more files. I can accomplish this with a second command:
LIST <- LIST[LIST != "filename.to.be.excluded"]
2020 Oct 07
1
Adding text to existing PDF's created with R
R 4.0.2
OS X
Colleagues
Does R have the capability of adding text (e.g., page numbers) to an existing PDF (previously created with R) -- other than adding this text, the PDF should be unchanged (except for a new filename).
The intent is as follows:
I have multiple PDFs that I eventually merge into a single PDF, separating each one with a separator page.
The content of the separator pages
2000 Feb 07
4
Segmentation fault, devPS.c, 0.99.0 (PR#413)
Full_Name: Roger Bivand
Version: 0.99.0
OS: RH Linux 6.1
Submission from: (NULL) (158.37.60.152)
I am working on an interface between R and the GRASS geographical information
system,
written in R, with no dynamically loaded code. I have written full examples, and
tested
then under R 0.90.1, both by entering example() for each function and R CMD
check, both
of which worked without problem.
Under
2006 Mar 24
2
"transparent" background for PDF
Colleagues
Running R2.2.1 on either a Linux (RedHat 9) or Mac (10.4) platform.
I created a PDF document using pdf("FILENAME.pdf", bg="transparent",
version="1.4"). I then imported the graphic into PowerPoint -
background was set to a non-transparent color. I was hoping that the
inserted graphic would be transparent - instead, it had a white
background.
2011 Apr 07
1
Adding text to page margin with lattice graphics
R: 2.12.1
OS X
Colleagues
I am working with lattice graphics for the first time and I am confused by some aspects of controlling these graphics. The most pressing issue is the following:
I can print the graphics without problems with the command:
print(MYFUNCTION(SOMEOBJECT)
However, I would like to add margin text (this terminology might not apply in this setting). I am able to do so with
2006 Nov 13
2
Embedded carriage returns in text document
Colleagues,
I am using R 2.4.0 on both a Mac (10.4.8) and Linux (RedHat 9). To
read data from an Excel spreadsheet, I do "save as" in Excel, then
select the "Text (tab-delimited)" format. The resulting file uses a
tab separator and I can usually read the file using read.delim.
Sometimes, the header row contains embedded carriage returns. When I
view the file,
2005 Jul 23
1
"%03d" in the pdf command
The pdf man page contains the following text:
pdf(file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),
width = 6, height = 6, onefile = TRUE, family = "Helvetica",
title = "R Graphics Output", fonts = NULL, version = "1.1",
paper, encoding, bg, fg, pointsize)
I am creating multi-page graphics in which each
2023 Dec 01
5
adding "Page X of XX" to PDFs
OS X
R 4.3.1
Colleagues
I often create multipage PDFs [pdf()] in which the text "Page X" appears in the margin. These PDFs are created automatically using a massive R script.
One of my clients requested that I change this to:
Page X of XX
where XX is the total number of pages.
I don't know the number of expected pages so I can't think of any clever way to do this. I
2023 Dec 02
1
adding "Page X of XX" to PDFs
One of the most fundamental characteristics of R programming is the use of data frames of column vectors, and one of the very first challenges I had as a then-Perl-programmer was coming to grips with the fact that unknown-length CSV files would be read completely into memory as rows and once the entire CSV was in memory it would be transposed into column vectors. I was resistant to this philosophy
2011 Apr 10
3
Adding margin text to lattice graphics
Colleagues
I am learning lattice graphics (R 2.12.2; OS X). Several days ago, I inquired about adding margin text to lattice graphics. Jim Price offered a useful reply, suggesting that I add:
page = function(page) grid.text('words', x = 0.5, y = 0.01)
to my call to the function. The entire function that he suggested was;
xyplot(1 ~ 1,
par.settings = list(layout.heights =
2008 Feb 26
3
Reading a file created with Fortran
Colleagues,
I am trying to read a file written by Fortran. Several lines of the
file are pasted below:
101 06e+050280.9777.484208.18147.20.246350.4020.7308717.882600 1 1
101 0.5 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 1 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 1.5 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 2
2009 Jan 30
3
identifying what labels have been created in a plot
Colleagues
R 2.8.0; OS X, Vista, Ubuntu Linux
In some instances, when I create a graphic using plot(XVAR, YVAR), it
would be valuable to know the values that R will display on the y-axis
(e.g., if the range of data is 0-70, it might display 0, 10, 30, 50,
70). Is there a simple means to access these values?
Also, in some instances, additional ticks appear between the displayed
values
2023 Dec 02
1
adding "Page X of XX" to PDFs
Would this work in general? Say I have a document with figures, special equations, text, and tables. The text and tables are relatively easy. The figures would need a conversion from pixels to lines, and the equations maybe printed out, counted as a figure, and then added to the line count. It would also be tricky if a title line was at 32 point font and the text at 12, and the more complex the
2023 Dec 02
1
adding "Page X of XX" to PDFs
Having read all of the replies, it seems there are solutions for the
question and the OP points out that some solutions such as making the
document twice will affect the creation date.
I suspect the additional time to do so is seconds or at most minutes so it
may not be a big deal.
But what about the idea of creating a PDF with a placeholder like "Page N of
XXX" and after the file has
2010 Mar 27
1
string width calculation
Colleagues,
I am trying to create a PDF document in which I use margin text with two different fonts. The resulting text might be:
XXXXXyZZZ
where X and Z are one font and Y is the other.
My plan was to do this in the following manner:
mtext("XXXXX ZZZ", cex=2, adj=0.5, family=SOMEFONT)
mtext("Y", cex=2, adj=??, family=DIFFERENTFONT)
My question regards how to calculate