| 1 | # Exploratory.py - Provides methods for exploratory statistics.
|
|---|
| 2 | #
|
|---|
| 3 | # Copyright (C) 2007 Jason J. Roberts and Ben D. Best
|
|---|
| 4 | #
|
|---|
| 5 | # This program is free software; you can redistribute it and/or
|
|---|
| 6 | # modify it under the terms of the GNU General Public License
|
|---|
| 7 | # as published by the Free Software Foundation; either version 2
|
|---|
| 8 | # of the License, or (at your option) any later version.
|
|---|
| 9 | #
|
|---|
| 10 | # This program is distributed in the hope that it will be useful,
|
|---|
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | # GNU General Public License (available in the file LICENSE.TXT)
|
|---|
| 14 | # for more details.
|
|---|
| 15 | #
|
|---|
| 16 | # You should have received a copy of the GNU General Public License
|
|---|
| 17 | # along with this program; if not, write to the Free Software
|
|---|
| 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|---|
| 19 |
|
|---|
| 20 | import os.path
|
|---|
| 21 | import re
|
|---|
| 22 | import sys
|
|---|
| 23 |
|
|---|
| 24 | from GeoEco.DatabaseAccess.ArcGIS import ArcGIS91DatabaseConnection
|
|---|
| 25 | from GeoEco.DataManagement.Directories import TemporaryDirectory
|
|---|
| 26 | from GeoEco.DataManagement.Files import File
|
|---|
| 27 | from GeoEco.DynamicDocString import DynamicDocString
|
|---|
| 28 | from GeoEco.Internationalization import _
|
|---|
| 29 | from GeoEco.Logging import Logger
|
|---|
| 30 | from GeoEco.R import R
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | class RExploratoryPlots(object):
|
|---|
| 34 | __doc__ = DynamicDocString()
|
|---|
| 35 |
|
|---|
| 36 | @classmethod
|
|---|
| 37 | def ScatterplotMatrixForArcGISTable(cls, table, fields=None, transforms=None, where=None, diagonal=u'Histogram', lower=u'Smooth', upper=u'Correlation',
|
|---|
| 38 | xColumnName=None, yColumnName=None, zColumnName=None, mColumnName=None,
|
|---|
| 39 | outputFile=None, res=1000., width=3000., height=3000., pointSize=10.0, bg=u'white', overwriteExisting=False):
|
|---|
| 40 | cls.__doc__.Obj.ValidateMethodInvocation()
|
|---|
| 41 |
|
|---|
| 42 | # Perform additional validation.
|
|---|
| 43 |
|
|---|
| 44 | if outputFile is not None and not outputFile.lower().endswith('.png') and not outputFile.lower().endswith('.emf'):
|
|---|
| 45 | Logger.RaiseException(ValueError(_(u'The output file %(f)s has an invalid extension. It must have the extension .png or .emf.') % {u'f': outputFile}))
|
|---|
| 46 |
|
|---|
| 47 | # If the caller requested emf format for the plot file,
|
|---|
| 48 | # convert the width and height from thousands of an inch to
|
|---|
| 49 | # inches.
|
|---|
| 50 |
|
|---|
| 51 | if outputFile is not None and outputFile.lower().endswith(u'.emf'):
|
|---|
| 52 | width = width / 1000
|
|---|
| 53 | height = height / 1000
|
|---|
| 54 |
|
|---|
| 55 | # Load the data frame into a temporary data frame.
|
|---|
| 56 |
|
|---|
| 57 | r = R.GetInterpreter()
|
|---|
| 58 | transformsName = R.GetUniqueVariableName()
|
|---|
| 59 | dataFrameName = R.GetUniqueVariableName()
|
|---|
| 60 | R.LoadDataFrameFromArcGISTable(table, dataFrameName, where=where, fields=fields, xColumnName=xColumnName, yColumnName=yColumnName, zColumnName=zColumnName, mColumnName=mColumnName)
|
|---|
| 61 |
|
|---|
| 62 | # Create the plot.
|
|---|
| 63 |
|
|---|
| 64 | try:
|
|---|
| 65 | if r('length(%s)' % dataFrameName) <= 0:
|
|---|
| 66 | if where is not None:
|
|---|
| 67 | Logger.RaiseException(ValueError(_(u'The where clause "%(where)s" did not select any rows from the table %(table)s.') % {u'table': table, u'where': where}))
|
|---|
| 68 | else:
|
|---|
| 69 | Logger.RaiseException(ValueError(_(u'The table %(table)s is empty.') % {u'table': table}))
|
|---|
| 70 |
|
|---|
| 71 | if transforms is not None and len(transforms) > 0:
|
|---|
| 72 | if len(transforms) > len(fields):
|
|---|
| 73 | transforms = transforms[:len(fields)]
|
|---|
| 74 | r[transformsName] = dict(zip(fields[:len(transforms)], transforms))
|
|---|
| 75 | else:
|
|---|
| 76 | r('%s <- NULL' % transformsName)
|
|---|
| 77 |
|
|---|
| 78 | R.EvaluateFile(os.path.join(os.path.dirname(sys.modules[cls.__module__].__file__), 'ScatterplotMatrixForDataframe.r'), False)
|
|---|
| 79 | if outputFile is None:
|
|---|
| 80 | r('ScatterplotMatrix(%s, transforms=%s, .diag="%s", lower="%s", upper="%s")' % (dataFrameName, transformsName, str(diagonal), str(lower), str(upper)))
|
|---|
| 81 | else:
|
|---|
| 82 | tempDir = TemporaryDirectory()
|
|---|
| 83 | tempOutputFile = os.path.join(tempDir.Path, u'plot' + os.path.splitext(outputFile)[1])
|
|---|
| 84 | Logger.Info(_(u'Writing plot to %(file)s...') % {u'file': outputFile})
|
|---|
| 85 | r('ScatterplotMatrixToFile("%s", %s, transforms=%s, .diag="%s", lower="%s", upper="%s", res=%f, width=%f, height=%f, pointsize=%f, bg="%s")' % (tempOutputFile.replace(u'\\', u'/'), dataFrameName, transformsName, str(diagonal), str(lower), str(upper), res, width, height, pointSize, bg))
|
|---|
| 86 | File.MoveSilent(tempOutputFile, outputFile, overwriteExisting=overwriteExisting)
|
|---|
| 87 |
|
|---|
| 88 | # Delete the data frame.
|
|---|
| 89 |
|
|---|
| 90 | finally:
|
|---|
| 91 | r('if (exists("%s")) rm("%s")' % (transformsName, transformsName))
|
|---|
| 92 | r('if (exists("%s")) rm("%s")' % (dataFrameName, dataFrameName))
|
|---|
| 93 |
|
|---|
| 94 | @classmethod
|
|---|
| 95 | def DensityHistogramForArcGISField(cls, table, densityField, transform=None, categoryField=None, where=None, legend=None,
|
|---|
| 96 | outputFile=None, res=1000., width=3000., height=3000., pointSize=10.0, bg=u'white', overwriteExisting=False):
|
|---|
| 97 | cls.__doc__.Obj.ValidateMethodInvocation()
|
|---|
| 98 |
|
|---|
| 99 | # Perform additional validation.
|
|---|
| 100 |
|
|---|
| 101 | if outputFile is not None and not outputFile.lower().endswith('.png') and not outputFile.lower().endswith('.emf'):
|
|---|
| 102 | Logger.RaiseException(ValueError(_(u'The output file %(f)s has an invalid extension. It must have the extension .png or .emf.') % {u'f': outputFile}))
|
|---|
| 103 |
|
|---|
| 104 | # If the caller requested emf format for the plot file,
|
|---|
| 105 | # convert the width and height from thousands of an inch to
|
|---|
| 106 | # inches.
|
|---|
| 107 |
|
|---|
| 108 | if outputFile is not None and outputFile.lower().endswith(u'.emf'):
|
|---|
| 109 | width = width / 1000
|
|---|
| 110 | height = height / 1000
|
|---|
| 111 |
|
|---|
| 112 | # Load the data frame into a temporary variable.
|
|---|
| 113 |
|
|---|
| 114 | r = R.GetInterpreter()
|
|---|
| 115 | dataFrameName = R.GetUniqueVariableName()
|
|---|
| 116 | if categoryField is None:
|
|---|
| 117 | R.LoadDataFrameFromArcGISTable(table, dataFrameName, where=where, fields=[densityField])
|
|---|
| 118 | else:
|
|---|
| 119 | R.LoadDataFrameFromArcGISTable(table, dataFrameName, where=where, fields=[densityField, categoryField])
|
|---|
| 120 |
|
|---|
| 121 | # Create the plot.
|
|---|
| 122 |
|
|---|
| 123 | try:
|
|---|
| 124 | if r('length(%s)' % dataFrameName) <= 0:
|
|---|
| 125 | if where is not None:
|
|---|
| 126 | Logger.RaiseException(ValueError(_(u'The where clause "%(where)s" did not select any rows from the table %(table)s.') % {u'table': table, u'where': where}))
|
|---|
| 127 | else:
|
|---|
| 128 | Logger.RaiseException(ValueError(_(u'The table %(table)s is empty.') % {u'table': table}))
|
|---|
| 129 |
|
|---|
| 130 | R.EvaluateFile(os.path.join(os.path.dirname(sys.modules[cls.__module__].__file__), 'DensityHistogramForDataframe.r'), False)
|
|---|
| 131 |
|
|---|
| 132 | if transform is None:
|
|---|
| 133 | transform = 'NULL'
|
|---|
| 134 | else:
|
|---|
| 135 | transform = '"' + transform.replace('"', '\\"') + '"'
|
|---|
| 136 |
|
|---|
| 137 | if categoryField is None:
|
|---|
| 138 | categoryField = 'NULL'
|
|---|
| 139 | else:
|
|---|
| 140 | categoryField = '"' + categoryField + '"'
|
|---|
| 141 |
|
|---|
| 142 | if legend is None:
|
|---|
| 143 | legend = 'NULL'
|
|---|
| 144 | else:
|
|---|
| 145 | legend = '"' + legend + '"'
|
|---|
| 146 |
|
|---|
| 147 | if outputFile is None:
|
|---|
| 148 | r('DensityHistogram(%s, densityField="%s", transform=%s, categoryField=%s, .legend=%s)' % (dataFrameName, densityField, transform, categoryField, legend))
|
|---|
| 149 | else:
|
|---|
| 150 | tempDir = TemporaryDirectory()
|
|---|
| 151 | tempOutputFile = os.path.join(tempDir.Path, u'plot' + os.path.splitext(outputFile)[1])
|
|---|
| 152 | Logger.Info(_(u'Writing density plot to %(file)s...') % {u'file': outputFile})
|
|---|
| 153 | r('DensityHistogramToFile("%s", %s, densityField="%s", transform=%s, categoryField=%s, .legend=%s, res=%f, width=%f, height=%f, pointsize=%f, bg="%s")' % (tempOutputFile.replace(u'\\', u'/'), dataFrameName, densityField, transform, categoryField, legend, res, width, height, pointSize, bg))
|
|---|
| 154 | File.MoveSilent(tempOutputFile, outputFile, overwriteExisting=overwriteExisting)
|
|---|
| 155 |
|
|---|
| 156 | # Delete the data frame.
|
|---|
| 157 |
|
|---|
| 158 | finally:
|
|---|
| 159 | r('if (exists("%s")) rm("%s")' % (dataFrameName, dataFrameName))
|
|---|
| 160 |
|
|---|
| 161 | @classmethod
|
|---|
| 162 | def DensityHistogramForArcGISPointsCoordinates(cls, pointFeatures, coordinate, coordinateName=None, transform=None, categoryField=None, where=None, legend=None,
|
|---|
| 163 | outputFile=None, res=1000., width=3000., height=3000., pointSize=10.0, bg=u'white', overwriteExisting=False):
|
|---|
| 164 | cls.__doc__.Obj.ValidateMethodInvocation()
|
|---|
| 165 |
|
|---|
| 166 | # Perform additional validation.
|
|---|
| 167 |
|
|---|
| 168 | if outputFile is not None and not outputFile.lower().endswith('.png') and not outputFile.lower().endswith('.emf'):
|
|---|
| 169 | Logger.RaiseException(ValueError(_(u'The output file %(f)s has an invalid extension. It must have the extension .png or .emf.') % {u'f': outputFile}))
|
|---|
| 170 |
|
|---|
| 171 | # If the caller requested emf format for the plot file,
|
|---|
| 172 | # convert the width and height from thousands of an inch to
|
|---|
| 173 | # inches.
|
|---|
| 174 |
|
|---|
| 175 | if outputFile is not None and outputFile.lower().endswith(u'.emf'):
|
|---|
| 176 | width = width / 1000
|
|---|
| 177 | height = height / 1000
|
|---|
| 178 |
|
|---|
| 179 | # Load the data frame into a temporary variable.
|
|---|
| 180 |
|
|---|
| 181 | if coordinateName is None:
|
|---|
| 182 | coordinateName = coordinate
|
|---|
| 183 |
|
|---|
| 184 | if coordinate == u'x':
|
|---|
| 185 | xColumnName = coordinateName
|
|---|
| 186 | else:
|
|---|
| 187 | xColumnName = None
|
|---|
| 188 |
|
|---|
| 189 | if coordinate == u'y':
|
|---|
| 190 | yColumnName = coordinateName
|
|---|
| 191 | else:
|
|---|
| 192 | yColumnName = None
|
|---|
| 193 |
|
|---|
| 194 | if coordinate == u'z':
|
|---|
| 195 | zColumnName = coordinateName
|
|---|
| 196 | else:
|
|---|
| 197 | zColumnName = None
|
|---|
| 198 |
|
|---|
| 199 | if coordinate == u'm':
|
|---|
| 200 | mColumnName = coordinateName
|
|---|
| 201 | else:
|
|---|
| 202 | mColumnName = None
|
|---|
| 203 |
|
|---|
| 204 | r = R.GetInterpreter()
|
|---|
| 205 | dataFrameName = R.GetUniqueVariableName()
|
|---|
| 206 | if categoryField is None:
|
|---|
| 207 | R.LoadDataFrameFromArcGISTable(pointFeatures, dataFrameName, where=where, fields=[], xColumnName=xColumnName, yColumnName=yColumnName, zColumnName=zColumnName, mColumnName=mColumnName)
|
|---|
| 208 | else:
|
|---|
| 209 | R.LoadDataFrameFromArcGISTable(pointFeatures, dataFrameName, where=where, fields=[categoryField], xColumnName=xColumnName, yColumnName=yColumnName, zColumnName=zColumnName, mColumnName=mColumnName)
|
|---|
| 210 |
|
|---|
| 211 | # Create the plot.
|
|---|
| 212 |
|
|---|
| 213 | try:
|
|---|
| 214 | if r('length(%s)' % dataFrameName) <= 0:
|
|---|
| 215 | if where is not None:
|
|---|
| 216 | Logger.RaiseException(ValueError(_(u'The where clause "%(where)s" did not select any rows from the table %(table)s.') % {u'table': table, u'where': where}))
|
|---|
| 217 | else:
|
|---|
| 218 | Logger.RaiseException(ValueError(_(u'The table %(table)s is empty.') % {u'table': table}))
|
|---|
| 219 |
|
|---|
| 220 | R.EvaluateFile(os.path.join(os.path.dirname(sys.modules[cls.__module__].__file__), 'DensityHistogramForDataframe.r'), False)
|
|---|
| 221 |
|
|---|
| 222 | if transform is None:
|
|---|
| 223 | transform = 'NULL'
|
|---|
| 224 | else:
|
|---|
| 225 | transform = '"' + transform.replace('"', '\\"') + '"'
|
|---|
| 226 |
|
|---|
| 227 | if categoryField is None:
|
|---|
| 228 | categoryField = 'NULL'
|
|---|
| 229 | else:
|
|---|
| 230 | categoryField = '"' + categoryField + '"'
|
|---|
| 231 |
|
|---|
| 232 | if legend is None:
|
|---|
| 233 | legend = 'NULL'
|
|---|
| 234 | else:
|
|---|
| 235 | legend = '"' + legend + '"'
|
|---|
| 236 |
|
|---|
| 237 | if outputFile is None:
|
|---|
| 238 | r('DensityHistogram(%s, densityField="%s", transform=%s, categoryField=%s, .legend=%s)' % (dataFrameName, coordinateName, transform, categoryField, legend))
|
|---|
| 239 | else:
|
|---|
| 240 | tempDir = TemporaryDirectory()
|
|---|
| 241 | tempOutputFile = os.path.join(tempDir.Path, u'plot' + os.path.splitext(outputFile)[1])
|
|---|
| 242 | Logger.Info(_(u'Writing density plot to %(file)s...') % {u'file': outputFile})
|
|---|
| 243 | r('DensityHistogramToFile("%s", %s, densityField="%s", transform=%s, categoryField=%s, .legend=%s, res=%f, width=%f, height=%f, pointsize=%f, bg="%s")' % (tempOutputFile.replace(u'\\', u'/'), dataFrameName, coordinateName, transform, categoryField, legend, res, width, height, pointSize, bg))
|
|---|
| 244 | File.MoveSilent(tempOutputFile, outputFile, overwriteExisting=overwriteExisting)
|
|---|
| 245 |
|
|---|
| 246 | # Delete the data frame.
|
|---|
| 247 |
|
|---|
| 248 | finally:
|
|---|
| 249 | r('if (exists("%s")) rm("%s")' % (dataFrameName, dataFrameName))
|
|---|
| 250 |
|
|---|
| 251 | @classmethod
|
|---|
| 252 | def ClevelandPlotForArcGISTable(cls, table, fields=None, transforms=None, orderByField=None, where=None,
|
|---|
| 253 | xColumnName=None, yColumnName=None, zColumnName=None, mColumnName=None,
|
|---|
| 254 | outputFile=None, res=1000., width=3000., height=3000., pointSize=10.0, bg=u'white', overwriteExisting=False):
|
|---|
| 255 | cls.__doc__.Obj.ValidateMethodInvocation()
|
|---|
| 256 |
|
|---|
| 257 | # If the caller requested emf format for the plot file,
|
|---|
| 258 | # convert the width and height from thousands of an inch to
|
|---|
| 259 | # inches.
|
|---|
| 260 |
|
|---|
| 261 | if outputFile is not None and outputFile.lower().endswith(u'.emf'):
|
|---|
| 262 | width = width / 1000
|
|---|
| 263 | height = height / 1000
|
|---|
| 264 |
|
|---|
| 265 | # Load the data frame into a temporary data frame.
|
|---|
| 266 |
|
|---|
| 267 | if orderByField is not None:
|
|---|
| 268 | if fields is None:
|
|---|
| 269 | fields = []
|
|---|
| 270 | if orderByField not in fields:
|
|---|
| 271 | fields.append(orderByField)
|
|---|
| 272 |
|
|---|
| 273 | r = R.GetInterpreter()
|
|---|
| 274 | transformsName = R.GetUniqueVariableName()
|
|---|
| 275 | dataFrameName = R.GetUniqueVariableName()
|
|---|
| 276 | R.LoadDataFrameFromArcGISTable(table, dataFrameName, where=where, fields=fields, xColumnName=xColumnName, yColumnName=yColumnName, zColumnName=zColumnName, mColumnName=mColumnName)
|
|---|
| 277 |
|
|---|
| 278 | # Create the plot.
|
|---|
| 279 |
|
|---|
| 280 | try:
|
|---|
| 281 | if r('length(%s)' % dataFrameName) <= 0:
|
|---|
| 282 | if where is not None:
|
|---|
| 283 | Logger.RaiseException(ValueError(_(u'The where clause "%(where)s" did not select any rows from the table %(table)s.') % {u'table': table, u'where': where}))
|
|---|
| 284 | else:
|
|---|
| 285 | Logger.RaiseException(ValueError(_(u'The table %(table)s is empty.') % {u'table': table}))
|
|---|
| 286 |
|
|---|
| 287 | if transforms is not None and len(transforms) > 0:
|
|---|
| 288 | if len(transforms) > len(fields):
|
|---|
| 289 | transforms = transforms[:len(fields)]
|
|---|
| 290 | r[transformsName] = dict(zip(fields[:len(transforms)], transforms))
|
|---|
| 291 | else:
|
|---|
| 292 | r('%s <- NULL' % transformsName)
|
|---|
| 293 |
|
|---|
| 294 | if orderByField is not None:
|
|---|
| 295 | r('%s <- %s[order(%s$%s),]' % (dataFrameName, dataFrameName, dataFrameName, orderByField))
|
|---|
| 296 |
|
|---|
| 297 | R.EvaluateFile(os.path.join(os.path.dirname(sys.modules[cls.__module__].__file__), 'ClevelandPlotForDataframe.r'), False)
|
|---|
| 298 | if outputFile is None:
|
|---|
| 299 | r('ClevelandPlot(%s, transforms=%s)' % (dataFrameName, transformsName))
|
|---|
| 300 | else:
|
|---|
| 301 | Logger.Info(_(u'Writing plot to %(file)s...') % {u'file': outputFile})
|
|---|
| 302 | r('ClevelandPlotToFile("%s", %s, transforms=%s, res=%f, width=%f, height=%f, pointSize=%f, bg="%s")' % (outputFile.replace(u'\\', u'/'), dataFrameName, transformsName, res, width, height, pointSize, bg))
|
|---|
| 303 |
|
|---|
| 304 | # Delete the data frame.
|
|---|
| 305 |
|
|---|
| 306 | finally:
|
|---|
| 307 | r('if (exists("%s")) rm("%s")' % (transformsName, transformsName))
|
|---|
| 308 | r('if (exists("%s")) rm("%s")' % (dataFrameName, dataFrameName))
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 | ###############################################################################
|
|---|
| 312 | # Metadata: module
|
|---|
| 313 | ###############################################################################
|
|---|
| 314 |
|
|---|
| 315 | from GeoEco.ArcGIS import ArcGISDependency
|
|---|
| 316 | from GeoEco.DatabaseAccess.ArcGIS import ArcGIS91SelectCursor
|
|---|
| 317 | from GeoEco.Dependencies import PythonModuleDependency
|
|---|
| 318 | from GeoEco.R import RDependency
|
|---|
| 319 | from GeoEco.Metadata import *
|
|---|
| 320 | from GeoEco.Types import *
|
|---|
| 321 |
|
|---|
| 322 | AddModuleMetadata(shortDescription=_(u'Provides methods for exploratory statistics.'))
|
|---|
| 323 |
|
|---|
| 324 | ###############################################################################
|
|---|
| 325 | # Metadata: RExploratoryPlots class
|
|---|
| 326 | ###############################################################################
|
|---|
| 327 |
|
|---|
| 328 | AddClassMetadata(RExploratoryPlots,
|
|---|
| 329 | shortDescription=_(u'Provides methods for creating exploratory statistical plots using R.'),
|
|---|
| 330 | isExposedAsCOMServer=True,
|
|---|
| 331 | comIID=u'{0F60EA9E-42BB-4696-B8BA-092FA6965374}',
|
|---|
| 332 | comCLSID=u'{F8EF1F8A-7231-449C-AC22-711517E3C542}')
|
|---|
| 333 |
|
|---|
| 334 | # Public method: RExploratoryPlots.ScatterplotMatrixForArcGISTable
|
|---|
| 335 |
|
|---|
| 336 | AddMethodMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable,
|
|---|
| 337 | shortDescription=_(u'Creates a matrix of scatterplots for a table using the R pairs function.'),
|
|---|
| 338 | isExposedToPythonCallers=True,
|
|---|
| 339 | isExposedByCOM=True,
|
|---|
| 340 | isExposedAsArcGISTool=True,
|
|---|
| 341 | arcGISDisplayName=_(u'Scatterplot Matrix for Table'),
|
|---|
| 342 | arcGISToolCategory=_(u'Statistics\\Explore Data'),
|
|---|
| 343 | dependencies=[ArcGISDependency(9, 1), RDependency(2, 5, 0)])
|
|---|
| 344 |
|
|---|
| 345 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'cls',
|
|---|
| 346 | typeMetadata=ClassOrClassInstanceTypeMetadata(cls=RExploratoryPlots),
|
|---|
| 347 | description=_(u'%s class or an instance of it.') % RExploratoryPlots.__name__)
|
|---|
| 348 |
|
|---|
| 349 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'table',
|
|---|
| 350 | typeMetadata=ArcGISTableViewTypeMetadata(mustExist=True),
|
|---|
| 351 | description=_(
|
|---|
| 352 | u"""Table, table view, feature class, or feature layer for which the
|
|---|
| 353 | plot should be generated."""),
|
|---|
| 354 | arcGISDisplayName=_(u'Table'))
|
|---|
| 355 |
|
|---|
| 356 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'fields',
|
|---|
| 357 | typeMetadata=ListTypeMetadata(ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'SHORT', u'LONG', u'FLOAT', u'DOUBLE', u'TEXT', u'DATE']), canBeNone=True),
|
|---|
| 358 | description=_(
|
|---|
| 359 | u"""Fields of the table to include in the plot.
|
|---|
| 360 |
|
|---|
| 361 | You may only specify fields with the data types SHORT, LONG, FLOAT,
|
|---|
| 362 | DOUBLE, TEXT, or DATE. If you do not provide a list of fields, all of
|
|---|
| 363 | the fields having those data types will be included in the matrix.
|
|---|
| 364 |
|
|---|
| 365 | The ArcGIS LONG value -2147483648 cannot be loaded into R because it
|
|---|
| 366 | is used internally by R to represent the special value NA ("not
|
|---|
| 367 | available"). If one of the fields contains this integer value, an
|
|---|
| 368 | error will be reported."""),
|
|---|
| 369 | arcGISParameterDependencies=[u'table'],
|
|---|
| 370 | arcGISDisplayName=_(u'Fields'))
|
|---|
| 371 |
|
|---|
| 372 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'transforms',
|
|---|
| 373 | typeMetadata=ListTypeMetadata(elementType=UnicodeStringTypeMetadata(minLength=1), canBeNone=True),
|
|---|
| 374 | description=_(
|
|---|
| 375 | u"""Transformations to perform on the fields before creating the plot.
|
|---|
| 376 |
|
|---|
| 377 | Use this parameter when the distribution of one or more fields is too
|
|---|
| 378 | skewed to yield an informative plot. This parameter is a list where
|
|---|
| 379 | each entry corresponds to a field. Each entry is an R expression that
|
|---|
| 380 | operates on the vector d that represents the original values of that
|
|---|
| 381 | field. For example, the following expressions perform natural
|
|---|
| 382 | logarithm, base 10 logarithm, square root, and cube root transforms,
|
|---|
| 383 | respectively::
|
|---|
| 384 |
|
|---|
| 385 | log(d)
|
|---|
| 386 | log10(d)
|
|---|
| 387 | d^(1/2)
|
|---|
| 388 | d^(1/3)
|
|---|
| 389 |
|
|---|
| 390 | The expression may be as complicated as you want, so long as it
|
|---|
| 391 | conforms to R syntax, operates only on the variable d, and yields a
|
|---|
| 392 | vector of the same length as the input data. For example, if the input
|
|---|
| 393 | data represent water depth expressed as a negative number (e.g. -100
|
|---|
| 394 | is 100 meters below the surface), and you want to transform the data
|
|---|
| 395 | using a base 10 logarithm, you must first take the absolute value of
|
|---|
| 396 | depth::
|
|---|
| 397 |
|
|---|
| 398 | log10(abs(d))
|
|---|
| 399 |
|
|---|
| 400 | When you do not want to transform a field but are forced to provide a
|
|---|
| 401 | value, simply use d as the expression. For example, if you want to
|
|---|
| 402 | plot three fields--Depth, SST, and Chlorophyll--and want to log10
|
|---|
| 403 | transform just Depth and Chlorophyll, provide these expressions::
|
|---|
| 404 |
|
|---|
| 405 | log10(d)
|
|---|
| 406 | d
|
|---|
| 407 | log10(d)
|
|---|
| 408 |
|
|---|
| 409 | Alternatively, you could reorder the fields to be Depth, Chlorophyll,
|
|---|
| 410 | SST and then just provide two expressions, omitting the one for SST::
|
|---|
| 411 |
|
|---|
| 412 | log10(d)
|
|---|
| 413 | log10(d)
|
|---|
| 414 | """),
|
|---|
| 415 | arcGISDisplayName=_(u'Transforms'))
|
|---|
| 416 |
|
|---|
| 417 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'where',
|
|---|
| 418 | typeMetadata=SQLWhereClauseTypeMetadata(canBeNone=True),
|
|---|
| 419 | description=ArcGIS91SelectCursor.__init__.__doc__.Obj.GetArgumentByName(u'where').Description,
|
|---|
| 420 | arcGISParameterDependencies=[u'table'],
|
|---|
| 421 | arcGISDisplayName=_(u'Where clause'))
|
|---|
| 422 |
|
|---|
| 423 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'diagonal',
|
|---|
| 424 | typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Name', u'Histogram'], makeLowercase=True),
|
|---|
| 425 | description=_(
|
|---|
| 426 | u"""Type of plot to display in the diagonal panels:
|
|---|
| 427 |
|
|---|
| 428 | * Name - display the name of the variable.
|
|---|
| 429 |
|
|---|
| 430 | * Histogram - display the name of the variable and histogram of its
|
|---|
| 431 | values.
|
|---|
| 432 | """),
|
|---|
| 433 | arcGISDisplayName=_(u'Diagonal panels'),
|
|---|
| 434 | arcGISCategory=_(u'Formatting options'))
|
|---|
| 435 |
|
|---|
| 436 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'lower',
|
|---|
| 437 | typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'Scatterplot', u'Smooth', u'Correlation', u'Correlation (Kendall)', u'Correlation (Spearman)'], makeLowercase=True),
|
|---|
| 438 | description=_(
|
|---|
| 439 | u"""Type of plot to produce in the panels below the diagonal:
|
|---|
| 440 |
|
|---|
| 441 | * Scatterplot - display a scatterplot of the two variables.
|
|---|
| 442 |
|
|---|
| 443 | * Smooth - display a scatterplot of the two variables and line fitted
|
|---|
| 444 | using the LOWESS smoother.
|
|---|
| 445 |
|
|---|
| 446 | * Correlation - display Pearson's correlation coefficent for the two
|
|---|
| 447 | variables.
|
|---|
| 448 |
|
|---|
| 449 | * Correlation (Kendall) - display Kendall's rank correlation
|
|---|
| 450 | coefficent (Kendall's tau) for the two variables.
|
|---|
| 451 |
|
|---|
| 452 | * Correlation (Spearman) - display Spearman's rank correlation
|
|---|
| 453 | coefficent (rho) for the two variables.
|
|---|
| 454 | """),
|
|---|
| 455 | arcGISDisplayName=_(u'Lower panels'),
|
|---|
| 456 | arcGISCategory=_(u'Formatting options'))
|
|---|
| 457 |
|
|---|
| 458 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'upper',
|
|---|
| 459 | typeMetadata=RExploratoryPlots.ScatterplotMatrixForArcGISTable.__doc__.Obj.GetArgumentByName(u'lower').Type,
|
|---|
| 460 | description=RExploratoryPlots.ScatterplotMatrixForArcGISTable.__doc__.Obj.GetArgumentByName(u'lower').Description,
|
|---|
| 461 | arcGISDisplayName=_(u'Upper panels'),
|
|---|
| 462 | arcGISCategory=_(u'Formatting options'))
|
|---|
| 463 |
|
|---|
| 464 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'xColumnName',
|
|---|
| 465 | typeMetadata=ArcGISFieldTypeMetadata(canBeNone=True),
|
|---|
| 466 | description=_(
|
|---|
| 467 | u"""Variable name to use in plot for the X coordinates of point
|
|---|
| 468 | features. If the table is a point feature class or layer, the X
|
|---|
| 469 | coordinates will be extracted from the points and appear in the plot
|
|---|
| 470 | using the name provided for this parameter."""),
|
|---|
| 471 | arcGISDisplayName=_(u'Name to use for X coordinates of points'),
|
|---|
| 472 | arcGISCategory=_(u'Point feature options'))
|
|---|
| 473 |
|
|---|
| 474 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'yColumnName',
|
|---|
| 475 | typeMetadata=ArcGISFieldTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'xColumnName']),
|
|---|
| 476 | description=_(
|
|---|
| 477 | u"""Variable name to use in the plot for the Y coordinates of point
|
|---|
| 478 | features. If the table is a point feature class or layer, the Y
|
|---|
| 479 | coordinates will be extracted from the points and appear in the plot
|
|---|
| 480 | using the name provided for this parameter."""),
|
|---|
| 481 | arcGISDisplayName=_(u'Name to use for Y coordinates of points'),
|
|---|
| 482 | arcGISCategory=_(u'Point feature options'))
|
|---|
| 483 |
|
|---|
| 484 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'zColumnName',
|
|---|
| 485 | typeMetadata=ArcGISFieldTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'xColumnName', u'yColumnName']),
|
|---|
| 486 | description=_(
|
|---|
| 487 | u"""Variable name to use in the plot for the Z coordinates of point
|
|---|
| 488 | features. If the table is a point feature class or layer that has Z
|
|---|
| 489 | coordinates, the coordinates will be extracted from the points and
|
|---|
| 490 | appear in the plot using the name provided for this parameter."""),
|
|---|
| 491 | arcGISDisplayName=_(u'Name to use for Z coordinates of points'),
|
|---|
| 492 | arcGISCategory=_(u'Point feature options'))
|
|---|
| 493 |
|
|---|
| 494 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'mColumnName',
|
|---|
| 495 | typeMetadata=ArcGISFieldTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'xColumnName', u'yColumnName', u'zColumnName']),
|
|---|
| 496 | description=_(
|
|---|
| 497 | u"""Variable name to use in the plot for the measure values of point
|
|---|
| 498 | features. If the table is a point feature class or layer that has
|
|---|
| 499 | measure values, the values will be extracted from the points and
|
|---|
| 500 | appear in the plot using the name provided for this parameter."""),
|
|---|
| 501 | arcGISDisplayName=_(u'Name to use for M values of points'),
|
|---|
| 502 | arcGISCategory=_(u'Point feature options'))
|
|---|
| 503 |
|
|---|
| 504 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'outputFile',
|
|---|
| 505 | typeMetadata=FileTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'table'], deleteIfParameterIsTrue=u'overwriteExisting', createParentDirectories=True),
|
|---|
| 506 | description=_(
|
|---|
| 507 | u"""File to create for the plot. If this parameter is specified, the
|
|---|
| 508 | plot will be written to the file rather than displayed on the screen.
|
|---|
| 509 |
|
|---|
| 510 | The file must have one of the following two extensions, which
|
|---|
| 511 | determines the format that will be used:
|
|---|
| 512 |
|
|---|
| 513 | * .emf - Windows enhanced metafile (EMF) format. This is a vector
|
|---|
| 514 | format that may be printed and resized without any pixelation and is
|
|---|
| 515 | therefore suitable for use in printable documents that recognize
|
|---|
| 516 | this format (e.g. Microsoft Word or Microsoft Visio).
|
|---|
| 517 |
|
|---|
| 518 | * .png - Portable network graphics (PNG) format. This is a compressed,
|
|---|
| 519 | lossless, highly portable raster format suitable for use in web
|
|---|
| 520 | pages or other locations where a raster format is desired. Most
|
|---|
| 521 | scientific journals accept PNG; they typically request that files
|
|---|
| 522 | have a resolution of at least 1000 DPI.
|
|---|
| 523 | """),
|
|---|
| 524 | direction=u'Output',
|
|---|
| 525 | arcGISDisplayName=_(u'Output file'),
|
|---|
| 526 | arcGISCategory=_(u'Output file options'))
|
|---|
| 527 |
|
|---|
| 528 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'res',
|
|---|
| 529 | typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
|
|---|
| 530 | description=_(
|
|---|
| 531 | u"""Resolution of the output plot file, in dots per inch (DPI), when
|
|---|
| 532 | it is in PNG format. The default is set to a high value (1000) because
|
|---|
| 533 | this is the minimum resolution typically required by scientific
|
|---|
| 534 | journals that accept figures in PNG format.
|
|---|
| 535 |
|
|---|
| 536 | This parameter is ignored for EMF format because it is a vector
|
|---|
| 537 | format."""),
|
|---|
| 538 | arcGISDisplayName=_(u'Plot resolution, in DPI'),
|
|---|
| 539 | arcGISCategory=_(u'Output file options'))
|
|---|
| 540 |
|
|---|
| 541 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'width',
|
|---|
| 542 | typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
|
|---|
| 543 | description=_(
|
|---|
| 544 | u"""Plot file width in thousandths of inches (for EMF format; e.g. the
|
|---|
| 545 | value 3000 is 3 inches) or pixels (for PNG format)."""),
|
|---|
| 546 | arcGISDisplayName=_(u'Plot width'),
|
|---|
| 547 | arcGISCategory=_(u'Output file options'))
|
|---|
| 548 |
|
|---|
| 549 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'height',
|
|---|
| 550 | typeMetadata=FloatTypeMetadata(mustBeGreaterThan=0.),
|
|---|
| 551 | description=_(
|
|---|
| 552 | u"""Plot file height in thousandths of inches (for EMF format; e.g. the
|
|---|
| 553 | value 3000 is 3 inches) or pixels (for PNG format)."""),
|
|---|
| 554 | arcGISDisplayName=_(u'Plot height'),
|
|---|
| 555 | arcGISCategory=_(u'Output file options'))
|
|---|
| 556 |
|
|---|
| 557 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'pointSize',
|
|---|
| 558 | typeMetadata=FloatTypeMetadata(minValue=1.0),
|
|---|
| 559 | description=_(
|
|---|
| 560 | u"""The default pointsize of text in the output plot file."""),
|
|---|
| 561 | arcGISDisplayName=_(u'Default pointsize of text'),
|
|---|
| 562 | arcGISCategory=_(u'Output file options'))
|
|---|
| 563 |
|
|---|
| 564 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'bg',
|
|---|
| 565 | typeMetadata=UnicodeStringTypeMetadata(),
|
|---|
| 566 | description=_(
|
|---|
| 567 | u"""Background color when the output plot file is in PNG format. The
|
|---|
| 568 | color must be a valid name in R's color palette, or "transparent" if
|
|---|
| 569 | there is no background color. This parameter is ignored for EMF
|
|---|
| 570 | format."""),
|
|---|
| 571 | arcGISDisplayName=_(u'Plot background color'),
|
|---|
| 572 | arcGISCategory=_(u'Output file options'))
|
|---|
| 573 |
|
|---|
| 574 | AddArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'overwriteExisting',
|
|---|
| 575 | typeMetadata=BooleanTypeMetadata(),
|
|---|
| 576 | description=_(
|
|---|
| 577 | u"""If True, the output file will be overwritten, if it exists. If
|
|---|
| 578 | False, a ValueError will be raised if the output file exists."""),
|
|---|
| 579 | initializeToArcGISGeoprocessorVariable=u'OverwriteOutput')
|
|---|
| 580 |
|
|---|
| 581 | # Public method: RExploratoryPlots.DensityHistogramForArcGISField
|
|---|
| 582 |
|
|---|
| 583 | AddMethodMetadata(RExploratoryPlots.DensityHistogramForArcGISField,
|
|---|
| 584 | shortDescription=_(u'Creates a density histogram for a field of a table.'),
|
|---|
| 585 | isExposedToPythonCallers=True,
|
|---|
| 586 | isExposedByCOM=True,
|
|---|
| 587 | isExposedAsArcGISTool=True,
|
|---|
| 588 | arcGISDisplayName=_(u'Density Histogram for Field'),
|
|---|
| 589 | arcGISToolCategory=_(u'Statistics\\Explore Data'),
|
|---|
| 590 | dependencies=[ArcGISDependency(9, 1), RDependency(2, 5, 0)])
|
|---|
| 591 |
|
|---|
| 592 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'cls', RExploratoryPlots.DensityHistogramForArcGISField, u'cls')
|
|---|
| 593 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'table', RExploratoryPlots.DensityHistogramForArcGISField, u'table')
|
|---|
| 594 |
|
|---|
| 595 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'densityField',
|
|---|
| 596 | typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'SHORT', u'LONG', u'FLOAT', u'DOUBLE', u'DATE']),
|
|---|
| 597 | description=_(
|
|---|
| 598 | u"""Field for which a density histogram should be created.
|
|---|
| 599 |
|
|---|
| 600 | The field must have the data type SHORT, LONG, FLOAT, DOUBLE, or DATE.
|
|---|
| 601 | NULL values will not be included in the histogram."""),
|
|---|
| 602 | arcGISParameterDependencies=[u'table'],
|
|---|
| 603 | arcGISDisplayName=_(u'Density field'))
|
|---|
| 604 |
|
|---|
| 605 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'transform',
|
|---|
| 606 | typeMetadata=UnicodeStringTypeMetadata(canBeNone=True, minLength=1),
|
|---|
| 607 | description=_(
|
|---|
| 608 | u"""Transformation to perform before plotting the density histogram.
|
|---|
| 609 |
|
|---|
| 610 | Use this parameter when the distribution of the original data is too
|
|---|
| 611 | skewed to yield an informative plot. This parameter must be an R
|
|---|
| 612 | expression that operates on the vector d that represents the original
|
|---|
| 613 | values. For example, the following expressions perform natural
|
|---|
| 614 | logarithm, base 10 logarithm, square root, and cube root transforms,
|
|---|
| 615 | respectively::
|
|---|
| 616 |
|
|---|
| 617 | log(d)
|
|---|
| 618 | log10(d)
|
|---|
| 619 | d^(1/2)
|
|---|
| 620 | d^(1/3)
|
|---|
| 621 |
|
|---|
| 622 | The expression may be as complicated as you want, so long as it
|
|---|
| 623 | conforms to R syntax, operates only on the variable d, and yields a
|
|---|
| 624 | vector of the same length as the input data. For example, if the input
|
|---|
| 625 | data represent water depth expressed as a negative number (e.g. -100
|
|---|
| 626 | is 100 meters below the surface), and you want to transform the data
|
|---|
| 627 | using a base 10 logarithm, you must first take the absolute value of
|
|---|
| 628 | depth::
|
|---|
| 629 |
|
|---|
| 630 | log10(abs(d))
|
|---|
| 631 | """),
|
|---|
| 632 | arcGISDisplayName=_(u'Transform'))
|
|---|
| 633 |
|
|---|
| 634 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'categoryField',
|
|---|
| 635 | typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'SHORT', u'LONG', u'FLOAT', u'DOUBLE', u'TEXT', u'DATE'], canBeNone=True),
|
|---|
| 636 | description=_(
|
|---|
| 637 | u"""Field specifying categories for the data.
|
|---|
| 638 |
|
|---|
| 639 | A separate histogram line will be plotted for each category, allowing
|
|---|
| 640 | you to compare the distribution of data between categories. For
|
|---|
| 641 | example, in an ecology study, if you wanted to compare the
|
|---|
| 642 | distribution at locations where a species was present to locations
|
|---|
| 643 | where it was absent, you could specify the "IsPresent" field as the
|
|---|
| 644 | category field (1 = species present, 0 = species absent).
|
|---|
| 645 |
|
|---|
| 646 | The field must have the data type SHORT, LONG, FLOAT, DOUBLE, TEXT, or
|
|---|
| 647 | DATE. Rows with NULL values for this field will not be included in the
|
|---|
| 648 | histogram.
|
|---|
| 649 |
|
|---|
| 650 | A maximum of six categories is allowed. If this field contains more
|
|---|
| 651 | than six unique values, an error will be reported. You can reduce the
|
|---|
| 652 | number of categories by specifying a Where Clause that restricts the
|
|---|
| 653 | rows that are processed to those having the six or fewer category
|
|---|
| 654 | values you are most interested in."""),
|
|---|
| 655 | arcGISParameterDependencies=[u'table'],
|
|---|
| 656 | arcGISDisplayName=_(u'Category field'))
|
|---|
| 657 |
|
|---|
| 658 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'where', RExploratoryPlots.DensityHistogramForArcGISField, u'where')
|
|---|
| 659 |
|
|---|
| 660 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'legend',
|
|---|
| 661 | typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'bottom', u'bottomleft', u'bottomright', u'center', u'left', u'right', u'top', u'topleft', u'topright'], canBeNone=True, makeLowercase=True),
|
|---|
| 662 | description=_(
|
|---|
| 663 | u"""Position of the plot's legend. If this parameter is omitted, no
|
|---|
| 664 | legend will be drawn."""),
|
|---|
| 665 | arcGISDisplayName=_(u'Legend'))
|
|---|
| 666 |
|
|---|
| 667 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'outputFile', RExploratoryPlots.DensityHistogramForArcGISField, u'outputFile')
|
|---|
| 668 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'res', RExploratoryPlots.DensityHistogramForArcGISField, u'res')
|
|---|
| 669 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'width', RExploratoryPlots.DensityHistogramForArcGISField, u'width')
|
|---|
| 670 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'height', RExploratoryPlots.DensityHistogramForArcGISField, u'height')
|
|---|
| 671 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'pointSize', RExploratoryPlots.DensityHistogramForArcGISField, u'pointSize')
|
|---|
| 672 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'bg', RExploratoryPlots.DensityHistogramForArcGISField, u'bg')
|
|---|
| 673 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'overwriteExisting', RExploratoryPlots.DensityHistogramForArcGISField, u'overwriteExisting')
|
|---|
| 674 |
|
|---|
| 675 | # Public method: RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates
|
|---|
| 676 |
|
|---|
| 677 | AddMethodMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates,
|
|---|
| 678 | shortDescription=_(u'Creates a density histogram for one of the coordinates of a point feature class or layer.'),
|
|---|
| 679 | isExposedToPythonCallers=True,
|
|---|
| 680 | isExposedByCOM=True,
|
|---|
| 681 | isExposedAsArcGISTool=True,
|
|---|
| 682 | arcGISDisplayName=_(u'Density Histogram for Point Coordinate'),
|
|---|
| 683 | arcGISToolCategory=_(u'Statistics\\Explore Data'),
|
|---|
| 684 | dependencies=[ArcGISDependency(9, 1), RDependency(2, 5, 0)])
|
|---|
| 685 |
|
|---|
| 686 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'cls', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'cls')
|
|---|
| 687 |
|
|---|
| 688 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'pointFeatures',
|
|---|
| 689 | typeMetadata=ArcGISFeatureLayerTypeMetadata(mustExist=True, allowedShapeTypes=[u'Point']),
|
|---|
| 690 | description=_(
|
|---|
| 691 | u"""Point feature class or layer for which the plot should be
|
|---|
| 692 | generated."""),
|
|---|
| 693 | arcGISDisplayName=_(u'Point features'))
|
|---|
| 694 |
|
|---|
| 695 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'coordinate',
|
|---|
| 696 | typeMetadata=UnicodeStringTypeMetadata(allowedValues=[u'x', u'y', u'z', u'm'], makeLowercase=True),
|
|---|
| 697 | description=_(
|
|---|
| 698 | u"""Point coordinate for which a density histogram should be plotted:
|
|---|
| 699 |
|
|---|
| 700 | * x - the x coordinate
|
|---|
| 701 |
|
|---|
| 702 | * y - the y coordinate
|
|---|
| 703 |
|
|---|
| 704 | * z - the z coordinate
|
|---|
| 705 |
|
|---|
| 706 | * m - the measure value
|
|---|
| 707 |
|
|---|
| 708 | An error will be reported if you specify z or m and the point features
|
|---|
| 709 | do not have z coordinates or measure values."""),
|
|---|
| 710 | arcGISDisplayName=_(u'Coordinate to plot'))
|
|---|
| 711 |
|
|---|
| 712 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'coordinateName',
|
|---|
| 713 | typeMetadata=UnicodeStringTypeMetadata(canBeNone=True),
|
|---|
| 714 | description=_(
|
|---|
| 715 | u"""Name to display for the coordinate (e.g. "Longitude"). If you do
|
|---|
| 716 | not specify a name, "x", "y", "z", or "m" will be used."""),
|
|---|
| 717 | arcGISDisplayName=_(u'Name to display for the coordinate'))
|
|---|
| 718 |
|
|---|
| 719 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'transform', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'transform')
|
|---|
| 720 |
|
|---|
| 721 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'categoryField',
|
|---|
| 722 | typeMetadata=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'categoryField').Type,
|
|---|
| 723 | description=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'categoryField').Description,
|
|---|
| 724 | arcGISParameterDependencies=[u'pointFeatures'],
|
|---|
| 725 | arcGISDisplayName=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'categoryField').ArcGISDisplayName)
|
|---|
| 726 |
|
|---|
| 727 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'where',
|
|---|
| 728 | typeMetadata=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'where').Type,
|
|---|
| 729 | description=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'where').Description,
|
|---|
| 730 | arcGISParameterDependencies=[u'pointFeatures'],
|
|---|
| 731 | arcGISDisplayName=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'where').ArcGISDisplayName)
|
|---|
| 732 |
|
|---|
| 733 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'legend', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'legend')
|
|---|
| 734 |
|
|---|
| 735 | AddArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'outputFile',
|
|---|
| 736 | typeMetadata=FileTypeMetadata(canBeNone=True, mustBeDifferentThanArguments=[u'pointFeatures'], deleteIfParameterIsTrue=u'overwriteExisting', createParentDirectories=True),
|
|---|
| 737 | description=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'outputFile').Description,
|
|---|
| 738 | direction=u'Output',
|
|---|
| 739 | arcGISDisplayName=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'outputFile').ArcGISDisplayName,
|
|---|
| 740 | arcGISCategory=RExploratoryPlots.DensityHistogramForArcGISField.__doc__.Obj.GetArgumentByName(u'outputFile').ArcGISCategory)
|
|---|
| 741 |
|
|---|
| 742 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'res', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'res')
|
|---|
| 743 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'width', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'width')
|
|---|
| 744 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'height', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'height')
|
|---|
| 745 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'pointSize', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'pointSize')
|
|---|
| 746 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'bg', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'bg')
|
|---|
| 747 | CopyArgumentMetadata(RExploratoryPlots.DensityHistogramForArcGISField, u'overwriteExisting', RExploratoryPlots.DensityHistogramForArcGISPointsCoordinates, u'overwriteExisting')
|
|---|
| 748 |
|
|---|
| 749 | # Public method: RExploratoryPlots.ClevelandPlotForArcGISTable
|
|---|
| 750 |
|
|---|
| 751 | AddMethodMetadata(RExploratoryPlots.ClevelandPlotForArcGISTable,
|
|---|
| 752 | shortDescription=_(u'Creates a multi-panel Cleveland dotplot for a table.'),
|
|---|
| 753 | longDescription=_(
|
|---|
| 754 | u"""Cleveland dotplots (Cleveland 1993) are typically used to explore
|
|---|
| 755 | the distributions of values in a table and detect possible outliers.
|
|---|
| 756 | Each dotplot shows the row number of the record vs. the value of a
|
|---|
| 757 | field. Points that appear far to the left or right are extreme values
|
|---|
| 758 | of that field and may be statistical outliers that should be
|
|---|
| 759 | investigated and possibly removed prior to further analysis of the
|
|---|
| 760 | data.
|
|---|
| 761 |
|
|---|
| 762 | For advice on how to use Cleveland dotplots, please see Zuur et al.
|
|---|
| 763 | (2009).
|
|---|
| 764 |
|
|---|
| 765 | **References:**
|
|---|
| 766 |
|
|---|
| 767 | Cleveland, W.S. (1993) Visualizing Data. Hobart Press, Summit, NJ.
|
|---|
| 768 |
|
|---|
| 769 | Zuur, A.F., Ineo, E.N., Elphick, C.S. (2009) A protocol for data
|
|---|
| 770 | exploration to avoid common statistical problems. Methods in Ecology &
|
|---|
| 771 | Evolution 1: 3-14."""),
|
|---|
| 772 | isExposedToPythonCallers=True,
|
|---|
| 773 | isExposedByCOM=True,
|
|---|
| 774 | isExposedAsArcGISTool=True,
|
|---|
| 775 | arcGISDisplayName=_(u'Cleveland Plot for Table'),
|
|---|
| 776 | arcGISToolCategory=_(u'Statistics\\Explore Data'),
|
|---|
| 777 | dependencies=[ArcGISDependency(9, 1), RDependency(2, 5, 0)])
|
|---|
| 778 |
|
|---|
| 779 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'cls', RExploratoryPlots.ClevelandPlotForArcGISTable, u'cls')
|
|---|
| 780 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'table', RExploratoryPlots.ClevelandPlotForArcGISTable, u'table')
|
|---|
| 781 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'fields', RExploratoryPlots.ClevelandPlotForArcGISTable, u'fields')
|
|---|
| 782 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'transforms', RExploratoryPlots.ClevelandPlotForArcGISTable, u'transforms')
|
|---|
| 783 |
|
|---|
| 784 | AddArgumentMetadata(RExploratoryPlots.ClevelandPlotForArcGISTable, u'orderByField',
|
|---|
| 785 | typeMetadata=ArcGISFieldTypeMetadata(mustExist=True, allowedFieldTypes=[u'SHORT', u'LONG', u'FLOAT', u'DOUBLE', u'TEXT', u'DATE'], canBeNone=True),
|
|---|
| 786 | description=_(
|
|---|
| 787 | u"""Field specifying how the data will be ordered on the y axis of the
|
|---|
| 788 | plots.
|
|---|
| 789 |
|
|---|
| 790 | This parameter is optional and provided to enhance readability when
|
|---|
| 791 | the plotted fields' values correlate with another field. For example,
|
|---|
| 792 | if the weight and size of an animal correlate with the animal's age,
|
|---|
| 793 | you could order the plots by age and the weight and size points would
|
|---|
| 794 | cluster around a trend line rather than being randomly dispersed. This
|
|---|
| 795 | may aid in the visual identification of possible outliers."""),
|
|---|
| 796 | arcGISParameterDependencies=[u'table'],
|
|---|
| 797 | arcGISDisplayName=_(u'Order by field'))
|
|---|
| 798 |
|
|---|
| 799 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'where', RExploratoryPlots.ClevelandPlotForArcGISTable, u'where')
|
|---|
| 800 |
|
|---|
| 801 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'xColumnName', RExploratoryPlots.ClevelandPlotForArcGISTable, u'xColumnName')
|
|---|
| 802 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'yColumnName', RExploratoryPlots.ClevelandPlotForArcGISTable, u'yColumnName')
|
|---|
| 803 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'zColumnName', RExploratoryPlots.ClevelandPlotForArcGISTable, u'zColumnName')
|
|---|
| 804 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'mColumnName', RExploratoryPlots.ClevelandPlotForArcGISTable, u'mColumnName')
|
|---|
| 805 |
|
|---|
| 806 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'outputFile', RExploratoryPlots.ClevelandPlotForArcGISTable, u'outputFile')
|
|---|
| 807 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'res', RExploratoryPlots.ClevelandPlotForArcGISTable, u'res')
|
|---|
| 808 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'width', RExploratoryPlots.ClevelandPlotForArcGISTable, u'width')
|
|---|
| 809 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'height', RExploratoryPlots.ClevelandPlotForArcGISTable, u'height')
|
|---|
| 810 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'pointSize', RExploratoryPlots.ClevelandPlotForArcGISTable, u'pointSize')
|
|---|
| 811 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'bg', RExploratoryPlots.ClevelandPlotForArcGISTable, u'bg')
|
|---|
| 812 | CopyArgumentMetadata(RExploratoryPlots.ScatterplotMatrixForArcGISTable, u'overwriteExisting', RExploratoryPlots.ClevelandPlotForArcGISTable, u'overwriteExisting')
|
|---|
| 813 |
|
|---|
| 814 | ###############################################################################
|
|---|
| 815 | # Names exported by this module
|
|---|
| 816 | ###############################################################################
|
|---|
| 817 |
|
|---|
| 818 | __all__ = ['RExploratoryPlots']
|
|---|