|
FWIW, and for anyone interested in using R, here's some ravings. Qualification: I'm not really a user of "statistics" anymore, but I have a reasonable understanding of applied, frequentist statistics - basically linear models - from university days. These days I use a small subset of very specifically applied Bayesian stats using MCMC, and my "stats knowledge" is if anything, diminishing. Because of this I have a thoroughly undeserved reputation as "a stats guy", and I just want to put that into context. But I know R pretty well, and it already can be tightly integrated into a workflow with Manifold. I don't tend to do it much as I don't need to, but there are numerous ways of very easily transferring data between them. Why would I want to do that? In R you can specify linear models terribly easily via formulas: if "d" is my data (analogous to a table in Manifold) reg <- lm(y ~ x, data = d) provides a basic regression of x vs. y. Formulas can specify any linear model you want, and on a similar foundation you'll find practically any statistical formulation in R somewhere. Did someone say "spatial": http://cran.r-project.org/src/contrib/Views/Spatial.html Oh yeah, and R has an enormous and spectular capacity for plots. Check this out: R Screenshots How do I get a Manifold table into R? 1. Copy and paste via the clipboard: d <- read.delim("clipboard") ## will faithfully read data from a table/selection copied in Manifold 2. External text file d <- read.csv("C:/temp/file.csv") 3. Straight from a table in a map file. Using the function defined here, and the RODBC package library(RODBC) ## open a connection to the file ch <- odbcConnectManifold("C:/temp/world.map") ## pass a Manifold query to the connection d <- sqlQuery(ch, "SELECT [Longitude (I)] AS lon, [Latitude (I)] AS lat, [Capital] AS name FROM [Countries] WHERE [Area (I)] > 150;") What other mechanisms are there? Package rgdal (very easily installed using install.packages("rgdal") ) can read directly from shapefiles, GeoTIFFs, and all the rest. Potentially you can use the ODBC driver in GDAL to read directly from .map files, certainly you could via a datasource, but IMO it's too much mucking around when files will do. Here are the GDAL formats for raster and vector Databases obviously provide a far better common storage method for both R and Manifold, but I've simply not had access to the equipment I need to explore that. There are other routes, that I can't think of right now, as well. As far as I'm concerned, there is no need to more tightly couple R and Manifold: you just need familiarity with both. The topic of Manifold providing more "statistics" support is another question. Tighter coupling? You can run R from scripts in Manifold, and that is probably the best way to automate things, but you need pre-defined R scripts, and you just spawn (from VBScript, C#, or even the ActiveX languages) RScript.exe, and you can transfer data via files. Very tight coupling, at the C# level can be done for the underlying C libraries in R, but it involves labourious and tedious explication of each and every variable via marshalling (that's my understanding, thanks to a good friend, and some very minor tinkering). If tighter integration is to occur it would involve something along those lines, or a rewrite of R in .NET. I get the impression that looser coupling and powerful machines these days make either of those massive projects pretty moot. You can simply do most things with a bit of R and Manifold knowledge.
|