Export point coordinates from (r)ggobi scatterplot

Skip to first unread message

Robin P

Jun 3, 2014, 9:03:15 AM6/3/14
to gg...@googlegroups.com
Hi List,

I'm not familair with ggobi nor with R but one of my colleagues non familiar with GIS is looking for a way to get his colored scatterplots in a mapping interface, for example QGIS.
For example, we would like to try and find a way to link ggobi to QGIS via the R module included.

My first question for the R or for the ggobi specialists : is there any way to export for instance X,Y,color or X,Y, attribute listing ?

Thanks for any clues,

Nicholas Lewin-Koh

Jun 3, 2014, 12:11:43 PM6/3/14
to gg...@googlegroups.com
Hi Robin,
The way i would approach it is look at Rpy2. Rpy2 encapuslates R objects in python and allows you to use them as either python structures or R stuctures. Qgis has facilities for python plugins. It shouldn't be too hard to link R and Qgis directly (he said) using Rpy2 as the "glue".
That being said, I think the describeDisplay command in Rggobi will get you the coordinates from a ggobi display, and then use write.csv to export them.
You received this message because you are subscribed to the Google Groups "GGobi users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggobi+un...@googlegroups.com.
To post to this group, send email to gg...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin P

Jun 6, 2014, 3:53:00 AM6/6/14
to gg...@googlegroups.com, ni...@hailmail.net
Dear all,

First I'd like to thanks you for your detailed and quick answers. I'll forward all that to my colleague so we can work on a way to get it done.
I'll keep in touch here if we manage to do the trick and get a proper export. I'll have to wait the next project for that.

In the meantime, again, thank you.


Expéditeur: Michael Lawrence
Date: 4 juin 2014 14:29:10 UTC+2
Cc: GGobi users
Objet: Rép : [GGobi] Export point coordinates from (r)ggobi scatterplot

Assuming you have a GGobi instance in R called "gg", you can retrieve the displays and the variable names of a given display. For example, assuming you have one display that is the scatterplot,

scatterplot <- displays(gg)[[1L]]
varnames <- variables(scatterplot)

gets the variables names.

Assuming your dataset is named "data", the data are retrieved with:

d <- gg$data
df <- as.data.frame(d)

and the glyph attributes like this:

colors <- glyph_color(d)
sizes <- glyph_size(d)
types <- glyph_type(d)

Hope that helps,

Reply all
Reply to author
0 new messages