Displaying 3 results from an estimated 3 matches for "rafamoral".
2009 Jan 14
3
Logical function to turn missing values to 0's
I have a dataset which contains some missing values, and I need to replace
them with zeros. I tried using the following:
x <- matrix(data=rep(c(1,2,3,NA),6), ncol=6, nrow=6)
y <- matrix(data=0, ncol=ncol(x), nrow=nrow(x))
for(i in 1:nrow(x)) {
for(j in 1:ncol(x)) {
y[i,j] <- ifelse(x[i,j]==NA, 0, x[i,j])
}}
But y returns an NA matrix.
I'd appreciate any help.
--
View this
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs,
I want to plot the following barplot with lines instead of bars. Is there a way?
data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)))
d <- t(data[,2:4])
barplot(d, beside=TRUE)
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo
2009 Jan 12
1
Help with storage of each matrix generated in a loop
I need to store each matrix generated in a loop.
I've been working with the CUSUM algorithm and I've been trying to implement
it in R.
What I need to do with my dataset is to create 1000 randomized datasets and
cumulative sum them all and store all of those randomized CUSUMed datasets
for further analysis and creation of the simulation envelope in the CUSUM
chart. But I can't manage