similar to: system()

Displaying 20 results from an estimated 10000 matches similar to: "system()"

2004 Dec 17
2
Is the page number in a document created with "pdf()" accessible?
When I create pdf documents in R using pdf(), each page has text in the outer margin indicating the page number. I track page numbers in a cumbersome manner. Is the page number in a multi-page document tracked internally by par() or some other function? Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-8864) Fax: 1-415-564-2220 www.PLessThan.com
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
2010 Jul 20
1
Registered / trademark signs
Colleagues, What is the easiest means to embed a: ? (registered) or ? (trademark) sign in text in a graphic. I would like to use mtext and avoid plotmath, if possible. Ideally, the sign should be superscripted but I can easily sacrifice that. Optimally, I need a solution that works in both OS X and Windows (? XP) and with R versions ? 2.11 Thanks in advance. Dennis Dennis Fisher MD P <
2023 Jan 16
1
Printing special characters
Use the Cairo PDF device? On January 16, 2023 12:18:48 AM PST, Dennis Fisher <fisher at plessthan.com> wrote: >R 4.2.2 >OS X > >Colleagues > >A file that I have read includes strings like this: > "EVENT ? 30 sec" >When I include the string in a graphic using: > mtext(STRING, ?) >it appears as: > "EVENT ... 30 sec" > >Is there a
2023 Jan 16
1
Printing special characters
?s 08:31 de 16/01/2023, Jeff Newmiller escreveu: > Use the Cairo PDF device? > > On January 16, 2023 12:18:48 AM PST, Dennis Fisher <fisher at plessthan.com> wrote: >> R 4.2.2 >> OS X >> >> Colleagues >> >> A file that I have read includes strings like this: >> "EVENT ? 30 sec" >> When I include the string in a graphic
2010 Aug 01
3
Constructing arguments for plotmath
Colleagues, I am encountering difficulty adding formatted text to a graphic. Specifically, I want to add a superscript in the middle of a text string but I would like to format the text string on the fly. The commands: plot(1,1) ARG <- bquote('TEXT'^'\u00ae') mtext(ARG, line=-2, side=1) yield the desired output. However, my goal is to paste together a string, then pass
2023 Jun 08
2
need help with plotmath and/or plotting unicode characters
R 4.2.3 OS X Colleagues This should be easy -- but not for me. I want to plot text similar to this: N ? XX: YY where XX can be either 1 or 50 and YY is an integer I envision that there would be two solutions: UNICODE: If I can generate "?" via unicode, the problem is solved: mtext(side=3, paste0("N ", UNICODE, " ", XX, ": ", YY)) PLOTMATH:
2012 Apr 10
1
Rotating margin text
R 2.14.1 OS X Colleagues, I am making a graphic with two y-axes. I create the label for the right-side axis with: mtext(side=4, line=1, "Some text") The label is rotated 90° counterclockwise. I would prefer that it be rotated 90° clockwise. However, srt is not supported for mtext and las does not offer this option. Is there some other means to rotate the text string? Thanks in
2023 Jan 16
3
Printing special characters
R 4.2.2 OS X Colleagues A file that I have read includes strings like this: "EVENT ? 30 sec" When I include the string in a graphic using: mtext(STRING, ?) it appears as: "EVENT ... 30 sec" Is there a simple work-around (short of reformatting all the strings, then using plotmath)? Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax:
2007 Sep 04
2
Recursive concatenation
Colleagues, I want to create the following array: "A1", "A2", "A3", "B1", "B2", "B3", "C1", "C2", "C3" I recall that there is a trick using "c" or "paste" permitting me to form all combinations of c("A", "B", "C") and 1:3. But, I can't recall the
2009 Sep 29
3
Deleting a column in a dataframe by name
Colleagues, Hopefully a simple problem: I want to delete a column with a known name from a dataframe. I could write: FRAME <- FRAME[, names(FRAME) != NAMETODELETE] or FRAME <- FRAME[, !names(FRAME) %in% c(NAME1, NAME2, ETC)] Is there some simpler means to accomplish this? Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784)
2010 Jan 23
1
Failure to produce italics in jpeg
Colleagues, Using R 2.10.1 in OS X (Snow Leopard), I created JPEG documents that were intended to include italicized text. In the JPEG versions, the italics appear in bold-face. The identical code (except for the call to the device) yields italics in PDF. A minimal example is: PDF version: > pdf("plot.pdf") > plot(1,1) > mtext(bquote(italic(P) < .(0.005))) >
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
2005 Jul 22
3
Question regarding subsetting
I run R 2.1.1 in a Linux environment (RedHat 9) although my question is not platform-specific. Consider the following: > A <- c("Prefix-aaa", "Prefix-bbb", "Prefix-ccc") > B <- strsplit(A, "-") > B [[1]] [1] "Prefix" "aaa" [[2]] [1] "Prefix" "bbb" [[3]] [1] "Prefix" "ccc" How
2006 Oct 21
2
Filling in a series
Colleagues After reading in some clinical data, I discovered that the subject ID column contains entries only for the first record for each individual; subsequent rows are recorded as NA. For example: > 1 > NA > NA > NA > NA > 2 > NA > NA > NA > NA > 3 > NA > NA > ... I can think of various approaches to replace the NA values with appropriate
2005 Jan 17
2
Question about time series
I have data in the following format: > DATE [1] "01/13/2004" In order to find the difference between two data points, I presently use brute force to calculate the day of the year: > strptime(DATE, format="%m/%d/%Y")$yday [1] 12 Although this works, it may not be robust over different years. I assume that R is sufficiently clever that a much simpler approach
2008 Apr 11
3
strsplit and sapply
Colleagues, I have some text: TEXT <- c("a", "bb;ccc", "dddd;eeeee;ffffff") I want to retrieve the portion of each element before the first semicolon. I can split each element using strsplit: SPLIT <- strsplit(TEXT, ";") This yields: > SPLIT [[1]] [1] "a" [[2]] [1] "bb" "ccc" [[3]] [1] "dddd"
2023 Jan 16
1
Printing special characters
>>>>> Rui Barradas >>>>> on Mon, 16 Jan 2023 08:46:43 +0000 writes: > ?s 08:31 de 16/01/2023, Jeff Newmiller escreveu: >> Use the Cairo PDF device? >> >> On January 16, 2023 12:18:48 AM PST, Dennis Fisher >> <fisher at plessthan.com> wrote: >>> R 4.2.2 OS X >>> >>>
2008 Jul 29
1
Removing script file
Colleagues, (Running R 2.7.0) I have a script that I want to delete as it completes execution. The penultimate line of the script (before the quit command) is: file.remove("Scriptname") The script is executed as: R --no-save < Scriptname In OS X and Linux this is successful and returns: > > file.remove("x") > [1] TRUE and the file is deleted In Windows XP,
2008 May 10
2
Random number generation
Colleagues, I have encountered behavior of random number generation that eludes me. I generate a random integer in a particular range using the following code: sample(1000:9999, size=1) This code exists within a script that starts with the command: remove(list=ls()) Each time that I run the script, it yields the same random number: 6420. I thought that the problem might result from