On Jun 22, 2009, at 1:21 PM, Jorge Ivan Velez wrote:
Hi David,
It works for me when handling data frames mixing characters and
numeric by
using either print() or a function called "foo":
# Some data
x <- c("A", "B", "C", 3.5, 1, 0, NA, "a character",NA, "another
character")
mydata <- dat
Hi David,
It works for me when handling data frames mixing characters and numeric by
using either print() or a function called "foo":
# Some data
x <- c("A", "B", "C", 3.5, 1, 0, NA, "a character",NA, "another character")
mydata <- data.frame(x = x, y = sample(x))
mydata
# Option 1: print()ing
pr
Jorge,
Thanks a lot for your reply. It's indeed working in this case. However, with
data frames mixing numeric and character is not working anymore. Morever I
am working with many variables and I don't want to modify them. What I would
really appreciate is a global option (in the Rprofile?) that
Dear David,
Try this:
x <- c("A", "B", "C", NA)
x[is.na(x)] <- "."
x
HTH,
Jorge
On Mon, Jun 22, 2009 at 2:11 AM, David_D wrote:
>
> Dear R-users,
>
> For reporting purpose (using Sweave and LaTeX), I am creating complex
> tables
> with the cat function such as
>
> > x<-c("A", "B", "C", NA)
>
Dear R-users,
For reporting purpose (using Sweave and LaTeX), I am creating complex tables
with the cat function such as
> x<-c("A", "B", "C", NA)
> cat(x, '\n')
A B C NA
For convenience, I would like to change all my NA value to something else
like '.' (as in SAS for example). Is there a globa
5 matches
Mail list logo