Displaying 20 results from an estimated 800 matches similar to: "Why my lapply doesn't work with FUN=as.Date"
2008 Nov 19
2
Exclude holidays in a subset of dates?
Hi All,
I am iterating through dated materials, with variable start and end dates,
and would like to skip procedures everytime I encounter a weekend or
holiday. To do this, I thought the easiest way would be to create a
TRUE/FALSE vector corresponding to each day where it is TRUE if a workday,
and FALSE if a weekend or holiday.
So far I have been able to do this for weekdays:
startDate <-
2003 May 14
2
number of patients in a hospital on a given date
Dear R-users!
I am using R 1.7.0, under Windows XP.
Having some hospital discharge data (admission date and discharge date for
each patient), I want to get the number of patients in the hospital on a
given date.
My data look like (simple example):
> x <- data.frame(patid=c("pat1", "pat2"), adm.date = c("15.03.2002",
"16.03.2002"),
2013 Sep 12
1
[LLVMdev] Issues with test framework as seen from OpenBSD buildslave
Hi,
So now that the OpenBSD buildslave has been upgraded with enough memory
to allow the build to finish I have noticed some issues with the test
framework and was wondering if anyone could comment on what has shown up
and/or anyone who is familiar with the framework could provide patches
to fix the issues.
For sed and head the tests are using command line options which are not
specified by
2009 Sep 07
1
Plot 2 ecdf in one graph
Hi r-users,
I would like to compare the cdf between historical and predicted. My x.obs and x.pre are the frequency data in classes of 0-300.
I tried:
plot(ecdf(x.obs),ecdf(x.pre),type="l",col="red")
and it gives me:
Error in plot.stepfun(x, ..., ylab = ylab, verticals = verticals, pch = pch) :
argument 4 matches multiple formal arguments
Thank you so much for any
2008 Aug 14
2
Department of Redundancy Department.
I just noticed a certain ``usage'' in a recent posting, and couldn't
restrain my self from commenting. The usage was of the form
``if(X==TRUE)''
where X was a logical variable.
This sort of thing is brought to you by your Department of Redundancy
Department. The ``==TRUE'' bit is irrelevant, incompetent, and
immaterial,
as Perry Mason used to say. The value of
2017 Oct 07
0
[FORGED] bootstrapping results in table format
On 07/10/17 12:16, Peter Wagey wrote:
> Hi R users,
> I was struggling to put the results into table format. Would you mind to
> show using following data and code how we can put the results into table? I
> further would like to have a confidence interval for each group.
>
>
> set.seed(1000)
> data <- as.data.table(list(x1 = runif(200), x2 = runif(200), group =
>
2010 Dec 02
1
parLapply - Error in do.call("fun", lapply(args, enquote)) : could not find function "fun"
Hello everybody,
I've got a bit of a problem with parLapply that's left me scratching my head
today. I've tried this in R 2.11 and the 23 bit Revolution R Enterprise and
gotten the same result, OS in question is Windows XP, the package involved
is the snow package.
I've got a list of 20 rain/no rain (1/0) situations for these two stations i
and j, all the items in this list look
2005 Oct 27
1
Puzzled over curve() syntax.
It's probably toadally elementary (and, like, duhhhhh) but
I can't figure out why the following doesn't work:
curve(function(x){qnorm(x,4,25)},from=0,to=1)
I get the error:
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' and 'y' lengths differ
But if I do
foo <- function(x){qnorm(x,4,25)}
curve(foo,from=0,to=1)
it goes like a train.
Also
2005 Mar 18
4
passing arguments to FUN in lapply
Suppose I have a nx2 matrix of data, X, the following code generate
density estimation for each column and plot them
denlist <- apply(X, 2, density)
par(mfrow=c(1,2))
lapply(denlist, plot)
Does anyone know how to change the main title of each density plot
to "var 1", "var 2" by passing optional argument "main"? I've tried
lapply(denlist, plot,
2007 Jun 13
1
passing (or obtaining) index or element name of list to FUN in lapply()
Hello everyone,
I wonder if there is a way to pass the index or name of a list to a
user-specified function in lapply(). For instance, my desired effect is
something like the output of
> L <- list(jack=4098,sape=4139)
> lapply(seq(along=L),function(i,x) if(i==1) "jack" else "sape",x=L)
[[1]]
[1] "jack"
[[2]]
[1] "sape"
>
2012 Oct 30
1
pass javascript date variable to rails controller as params
I have an application where jquery fullcalendar is implemented. On day
click I need to pass the selected date as params to rails controller.
When I alert the date inside dayclick function, I am getting the date in
the format of "Tue Oct 30 2012 12:40:20 GMT+0530 (IST)".. But when I
pass as params in jquery ajax to rails controller, it is passing blank.
How do I get it in rails
2013 Jan 12
1
Problem with X11 fonts under Fedora 17.
I previously posted about this problem on the r-help list, but was told
that I
should switch over to the r-sig-fedora list. So here goes:
When trying to do a plot in a certain context I got an error:
Error in text.default(2, 6, main, cex = cex) :
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size
16 could not be loaded
This is reproducible (in my current environment)
2017 Oct 06
2
bootstrapping results in table format
Hi R users,
I was struggling to put the results into table format. Would you mind to
show using following data and code how we can put the results into table? I
further would like to have a confidence interval for each group.
set.seed(1000)
data <- as.data.table(list(x1 = runif(200), x2 = runif(200), group =
runif(200)>0.5))
data.frame(data)
head(data)
stat <- function(x, i) {x[i, c(m1
2013 Jan 12
2
Another X11 problem. (Psigh!)
Tried to do a plot just now and got an error:
Error in text.default(2, 6, main, cex = cex) :
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size
16 could not be loaded
This is reproducible (in my current environment) via:
par(mfrow=c(2,2))
plot(1:10)
text(2,6,"Oh, hell!",cex=2)
This is of course not the real context in which the error originally
manifested
2012 Nov 14
3
Replacing string in matrix with zero
Dear All,
I have a matrix in which the diagonal has the string "Inf" in it. In
order to be able to do cluster analysis this needs to be replaced with
a Zero.
I can do this by putting it into Excel, replacing and putting it back
into R but it's tedious, and I am sure there is a simple way to do it
in R.
If you have the route to do this, it would be much appreciated.
Best wishes
Nick
2010 Jan 15
5
advice/opinion on "<-" vs "=" in teaching R
Hi R People:
I'm teaching a statistical computing class using R starting next week
(yay!) and I have an opinion type question, please.
I'm old school and use "<-" in an assignment.
However, I'm starting to see the "=" in the literature.
Which should I use or does it matter, please?
Thanks for your input!
Sincerely,
Erin
--
Erin Hodgess
Associate Professor
2008 Apr 10
3
[Bug 15433] New: swfdec can't play videoegg files from this site
http://bugs.freedesktop.org/show_bug.cgi?id=15433
Summary: swfdec can't play videoegg files from this site
Product: swfdec
Version: 0.5.5
Platform: x86-64 (AMD64)
OS/Version: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: plugin
AssignedTo: swfdec at lists.freedesktop.org
2012 May 30
1
caret() train based on cross validation - split dataset to keep sites together?
Hello all,
I have searched and have not yet identified a solution so now I am sending
this message. In short, I need to split my data into training, validation,
and testing subsets that keep all observations from the same sites together
? preferably as part of a cross validation procedure. Now for the longer
version. And I must confess that although my R skills are improving, they
are not so
2018 May 09
2
Search problem
Hello,
when doing a simple search through the lucene indexes in some mailboxes
(with actually many subfolders) the search terminates after a few
seconds with no result and the dovecot log shows this error:
Fatal: master: service(imap): child 15433 killed with signal 6 (core not
dumped)
Any clue about the reasons? the lucene indexes have been already rebuilt
and look OK.
Regards
-federico
2010 Aug 16
1
Problem with cast {reshape}: Error in match.fun(FUN) : could not find function "Negate"
Dear All
I'm having problem with some script which worked a few months ago (on a
different computer that might well have had a different version of R
installed, so perhaps it has to do with the old version of R?):
library(reshape)
Loading required package: plyr
> tble.data <- melt.array(interp, varnames=c("tme","lon","lat"))
>
> allyrs.interp <-