Skip to content

Commit c3f6ee9

Browse files
Only show points in cf_data when 300 or less
1 parent d053b83 commit c3f6ee9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

R/cf_data.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,17 @@ cf_data <- function(x, y=NULL, z=NULL,
9999
if (!is.null(xylim)) {xlim <- ylim <- xylim}
100100
if(is.null(xlim)) {xlim <- c(minx-.05*(maxx-minx),maxx+.05*(maxx-minx))}
101101
if(is.null(ylim)) {ylim <- c(miny-.05*(maxy-miny),maxy+.05*(maxy-miny))}
102+
# Make pts to pass that will be shown on plot
103+
show_points <- if (length(x)>300) {F} else {T}
104+
if (show_points) {
105+
pts <- cbind(x,y)
106+
} else {
107+
pts <- NULL
108+
}
102109
# Passes prediction function to cf_func
103110
if (gg) {
104-
gcf_func(fn0 = pred.func,xlim=xlim,ylim=ylim, pts=cbind(x,y), batchmax=500, ...)
111+
gcf_func(fn0 = pred.func,xlim=xlim,ylim=ylim, pts=pts, batchmax=500, ...)
105112
} else {
106-
cf_func(fn0 = pred.func,xlim=xlim,ylim=ylim, pts=cbind(x,y), batchmax=500, ...)
113+
cf_func(fn0 = pred.func,xlim=xlim,ylim=ylim, pts=pts, batchmax=500, ...)
107114
}
108115
}

0 commit comments

Comments
 (0)