Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data with NAs #63

Open
vsimko opened this issue Feb 14, 2017 · 0 comments
Open

data with NAs #63

vsimko opened this issue Feb 14, 2017 · 0 comments

Comments

@vsimko
Copy link
Contributor

vsimko commented Feb 14, 2017

I found the following stackoverflow question about NAs in data:
http://stackoverflow.com/questions/26787537

I tried to create a reproducible example:

library(biwavelet)
di <- data.frame(1:100, rnorm(100)) % random data

# setting 10% randomly selected samples to NA
NAids <- cbind(round(runif(nrow(di) * .1, 1, nrow(di))), NA)
di[NAids[,1],] <- NAids

# plotting samples with NAs
par(mar = c(2, 2, 0, 0))
plot(di, type = "s")

rplot

wt.t1 = wt(di)
plot(wt.t1)
Error in image.default(x$t, yvals, t(zvals), zlim = zlim, xlim = xlim,  : 
  invalid z limits
Called from: image.default(x$t, yvals, t(zvals), zlim = zlim, xlim = xlim, 
    ylim = rev(ylim), xlab = xlab, ylab = ylab, yaxt = "n", xaxt = "n", 
    col = fill.colors, ...)
# replacing NAs with zeroes
di[is.na(di)] <- 0
par(mar = c(2, 2, 0, 0))
plot(di, type = "s")

rplot01

wt.t1 = wt(di)
plot(wt.t1)

rplot02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant