Displaying 20 results from an estimated 5000 matches similar to: "Need to compute density as done by panel.histogram"
2011 Jul 27
1
How to adjust y-axis when using panel.densityplot within histogram function
Hi
I would like to superimpose group-specific densityplots on top of an overall
histogram using panel.histogram and panel.densityplot. Furthermore, I would
like to automatically adjust the range of the y-axis to take into account
the ranges of both histogram and densityplot. This last part is where I have
a problem. I believe using the prepanel argument of histogram is typically
the way to go,
2007 Nov 16
1
graphics - line resolution/pixelation going from R to windows metafile
I have a recurring graphics issue that I've not been able to resolve with
R. If I make a series of regression estimates and then plot the estimated
function for the regression lines over a scatter plot of the data, e.g.,
using a sequence of plot( ) and lines ( ) similar to those below
2004 Aug 15
3
Stacking Vectors/Dataframes
Hello,
Is there a simple way of stacking/merging two dataframes in R? I want to
stack them piece-wise, not simply add one whole dataframe to the bottom of
the other. I want to create as follows:
x.frame:
aX1 bX1 cX1 ... zX1
aX2 bX2 cX2 ... zX2
... ... ... ... ...
aX99 bX99 cX99 ... zX99
y.frame:
aY1 bY1 cY1 ... zY1
aY2 bY2 cY2 ... zY2
... ... ... ... ...
aY99 bY99 cY99 ...
2013 Mar 15
5
Data manipulation
Hello all,
I would appreciate your thoughts on a seemingly simple problem. I have a
database, where each row represent a single record. I want to aggregate this
database so I use the aggregate command :
D<-read.csv("C:\\Users\\test.csv")
attach(D)
by1<-factor(Class)
by2<-factor(X)
W<-aggregate(x=Count,by=list(by1,by2),FUN="sum")
The results I
2013 Mar 12
1
Fine control of plot
Hi everyone.
I'm trying to create a graph where I could plot some lines on the right side. Here an example:
layout(matrix(c(1,2), 1, 2, byrow = TRUE), widths=c(6,2), heights=c(1,1))
x = 1:100y = rnorm(x)+xplot(x,y)
reg = lm(y~x)abline(reg, col = "red")
plot(1, type="n", axes=F, xlab="", ylab="", xlim = c(-1,1), ylim = c(min(y),
2012 Mar 23
2
show and produce PDF file with pdf() and dev.off( ) in function
Hi all,
I know how to use pdf() and dev.off() to produce and save a graph.
However, when I put them in a function say
myplot(x=1:20){
pdf("xplot.pdf")
plot(x)
dev.off()
}
the function work. But is there a way show the graph in R as well as saving
it to the workspace?
Thanks.
casper
-----
###################################################
PhD candidate in Statistics
School
2014 Mar 19
2
Posible error en la documentación de "aggregate"
Hola compañeros, estaba utilizando la función "aggregate" y quería que
tuviese en cuenta los NAs. He leido la documentación de dicha función y
aparece esto:
# and if you want to treat NAs as a group
fby1 <- factor(by1, exclude = "")
fby2 <- factor(by2, exclude = "")
aggregate(x = testDF, by = list(fby1, fby2), FUN = "mean")
2006 Jul 02
4
Test for argument in ...
Hello!
Say I have a function foo1, which has argument ... to pass various
arguments to foo2 i.e.
foo1 <- function(x, ...)
{
foo2(x, ...)
}
Say that foo2 accepts argument arg1 and I would like to do the following:
- if foo1 is called as foo1(x) then I would like to assign some value to
arg1 inside foo1 before calling foo2
arg1 <- "some value"
foo2(x, arg1=arg1)
- if foo1 is
2015 Dec 17
2
Multiple IPs and hostname
Hi,
I'm running postfix as SMTP-server and dovecot as IMAP-server.
The server has multiple IPs, and postfix is configured that every domain
is using a separate IPv4-address.
Examle:
foo1.com --> 11.22.33.44
foo2.com --> 22.33.44.55
foo3.com --> 33.44.55.66
bar.org --> 66.77.88.99
The hostname of the server is: mail.bar.org
Now I have a request from one of my customers,
2004 Apr 15
1
tapply() and barplot() help files for 1.8.1
Hi,
I've just upgraded to 1.9.0 and one of my Sweave files that produces a
number of barplots in a standard manner now produces them in a
different way. I have made a couple of small changes to my code to
get the back the output I was getting before upgrading and now (mostly
out of curiosity) would like to understand what has changed.
I *think* I've tracked it down to tapply() and/or
2010 Apr 27
1
suggestion on method dispatch
Dear all, I have define a function and its methods as follows:
######## beginning of code
fn <- function(x,...){
UseMethod("fn")
}
fn.foo1 <- function(x, commonA=1, ...){
print("fn.foo1 is called.")
}
fn.foo2 <- function(x, uniqueFoo2, common=1, ...){
## uniqueFoo2 is a unique argument in fn.foo2
x <- uniqueFoo2; class(x) <- "foo1"
## use uniqueFoo2
2006 Apr 11
2
About list to list - thanks
Thank you very much for your useful suggestions.
These are exactly what I was looking for.
foo <- list(foo1, foo2, foo3)
lapply(foo, function(x) matrix(unlist(x), nrow = length(x), byrow = TRUE))
or
lapply(foo, function(x) do.call('rbind', x))
Best, Muhammad Subianto
On 4/11/06, Muhammad Subianto <msubianto at gmail.com> wrote:
> Dear all,
> I have a result my experiment
2018 Apr 05
1
potential file.copy() or documentation bug when copy.date = TRUE
This is a recent R-devel. file.copy() is not vectorized if multiple
destinations succeed:
cat("foo1\n", file = "foo1")
cat("foo2\n", file = "foo2")
unlink(c("copy1", "copy2"), recursive = TRUE)
file.copy(c("foo1", "foo2"), c("copy1", "copy2"), copy.date = TRUE)
#> Error in
2010 Nov 15
2
How to move an internal function to external keeping same environment?
Hi
I have within a quite big function foo1, an internal function foo2. Now,
in order to have a cleaner code, I wish to have the internal foo2 as
"external". This foo2 was using arguments within the foo1 environment
that were not declared as inputs of foo2, which works as long as foo2 is
within foo1, but not anymore if foo2 is external, as is the case now.
Now, I could add all those
2006 Apr 11
2
About list to list
Dear all,
I have a result my experiment like this below (here my toy example):
foo1 <- list()
foo1[[1]] <- c(10, 20, 30)
foo1[[2]] <- c(11, 21, 31)
foo2 <- list()
foo2[[1]] <- c(100, 200, 300)
foo2[[2]] <- c(110, 210, 310)
foo3 <- list()
foo3[[1]] <- c(1000, 2000, 3000)
foo3[[2]] <- c(1100, 2100, 3100)
list(foo1,foo2,foo3)
The result:
> list(foo1,foo2,foo3)
[[1]]
2014 May 02
1
Authors@R: and Author field
Hi to all
Authors@R: c(person("fooa","foob", role = c("aut","cre"),
email = "fooa.foob@fooc.de"),
person("foo1","foo2", role = c("ctb"),
email = "foo1.foo2@foo3.de"))
Author: fooa foob, with contributions from foo1 foo2
using r CMD check --as-cran .. (R 3.1
2012 Jul 27
1
C code validation
Dear R-devel,
I'm trying to validate the results from a C function, against a (trial
and tested) older R function. For reasons unknown to me, the C
function seems to give different result sometimes at each trial, even
with the very same data.
These are the relevant outputs from R:
> library(QCA)
Loading required package: lpSolve
> benchmark <- function(x, y) {
+ index <- 0
2012 Oct 17
1
Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?
Hi,
although I've done S3 dispatching for more than a decade now, I think
I managed to overlook/avoid the following pitfall when using
NextMethod():
If you explicitly pass argument '...' to NextMethod(), you will
effectively pass those argument twice to the "next" method!
EXAMPLE:
foo0 <- function(...) UseMethod("foo0");
foo1 <- function(...)
2004 Mar 29
0
Global assignment with S4 objects in R 1.9.0 beta
Hi,
some change during the last 10 days breaks code where slots of an
object are changed globally:
setClass("mylist", contains = "list")
setClass("dummy", representation = representation(
a = "mylist"))
foo1 = function(i, x) {
mydummy@a[[i]] <<- x ### change a slot
}
foo2 = function() { ### define an object
mydummy <<-
2014 Dec 08
2
CRAN packages mis-using \donttest : falsy
On Mon, Dec 8, 2014 at 3:32 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
[...]
> Why not declare colorspace as a "Suggests:" kind of dependency?
I guess that is a solution. :/
In another example in the 'disposables' package I have:
\donttest{
pkg <- make_packages(
foo1 = { f <- function() print("hello!") ; d <- 1:10 },
foo2 = { f