ggobi / tourr

A implementation of tour algorithms in R
http://ggobi.github.io/tourr/
Other
65 stars 21 forks source link

Error when using render with guided tour #112

Closed uschiLaa closed 2 years ago

uschiLaa commented 2 years ago

Here is a small example and the error it produces for me

tmp_path <- tempdir() render(flea[, 1:6], guided_tour(holes()), display_xy(), "pdf", frames = 3, file.path(tmp_path, "test.pdf") ) Converting input data to the required matrix format. target_dist - cur_dist: 0 Fehler in integer(n) : Vektorgröße kann nicht NA/NaN sein Zusätzlich: Warnmeldung: In integer(n) : NAs durch Umwandlung erzeugt

dicook commented 2 years ago

I don't get an error:

> library(tourr)
> render(flea[, 1:6], guided_tour(holes()), display_xy(), "png", frames = 3, file.path(".", "test.png") )
Converting input data to the required matrix format.
Value  0.695   34.0 % better  - NEW BASIS
Using half_range 0.98
> render(flea[, 1:6], guided_tour(holes()), display_xy(), "pdf", frames = 3, file.path(".", "test.pdf") )
Converting input data to the required matrix format.
Value  0.591   72.1 % better  - NEW BASIS
Using half_range 0.98
> tmp_path <- tempdir()
> render(flea[, 1:6], guided_tour(holes()), display_xy(), "pdf", frames = 3, file.path(tmp_path, "test.pdf") )
Converting input data to the required matrix format.
Value  0.293   424.0 % better  - NEW BASIS
Using half_range 0.98

I'm not sure what is happening for you. Maybe try using the pdf() function to print a plot outside of render.

You can also use debug(render) to work out where the error occurs.

uschiLaa commented 2 years ago

Thanks for checking, actually I was using the CRAN version, it works after installing from GithHub! I will just submit a simple pull request to fix the documentation.