search for: modifylist

Displaying 20 results from an estimated 33 matches for "modifylist".

2013 Jun 27
1
'modifyList' drops (not adds) NULL components
Dear list, Utils::modifyList() drops NULL components in its second argument, instead of adding them to the first argument. Compare: > modifyList(x=list(A=1), val=list(B=2, C=3)) $A [1] 1 $B [1] 2 $C [1] 3 > modifyList(x=list(A=1), val=list(B=NULL, C=3)) $A [1] 1 $C [1] 3 To me this seems inconsistent with the docum...
2017 Sep 11
4
show 0 at y axis in xyplot lattice
...plot(upper.zn + Zn2 + lower.zn ~ sdate | Location, type="b", as.table=TRUE, data=dat, pch=c(22, 21, 22), lty=c(2, 1, 2), ylim=c(0, 80), ?????? index.cond=list(c(3, 1, 2)), ylab="Percent (%)", par.strip.text=list(col="white", font=2, lines=1.5), ?????? lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)), ?????? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"), ?????? key=dat_key, scales = list(x = list(at = sdate, labels = format(sdate, "%b-%y&q...
2017 Sep 11
2
Σχετ: show 0 at y axis in xyplot lattice
...e")))) xyplot(upper.zn + Zn2 + lower.zn ~ sdate | Location, type="b", as.table=TRUE, data=dat, pch=c(22, 21, 22), lty=c(2, 1, 2), ?????? index.cond=list(c(3, 1, 2)), ylab="Percent (%)", par.strip.text=list(col="white", font=2, lines=1.5), ?????? lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)), ?????? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"), ?????? key=dat_key, scales = list(x = list(at = sdate, labels = format(sdate, "%b-%y&q...
2017 Sep 11
0
show 0 at y axis in xyplot lattice
...+ lower.zn ~ sdate | Location, type="b", > as.table=TRUE, data=dat, pch=c(22, 21, 22), lty=c(2, 1, 2), ylim=c(0, 80), > index.cond=list(c(3, 1, 2)), ylab="Percent (%)", > par.strip.text=list(col="white", font=2, lines=1.5), > lattice.options = modifyList(lattice.options(), > list(skip.boundary.labels = 0)), > par.settings=my.settings, col=c("red", "black", "red"), > fill=c("red", "black", "red"), > key=dat_key, scales = list(x = list(at = sdate, labels = > form...
2017 Sep 11
0
show 0 at y axis in xyplot lattice
...upper.zn + Zn2 + lower.zn ~ sdate | Location, type="b", > as.table=TRUE, data=dat, pch=c(22, 21, 22), lty=c(2, 1, 2), > index.cond=list(c(3, 1, 2)), ylab="Percent (%)", > par.strip.text=list(col="white", font=2, lines=1.5), > lattice.options = modifyList(lattice.options(), > list(skip.boundary.labels = 0)), > par.settings=my.settings, col=c("red", "black", "red"), > fill=c("red", "black", "red"), > key=dat_key, scales = list(x = list(at = sdate, labels = > form...
2017 Sep 12
2
Σχετ: show 0 at y axis in xyplot lattice
...e(seq(from = as.Date("2016-04-01"), to = as.Date("2017-04-01"), by = "quarter")), ? ? ? ylim=c(-5, 80), ? ? ? index.cond=list(c(3, 1, 2)), ? ? ? ylab="Percent (%)", #? ? ? par.strip.text=list(col="white", font=2, lines=1.5), #? ? ? lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)), #? ? ? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"), #? ? ? key=dat_key, #? ? ? scales = list(x = list(at = sdate, labels = format(sdate, "%b...
2017 Sep 12
0
show 0 at y axis in xyplot lattice
...(from = as.Date("2016-04-01"), to = as.Date("2017-04-01"), by = "quarter")), ylim=c(-5, 80), index.cond=list(c(3, 1, 2)), ylab="Percent (%)", # par.strip.text=list(col="white", font=2, lines=1.5), # lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)), # par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"), # key=dat_key, # scales = list(x = list(at = sdate, labels = format(sdate, &quot...
2017 Sep 12
0
Σχετ: show 0 at y axis in xyplot lattice
...016-04-01"), to = as.Date("2017-04-01"), by = "quarter")), > ? ? ? ylim=c(-5, 80), > ? ? ? index.cond=list(c(3, 1, 2)), > ? ? ? ylab="Percent (%)", > #? ? ? par.strip.text=list(col="white", font=2, lines=1.5), > #? ? ? lattice.options = modifyList(lattice.options(), list(skip.boundary.labels = 0)), > #? ? ? par.settings=my.settings, col=c("red", "black", "red"), fill=c("red", "black", "red"), > #? ? ? key=dat_key, > #? ? ? scales = list(x = list(at = sdate, labels = format(...
2008 Jul 05
3
Editing the "..." argument
Dear all, I'd like tweaking the ... arguments that one user can pass in my function for fitting a model. More precisely, my objective function is (really) problematic to optimize using the "optim" function. Consequently, I'd like to add in the "control" argument of the latter function a "ndeps = rep(something, #par)" and/or "parscale =
2012 Apr 20
1
How to make nice tiny sized figures on graphic devices producing scalable vector output?
...is being plotted on a device? windowsFonts(Arial=windowsFont("TT Arial")) cex <- .3 win.metafile("some.emf", 3.35, 2) data <- data.frame(y=rep(c("a","b","c"), each=10), x=runif(30)) bwplot(y~x, data, par.settings = modifyList( simpleTheme(cex=cex, lwd=cex), c( # theme.nopadding, axis.line=list(lwd=cex))), panel=function(...) { panel.bwplot(..., pch="|") # panel.mean(..., pch=16) }, cex=cex,...
2010 Dec 01
2
default arguments and '...' in a function
Dear R-users, I'm trying to work out a way to set default values for arguments in a function which includes the optional argument '...'. In practice, I have a 'plot' method for a function which specifies different types of plots. Every different plot should have different default arguments (for example for 'col', 'ylim' etc), plus the argument '...' to
2009 Aug 01
3
Transparency and trellis device
...to make that happen. I tried to play around with themes but to no avail. Any advise on the following example will be greatly appreciated: Thank you Sebastien #### library(lattice) df <- data.frame(a=rep(1:4,4), b=rep(1:4,4), c=rep(1:4,each=4)) settings <- standard.theme() settings <- modifyList(settings, list(background=list(alpha=1, col="transparent"))) str(settings) trellis.device(png, file="test.png", theme=settings) myplot<-xyplot(b~a|c, data=df) print(myplot) de...
2024 Apr 20
0
Fwd: passing a modified argument to an S3 method
...In my example below, I have shown how this can be done. I hope it approximates what you want to do. However, I second Jeff's recommendation that you do some reading on your own and **NOT** rely on my (probably flawed) interpretation, which just is meant to suggest what could be done (e.g. via ?modifyList) rather than point you to an exact or best solution. There are many good tutorials out there in addition to Jeff's suggestion that you can search for. ---------------------------------- control <- list (a=2, b=3, c= "hi there") ## list of all control parameters with defaults ## T...
2007 Feb 05
1
Build error with last R-devel tarball
...tFromNamespace, getS3method, glob2rx, head, head.matrix, help, help.search, help.start, history, index.search, install.packages, i nstalled.packages, limitedLabels, loadhistory, localeToCharset, ls.str, lsf.str, make.packages.html, make.socket, memory.limit, memory.size, menu, methods, mirror2html, modifyList, new.packag In addition: Warning message: S3 methods '[.getAnywhere', '[.roman', 'as.character.person', 'as.character.personList', 'as.characte r.roman', 'as.person.default', 'as.personList.default', 'as.personList.person', 'edit.d...
2006 Sep 15
3
An update method for lists?
Hi, since lattice uses nested lists in various situations, it has had an unexported function called updateList for a while, which looks like > lattice:::updateList function (x, val) { if (is.null(x)) x <- list() if (!is.list(x)) stop("x must be NULL or a list") if (!is.list(val)) stop("val must be a list") xnames <- names(x)
2010 Apr 29
1
time zone convert
Hi there, I've got a column vector in a csv file as follows, and I need to add 11 hours to each of them. Is there a way that I can do it? (The actual file size is much bigger than this.) Time "01-DEC-2008 00:00:28.611" "01-DEC-2008 00:00:43.155" "01-DEC-2008 00:01:06.677" "01-DEC-2008 00:01:06.677" "01-DEC-2008 00:01:06.677" "01-DEC-2008
2011 Apr 14
1
modify particular factor levels
...n(f, modify=list()){ ## levels that will not be changed names.old.levels <- setdiff(levels(f), unlist(modify)) ## as a named list old.levels <- as.pairlist(names.old.levels) names(old.levels) <- names.old.levels ## union of unchanged levels and modified ones levels(f) <- modifyList(old.levels, modify) f } f <- factor(LETTERS[1:4]) f2 <- modify.levels(f, list(aa = "A", cc="C")) It seems to work, but the original order of the levels is changed. Have I missed a better way of doing this manipulation? Best regards, baptiste
2011 Jun 26
1
Default values in control list of function
In building a function for a package, I'd like to set the defaults in a control list, e.g., makeg<-function(parameters, eps = 1.0e-7, control=list(showwork=TRUE, rubbish=1.0e+101)){ etc. } This does not provide showwork or rubbish within the function if control() is not fully specified. Copying others, I've previously set the control defaults within the function then matched
2013 Feb 27
0
Bordered legend icons and Text in plots
.... The output list does not return "fill" as one of its arguments, and was dropped whenever "key" was processed. 2. Giving multiple grobs to the 'inside' part of 'legend' only uses the first grob if you use update.trellis to provide them. This is caused by the way modifyList handles list elements with the same name (which is called by update.trellis), and can be worked around (see update.trellis.R). The issue without modification to your code can be seen in Notext.png (created by legend-text.R). Multiple grobs could still be given to 'inside' via the other m...
2008 Jul 21
0
xyplot: distance between axis and axis-label gets wrong
...jor.labels ans[[side]]$labels$labels[!major] <- "" ans[[side]]$labels$check.overlap <- FALSE ans } xyscale.components.log.custom <- function(...) { args <- list(...) function(...) { dots <- list(...) do.call("xyscale.components.log", modifyList(dots, args)) } } x <- 1:100 y <- x^3 xyplot(y ~ x, scales=list(log=T), xscale.component=xyscale.components.log.custom(side="bottom", loc=c(1,3,8)), yscale.component=xyscale.components.log.custom(side="left", loc=c(1,3,8)), ylab=expression(rho)...