Displaying 20 results from an estimated 800 matches similar to: "WISHLIST: on.exit(..., add=TRUE, where="first") to address common use cases"
2001 Sep 27
2
on.exit
Hola!
look at the following:
> test <- function() {
+ options(warn=-1)
+ on.exit( options(warn=0))
+ log(-1)
+ }
> test()
[1] NaN
but what should be better, doesnt work:
> test1 <- function() {
+ oldwarn <- options("warn")
+ options(warn=-1)
+ on.exit( options(warn=oldwarn))
+ log(-1)
+ }
> test1()
Error in options(...) : warn parameter
2001 Aug 28
1
Subsetting simulation output
Does anyone understand this?
I have a long vector parlist containing values of 138 parameters in 100
simulations.
The factor parno is defined by
trys <- 100
sim <- gl(trys,138)
parno <- gl(138,1,trys*138)
I want to extract and compare results for related groups of parameters but I
get inconsistent results:
> length(parlist[parno==37:42])
[1] 600
>
2009 Apr 26
7
Bumps chart in R
Hi there,
I would like to make a 'bumps chart' like the ones described e.g.
here: http://junkcharts.typepad.com/junk_charts/bumps_chart/
Purpose: I'd like to plot the proportion of people in select countries
living for less then one USD pr day in 1994 and 2004 respectively. I
have already constructed a barplot - but I think a bumps chart would
be better
# The barplot and data
2009 Feb 03
3
non linear regression with nls
Hello,
I'm a beginner with R and it's the first time I'm using the R-help list... I hope I'm in the right place, if not:
Sorry!!
I need to do non linear regressions on a data set which columns are:
"river.name" "Portata" "PTG.P" "PO4.P" "NT.N" "NH4.N" "NO3.N" "BOD5" "SiO2"
2000 Sep 07
3
plot with two y axes
I'm trying to make a transition from S-plus under Windows to R under
Linux. My immediate aim is to produce a scatter plot with two y-axes
with different scales. That can be done in S-plus with a command of the
following form:
guiPlot( PlotType="Scatter", DataSet="execon",
Columns="years,hstart,ship", AxisType="Multiple Y" ),
where years, hstart, and
2006 Jul 03
2
could i change the ouput style on summary?
Dear friends,
summary() doesn't give a good ouput style,e.g.:
grass soiltem airtem gheight
humidity altitude
diluo :38 Min. :15.90 Min. :17.70 Min. : 8.00 Min. :
0.2360 high: 43
huanghuacai:32 1st Qu.:19.32 1st Qu.:22.60 1st Qu.:40.00 1st Qu.:
0.3190 low :119
hucao :46 Median :20.20 Median :25.30 Median :60.00
2000 Oct 03
1
captions for than one figure
Hi,
I would like to have four plots plotted in the one figure and under each plot
the caption (a) ... (d). Using mtext I can get so far:
> plot(1:10, exp(1:10), log = "y", xlab = "xlab")
> mtext("(a)",side=1,line=4.5)
> plot(1:10, exp(1:10), log = "y", xlab = "xlab")
> mtext("(b)",side=1,line=4.5)
> plot(1:10,
2010 Jan 20
2
legend in multiple plot
Dear R users,
I'm making multiple plots within the same pdf page (par(mfcol = c(5,1)), and
want a legend for this at the bottom of all the plots. From previous mails
it has been suggested to use par(xpd=TRUE), increase the margin at the last
plot, and then draw the legend. However, when I do this, the last plot gets
smaller with the same amount I increase the margin with.
The problem seems to
2012 Apr 27
3
kiteChart to show real values with scalebar
Dear R-users
I hope someone could help me on this problem.
I want to create a multiple kiteChart showing the real values with a
scalebar on each indicating the scale .
Here are some sample data to show what I want to achieve.
Y <- read.table(textConnection("Sample1 Sample2
60 20
150 50
300
2012 May 12
2
range segment exclusion using range endpoints
Hello,
I'm posting this again (with some small edits). I didn't get any replies
last time...hoping for some this time. :)
Currently I'm only coming up with brute force solutions to this issue
(loops). I'm wondering if anyone has a better way to do this. Thank you for
your help in advance!
The problem: I have endpoints of one x range (x_rng) and an unknown number
of s ranges
2001 Sep 10
1
on.exit processing
I have encountered a 'strange' behavior in the 'on.exit' processing. I had
a function where I setup an 'on.exit' condition and then later on added to
it with an 'on.exit({...}, add=T)'. What appeared to happen is that on
subsequent calls to the function, even if only the first 'on.exit' was
called, it was still executing the one with the 'add=T'.
2006 May 01
0
wishlist: summary for regression models to report number of omitted cases because of NAs (PR#8824)
Full_Name: Ulrike Gr?mping
Version: 2.3.0
OS: Windows
Submission from: (NULL) (84.190.150.205)
Whenever any observations are excluded from a regression analysis (lm, glm, and
other similar procedures) because of missing values, I would find it very useful
if this fact is directly visible from the output. I think that the information
should not only be available (I can e.g. look at length of the
1999 Sep 27
0
text( col=, cex=, font=) : doesn't allow more than length-1 arg (PR#287)
text(..., col = <..>) doesn't work if col has length more than one;
and the same for 'cex' and 'font'
A toy example, showing what is desired
plot(1);text(1.2, .8+(0:5)/16, LETTERS[6:1])
## works alright
plot(1);text(1.2, .8+(0:5)/16, LETTERS[6:1],col=1:6)
##>>> Error in par(args) : parameter "col" has the wrong length
---
Explanation:
The source
1998 May 24
1
R-beta: problem with graphics parameter "fin"
Hi,
I have the following problem (with R 0.61.3 an Linux, and a new and empty
workspace)
> oldpar<-par()
> par(oldpar)
Error: attempt to set invalid value for graphics parameter "fin".
> oldpar$fin
[1] 6.992034 6.990803
but now:
> oldpar$fin <- c(6.99,6.99)
> par(oldpar)
it works.
It seems, that if I set oldpar$fin to values greater than listed above
2005 Apr 29
2
Automating plot labelling in custom function in lapply() ?
Dear List,
Consider the following example:
dat <- data.frame(var1 = rnorm(100), var2 = rnorm(100),
var3 = rnorm(100), var4 = rnorm(100))
oldpar <- par(mfrow = c(2,2), no.readonly = TRUE)
invisible(lapply(dat,
function(x) {
plot(density(x),
main = deparse(substitute(x))) }
)
)
2006 Oct 08
2
Size problem with two dotcharts side by side
Dear all,
I'm trying to produce two dotcharts side-by-side within a Sweave
document. When I'm compiling this example:
\documentclass{article}
\begin{document}
<<fig=T,width=8,height=4>>=
par(mfrow = c(1, 2), cex = 0.7)
for(i in 1:2) dotchart(1:10)
@
<<fig=T,width=8,height=4>>=
par(mfrow = c(1, 2), cex = 0.7)
for(i in 1:2) hist(1:10)
@
2016 Apr 21
2
clock24.plot/radial plot
Dear All,
I am trying to generate a circular/radial plot. The script below has a
result I am looking for:
testlen<-rnorm(24)*2+5
testpos<-0:23+rnorm(24)/4
clock24.plot(testlen,testpos,main="Test Clock24 (lines)",show.grid=FALSE,
line.col="green",lwd=3)
if(dev.interactive()) par(ask=TRUE)
# now do a 'daylight' plot
2010 Mar 09
3
Fine Tuning Plotrix
Dear All,
Please see the code snippet at the end of the email.
I am using the color2D.matplot in Plotrix to plot a matrix.
It works great, but there are a few things I cannot figure out
(1) the value of cex.axis in the code snippet does not seem to affect
the final pdf at all (at least on my system, Ubuntu 9.10, plotrix and
Cairo installed from cran). How do I specify the size of the axis ticks
2008 Dec 07
4
Finding the first value without warning in a loop
Dear R useRs,
with the following piece of code i try to find the first value which can
be calculated without warnings
`test` <- function(a)
{
repeat
{
## hide warnings
suppressWarnings(log(a))
if (exists("last.warning", envir = .GlobalEnv))
{
a <- a + 0.1
## clear existing warnings
rm("last.warning", envir = .GlobalEnv)
}
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",