Hello,
I have placed a package on CRAN about two surveys of mortality in Iraq
that were published in the Lancet.
http://cran.at.r-project.org/src/contrib/Descriptions/lancet.iraqmortality.html
> install.packages("lancet.iraqmortality")
...
> library(lancet.iraqmortality)
Loading required packa
I want to use table() to show NA values with factor variables. Using
the set up from the help page, I have:
> b <- factor(rep(c("A","B","C"), 10))
> d <- factor(rep(c("A","B","C"), 10), levels=c("A","B","C","D","E"))
> is.na(d) <- 3:4
> table(b, d)
d
bA B C D E
A 9 0 0 0 0
B 0
I have a formula from which I want to deduce the name of the response
variable. One way of doing so is as follows:
> my.form <- as.formula("y ~ x + z")
> all.vars(my.form)[1]
[1] "y"
>
Is there a better way and/or preferrred method of determining "y" from
my.form than this one? In messing around
Is there a simple way to calculate summary statistics for all the
matrices or dataframes in a list? For example:
> z <- list(matrix(c(2,2,2,2), ncol = 2), matrix(c(4,4,4,4), ncol = 2))
> z
[[1]]
[,1] [,2]
[1,]22
[2,]22
[[2]]
[,1] [,2]
[1,]44
[2,]44
>
I w
Gilvan Justino writes:
> Hi,
>
> I´m trying to write some R classes but I din´t find documentation
> enought to develop them.
I have faced a similar problem. Here is the summary of what I have
been able to find (including some of the responses that you have
already received) with a focus on
I know that there must be a cool way of doing this, but I can't think
of it. Let's say I have an dataframe with NA's.
> x <- data.frame(a = c(0,1,2,NA), b = c(0,NA,1,2), c = c(NA, 0, 1, 2))
> x
a b c
1 0 0 NA
2 1 NA 0
3 2 1 1
4 NA 2 2
>
I know it is easy to replace all the NA's wit
Hi,
I think that there is something that I am misunderstanding in creating tables
using dates that are of class POSIXct. Consider:
> x <- data.frame(date = as.POSIXct(strptime(c(rep("2002-10-17", 4), rep("1999-12-08",
> 2)), format = "%Y-%m-%d")))
> x
date
1 2002-10-17
2 2002-10-17
3 200
ut,
since R CMD build creates the index for me, I can now run R CMD check and get
no warnings.
My mistake was to interpret:
"* creating new 'INDEX'"
to mean:
"Making an INDEX file and putting it in your .gz file while leaving your
original package unchanged."
Than
language R
>
--
David Kane
Geode Capital Management
617-563-0122
[EMAIL PROTECTED]
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
__
[EMA