Dear Tom,
I think this is the line you need
arules::subset(rules, subset=lhs %pin% "")
I found the solution here:
http://stackoverflow.com/questions/27926131/how-to-get-items-for-both-lhs-and-rhs-for-only-specific-columns-in-arules
One more thing. For printing the rules, I needed the inspect(
Dear Veronica,
Here there's a way of doing what you requested.
library("lubridate")
# your date '2010-08-21' as Date object
dd <- as.Date(strptime("2010-08-21", format="%Y-%m-%d", tz="GMT"))
# take the first day of the year as Date object, i.e. 2010-01-01 in our
example
ref.date <- as.Date(strpt
Hi Nick,
Yes, you are right. There's one small bug on my code.
The 'if' within the for-loop is wrong. Try it now with the code below.
rrarefy.custom <- function (x, sample, rep.param=F)
{
if (!identical(all.equal(x, round(x)), TRUE))
stop("function is meaningful only for integers (counts)
Hi Nick,
If you use the following
raredata <- rarecurve(rrarefy(netdata, sample=100), label=F,
col=rgb(0, 0, 1, 0.1))
should work for any sample size, e.g. sample=100.
However, you will have a 'warning' if you don't have samples enough,
because it has not replacement.
If you type 'rrarefy'
Hi,
Jean's example with lapply works fine.
However, if you still want to use apply, I think this works.
One observation first. You were passing c(1,2) as second argument to
apply, in your code. And that is what makes you have lots of NAs as a
result, since your function is being applied twice,
5 matches
Mail list logo