[Traminer-users] loop for plotting quality statistics from wcKMedRange

Reynolds, Jeremy E reyno113 at purdue.edu
Sat Oct 8 04:41:00 CEST 2016


Dear TraMineR Users,

I would like to loop through many sets of clustering results produced with wcKMedRange and produce a plot for each one.  Without the loop, the code would look like this:

plot(pamomf2i5q.w, stat=c("ASWw","HC", "R2", "PBC", "HG"), legendpos="topright", norm="zscore")
plot(pamwardomf2i5q.w, stat=c("ASWw","HC", "R2", "PBC", "HG"), legendpos="topright", norm="zscore")

When I try to put this in a loop, I get the error messages below suggesting that R is expecting a y value in the plot command.  Is there something wrong with my loop that is causing this problem?

Thanks,

Jeremy


> stats <- c("pamomf2i5q.w", "pamwardomf2i5q.w")
> for (i in unique(stats)) {
+   plot(stats[i], stat=c("ASW","HC", "R2", "PBC", "HG"), legendpos="topright", norm="zscore")
+ }
[data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAKUlEQVR42mNgQAKi65/9Z8AHQApgmKACrAqxKcBpIkHryFJEstsYiAUAKIxac8kmY3AAAAAASUVORK5CYII=] Show Traceback
 Rerun with Debug
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In plot.window(...) : "stat" is not a graphical parameter
4: In plot.window(...) : "legendpos" is not a graphical parameter
5: In plot.window(...) : "norm" is not a graphical parameter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20161008/8e5d60f5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 168 bytes
Desc: image001.png
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20161008/8e5d60f5/attachment-0001.png>


More information about the Traminer-users mailing list