but
I kinda like brute force:
aspectObjective <- function(height, width, target, ...) {
tmp <- tempfile()
pdf(tmp, width = width, height = height, ...)
print(trellis.last.object())
asp <- currAspect()
dev.off()
file.remove(tmp)
abs(asp - target)
}
print(foo)
height &l
I almost always supply my own aspect ratio when plotting using
lattice. When I plot these to pdf, I would like to specify pdf
dimensions that will result in minimal margins around the plot. In my
application, resorting to a pdf cropper after plotting is not an
option - I must do it in R.
Are X1 and X2 both numeric? You might want to get them on equivalent
scales, and also play around with the smoothing parameter.
Try something like:
fit <- locfit(Y ~ lp(X1, X2, nn=___, scale=TRUE), family="binomial")
and see what happens for different values of nn (try values between 0
and
>
> If however I wanted to call the function "densityplot" within a function and
> pass the "groups" argument as an argument of that function, how would I have
> to proceed? It is not as straightforward as
>
> f <- function(data, groupvar) {
> densityplot(~ x, data, groups = groupvar)
> }
>
Trying your example:
y <- numeric(365) y y[250] = 1 y
y.stl <- stl(ts(y, frequency=7), s.window="periodic")
First of all, pay attention to the axes on your plot - the scales are
different for each panel. Your seasonal component is quite small in magnitude
compared to everything else.
Also, if
5 matches
Mail list logo