Displaying 20 results from an estimated 9000 matches similar to: "Problem with plotting data from within a function"
2009 May 18
3
Parsing configuration files
Dear list,
Is there any functionality in R that would allow me to parse config files?
I have trie ??config and apropos('config') without succes, and also search
the R package site.
Mvh.
Marie
[[alternative HTML version deleted]]
2009 Jun 08
3
Combining elements of vectors
Dear list,
I have a vector of elements which I want to combined each with each, but
none with itself. For example,
> v <- c("a", "b", "c")
and I need a function 'combine' such that
> combine(v)
[[1]]
[1] "a" "b"
[[2]]
[1] "a" "b"
[[3]]
[1] "b" "c"
I am not very interested in the orders
2009 Mar 24
3
How to find the path or the current file?
Dear useRs,
I have a collection of source file and some of these call others. The files
are distribute among a number of directories, and to know how to call some
other file they need to know what file is currently executed.
As example, I have a file 'search.R' located in directory 'bin' which needs
to access the file 'terms.conf' located in the directory 'conf',
2009 Jan 22
2
Unexpected behaviour of the as.Date (was: Error as.Date on Invalid Dates)
Dear Brian,
I dont understand what you mean. The thread was about the as.Date which you
suggested to be used instead of the as.date. Following your advice I tried
the as.Date and have questions about the observed behaviour, which was
surprising to me. Is this what you call hijacking? Do you mean I ought
start a new thread instead? I thought my question were relevant to the
threads'
2009 Feb 25
1
Problems with ARIMA models?
Dear R,
I have find a website where they report problem with ARIMA models in R. I
run the examples there and they give result as shown on the website. Does
this mean that nothing has corrected in R? Maybe you not have seen the
page, but the author said he contacted you.
Here is the URL: http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm
I like to know your opinion.
Mvh.
Marie
[[alternative
2009 Feb 25
1
Problems with ARIMA models?
Dear R,
I have find a website where they report problem with ARIMA models in R. I
run the examples there and they give result as shown on the website. Does
this mean that nothing has corrected in R? Maybe you not have seen the
page, but the author said he contacted you.
Here is the URL: http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm
I like to know your opinion.
Mvh.
Marie
[[alternative
2008 Dec 05
1
Problems with lattice-histograms or png within loops
Dear R-users,
I have a question concerning the use of lattice plots within for-loops.
I want to create a png file containing a lattice histogram which works out
fine (part 1).
When I loop the whole code, the graphic file does not contain anything (part
2).
I can fix it by wrapping the histogram function into a print command (part
3).
Why is that so? Why can I not loop it directly?
TIA,
Mark
2010 Feb 17
2
Problems with xyplot
Hello
I wonder whether someone can tell me what I am doing wrong. Here is the
code (from Bayesian Computation with R - Chapter 2.3.R) that I am trying to
run
####################################
# Section 2.3 Using a Discrete Prior
####################################
graphics.off() # Close all graphics
rm(list=ls()) # Clear all variables
library(LearnBayes)
2011 Feb 28
1
Creating Boxpot with R within bash script
I will confess to being very wet behind the ears when it comes to scripting, so with that as a backdrop, here is my question. I can create a box and whisker plot without any problem from the command line, but incorporating that process into a bash script has proved problematic. Below is the portion of the bash script that fails:
R --save --no-save --vanilla << EOF
CAPE.df =
2012 Jan 19
3
Not generating line chart
Hi All,
Can you please help me, why this code in not generating line chart?
library(ggplot2)
par(mfrow=c(1,3))
#qplot(TIME1, BASCHGA, data=Orange1, geom= c("point", "line"), colour= ACTTRT)
unique(Orange1$REFID) -> refid
for (i in refid)
{
Orange2 <- Orange1[i == Orange1$REFID, ]
pdf('PGA.pdf')
qplot(TIME1, BASCHGA, data=Orange2, geom= c("line"),
2010 Apr 04
2
One question about saving graph by using xyplot
Hey, folk.
I am trying to get many figures by using the function "xyplot" in the library "lattice". I tried to using the loop to finish it quickly. But I cannot open the saved file after I run the program. But if I use the function "plot" to get other simply figures, it can work. So I want to ask how I can get the saved figures by using "xyplot".
The
2009 Nov 25
1
lattice: plotting in a loop
Hi,
I'm having trouble seeing graphics output from lattice xyplot() when called
from inside a for loop:
x <- 1:50
for ( i in 1:5 ) {
y <- rnorm(x)
xyplot(y~x) # no graphics when inside for-loop
# plot(x,y) # works fine
# Sys.sleep(0.5) # doesn't seem to help
}
The xyplot() is fine outside the loop. Results are the same to X11 device
and to file
2008 Dec 31
2
Lattice trellis.focus() with pdf
Hi,
I have a the code for a plot that works perfectly running in R and
printing to a Quartz object but which doesn't work when I make the
trellis device a pdf.
The code is as follows:
----
trellis.device(device="pdf", new=TRUE)
trellis.par.set(my.theme())
dotplot(Y ~ X | C, groups=G, data=D, layout=c(2,1), ... )
trellis.focus("panel", 1, 1)
for (y in 1:5) {
2006 Aug 16
1
bwplot in loop doesn't produce any output
Hi,
running the following code by itself runs as expected.
----------------------------------------------------------------------------
k <- 1
i <- 2
j <- 3
NumName <- varnames[num.cols[k]]
FacNames <- varnames[fac.cols[c(i,j)]]
tmp <- paste(FacNames[1],NumName,sep="~")
fml <- formula(paste(tmp,FacNames[2],sep="|"))
bwplot(fml, data
2006 May 02
1
Call trellis function in a function (PR#8827)
Full_Name: Fan
Version: 2.2.1
OS: Windows
Submission from: (NULL) (159.50.101.9)
Hello,
When I call trellis function (such as histogram, densityplot, etc.) in a
function,
the call seems being ignored (no graphics is drawing) if some other instructions
are placed afeter that call.
Here's an example:
y = rnorm(100*3)
b = sample(1:3,300,replace=T)
f = function()
{
densityplot(~y|b)
}
2004 Dec 10
1
lattice graphics empty in Sweave
Hello,
I have problems using lattice graphics together with Sweave under
Windows XP and R 2.0.0; 2.0.1 Patched; 2.1.0 devel respectively.
Base graphics are o.k., but for lattice graphics empty files (.eps and
.pdf) are generated.
The only workaround I found was to write and read the respective figures
explicitely using postscript() and includegraphics{}.
Have I missed something to solve this
2006 Oct 23
1
Color eps/ps output from specialized plots?
Hello,
First a disclaimer :) I am very new to using R.
I am generating some plots and eventhough I can get colored output in the encapsulated postscript files in the simplest of commands (e.g. plot(1:10,1:10, type="l", col="red") ), it does not work for the particular plots I want. It works on the screen.
Here is an example taken out from "Mixed-Effects Models in S and
2007 Feb 14
1
lattice graphics and source()
Hi,
I am trying the lattice graphics in R. Let's say, such a little
experiment in file myprog.r:
f <- function(){
x <- 1:10
y <- x^2
xyplot(y ~ x)
}
f()
Then I run the program:
> source("myprog.r")
but nothing happens. Manully run f() at the command line:
> f()
then the figure is shown. This seems to be a bug only associated with
lattice graphics, the
2007 Apr 24
2
xyplot source file only work with echo=TRUE
Hi,
I write several xyplot graphics on a source file. When I try to use
source("graphics.R") the source don't work, but if I use
source("graphics.R",echo=T) it work. Generally some commands work without
echo=T, but xyplot dont work. Why it dont work without echo=T? It is possible
to write a source that dont need echo=T on source command?
Thanks
Ronaldo
--
Aluno de
2007 Oct 09
2
bug: wireframe and tcltk
Dear R users,
When i call the wireframe function from within a tcltk widget, it does
not work.
Here is a sample program that shows the bug.
When you try:
is.it.a.bug()
You can see that the "curve" instruction is run but not the "wireframe" one.
Do you have an explanation about this point?
Best regards,
Pierre Lafaye de Micheaux
--
Pierre Lafaye de Micheaux
Bureau