Displaying 20 results from an estimated 5000 matches similar to: "dev.off() inside a function & other glitches"
2008 Aug 04
1
subset inside a lattice plot using panel.lines
Hi R people
Pulling my hair out here trying to get something very simple to work.
Have a data frame of 774 rows and want to plot first and second half
on same axes with different colours. A variable is present call 'row'
created like this and checked to be OK:
row <- seq( len=length( variable1 ) )
...so I just want to plot the two subsets where row <= 387 and where
row
2010 Sep 24
1
Some questions about string processing
Hi all
A couple of questions about string processing from someone who has only scratched the surface so far.
1) I am wanting to send some strings into a function to allow flexibility inside. My first idea has been e.g.
auto_io <- function( var_string, factors ) {
# e.g. var_string sent as "test_file.txt" factors sent as "x1 + x2 + x3"
# input
data_name <- get(
2011 Jun 25
3
How to export to pdf in landscape orientation?
Does anybody know how to get a pdf file with landscape orientation?.
pdf(file= 'my_file.pdf' ,onefile=T,paper='A4')
plot(sin, -pi, 2*pi)
dev.off()
Thank's in advance
Juan A. Hernandez
Spain
[[alternative HTML version deleted]]
2013 Mar 21
2
How to store data frames into pdf file and csv file.
Hello,
I have a data frame
> mdl.summary
est.coef std.err t.stat
intercept 0.0011625517 0.0002671437 4.351784
aa -0.0813727439 0.0163727943 -4.969997
dummy1 -0.0002534873 0.0001204000 -2.105376
dummy2 -0.0007784864 0.0001437537 -5.415417
bb -0.0002856727
2008 May 06
1
ggplo2: x_discrete labels size/direction
Hi everyone,
I've got quite a few labels along the x axis and ggplot2 basically just
crams them on top of each other.
Is it possible to reduce the font size and/or text direction?
Stretching the "windows" device window manually also helps, but I found that
setting the parameters for the pdf device (where my scripts should print the
data), such as paper="a4r" just results
2003 Sep 10
6
insert eps into microsft word
it seems that word can not read encapsupalted postscripts generated by R
I used this command
postscript("output.eps",horizontal=F,onefile=TRUE)
since onefile=TRUE produces an encapsualted postscript
actually what I'm trying to do is to insert the postsript file into a
word document
since other formats like jpeg and bmp do not reproduce the same quality
like postscript
formats
any
2008 May 26
2
R 2.7.0: pdf() > pdf.options versus formals
Hi,
I have a tiny question about the graphics change in R 2.7.0.
If I write a script ? la:
options(device="pdf")
formals(pdf)[c("file","onefile","width","height")] <- list("~/Rplot
%03d.pdf", FALSE, 8, 8)
plot(3)
plot(4)
both plots will be written into ONE pdf file. (not two as expected)
This worked fine under 2.6.x
In R 2.7.0 I
2000 Jun 16
1
postscript device on R-1.1.0
Am I the only one with this problem?
> postscript()
Error in old$command == "default" : comparison (1) is possible only for
vector types
The function postscript() is creates a list called "old". the function
wants to access old$command, but old does not have a component called
command.
> postscript
function (file = ifelse(onefile, "Rplots.ps",
2011 Oct 27
1
plotting large time series
hello,
I got a problem with plotting large time series, since I want to store
the results in a .PDF file (I want to store several pages of plots). The
PDF files get too large to be handled (> 10MB, one was even 200MB big).
So I wonder, if there would be a possibilty to either
- reduce the file size of the PDF
- change the way the plot is generated to reduce the plot size?
I use:
2003 Oct 17
3
Strange behaviour
As an absolute beginner I'm reading and practicing with the Verzani doc to learn R.
Now, being an expert latex user who wants to integrate graphical capabilities if R and latex, using the "Simple" library and the simple.scatterplot examples I had a go at:
1) Including the resulting graph into a doc.snw then compiled through sweave & latex;
2) Produce the graph in pdf format
2003 Jan 08
2
Problem with fontsize of pie-chart in postscript file
Hi all,
I've a problem with the size of the labels of my pie-charts when I try to
write them to a postscript file. I need to increase the default size, so I
change cex (see below). On screen this works fine, but cex doesn't seem to
affect the postscript-file. Any suggestions?
Thanks a lot,
Daniel
Copy/Past-example (will try to write to c:/temp!):
labels <- c("I",
2002 Dec 27
2
RSvgDevice & sapply(plotmeans)
Hi,
anybody know why this not works for several
plots ?
When i set onefile=T the plots are stacked one about another
, onefile=F only the first plot is shown in AllbusMeansPlots.svg.
[h2 is a data.frame]
......hist and sapply works for several plots nice with RSvgDevice !
Maybe setting the title after apply is a problem, but until yet i didn't
found a better solution ?
library(RSvgDevice)
2009 Jan 19
1
patch for textspecial and defaultfont in xfig
Hello,
The current xfig device lacks the functionality to set the
textspecial flag and use the defaultfont in xfig. This is necessary
when you want to export to xfig and use interpreted text (e.g., $
\frac{1}{e}$ gets interpreted by latex). The attached patch adds this
functionality.
Why would you like to do this?
- Use math in labels (e.g., name your variables $r_{xy}$, do a
2012 Feb 06
1
Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?
Hi all. I want to generate a sequence of n plots and save them into a single PDF file, one plot per page. From the R docs and other sources I gather the basic way to do this is save plot 1 into a file then append the 2:n plots to the same file.
This code shows my basic approach, but for some reason only the last plot is saved into the pdf. I've tried different variations (e.g. using onefile
2007 Dec 06
3
Defaults for postscript()
The defaults for postscript()
paper = "default"
onefile = TRUE
horizontal = TRUE
(it seems) date from the days when people used to used this to send plots
directly to a postscript printer via print.it=TRUE. I haven't done that
for years, and it seems that our current generation of students don't even
know the concept. It seems 'horizontal = TRUE' is particularly
2010 Nov 16
1
problem with PDF/postcript, cannot change paper size: "‘mode(width)’ and ‘mode(height)’ differ between new and previous"
Hi,
The pdf function would not let me change the paper size and gives me
the following warning:
pdf("figure.pdf", width="6", height="10")
Warning message:
?mode(width)? and ?mode(height)? differ between new and previous
==> NOT changing ?width? & ?height?
If I use the option paper = "a4r", it does not give me a warning
but still prints on a
2012 Jul 18
2
loop searching the id corresponding to the given index (timestamp)
Hello,
I have the following loop for two data sets: diveData_2008 and
diveData_2009. It uses two other data: diveCond_all and fishTable. The
problem is at the point to identify the dive_id for the given index (index
is timestamp). It keeps on saying
for the1st loop
Error in fishReport$dive_id[i] <- dive_id : replacement has length zero
for the 2nd loop
Error in fishReport$dive_id[i + j] <-
2010 Jul 16
8
save plot
I made a plot, but after I made a second plot, the previous plot was
gone. How can I save all the plots in a file (I do not manually copy
and paste them one by one)?
Thanks.
Linda
2000 Feb 04
2
terminating plot
This script (in Version 0.90.1 [Solaris]):
postscript (file="test.eps",onefile=F)
par (mfrow=c(3,1))
plot (1:10,rep(1,10))
plot (1:10,rep(1,10))
plot (1:10,rep(1,10))
frame()
does not terminate the plot. Rather it gives the message:
Warning message:
multiple pages used in postscript() with onefile=FALSE
and the plot is only complete after quitting R.
Is there some
2005 Sep 21
2
controlling usage of digits & scientific notation in R plots; postscript margins
Dear R users:
I assigned students to make some graphs and I'm having trouble answering
some questions that they have. We are all working on R 2.1 on Fedora
Core Linux 4 systems.
1. In the plot, the axis is not labeled by "numbers", but rather
scientific notation like "-2e+08" or such. We realize that means
-200,000,000. We want to beautify the plot. We would rather