In order to run R from Windows Command Prompt you need to use Rscript, that comes with the installation of R.
>"C:\Program Files\R\R-3.1.2\bin\i386\Rscript.exe" Upload-csv-to-arcGis-with-R.R <username> <password> <ItemName> <CSV_File> <latitude_field_name> <longitude_field_name> <Tag>
>"C:\Program Files\R\R-3.1.2\bin\i386\Rscript.exe" Upload-csv-to-arcGis-with-R.R aruizga ***password*** ItemName C:/data.csv latitude longitude MyTag
This script is useful for someone who is not familiar with R but would like to run geoprocessing scripts as a scheduled task. Calling a model from a R script is much more reliable than exporting a model to a R script for a few reasons:
-
Takes a CSV file with latitude and longitude values and creates a feature service
-
Feature services are a powerful way to share GIS data online