Does the sf package in R use any online API? - r

I am trying to understand if the sf package in R operates at the local (desktop) level or if it uses API to transmit information online. The documentation mentions the use of API to pull in algorithms but it is unclear to me what that involves.

The package operates locally; once compiled it is perfectly capable of being run in firewalled contexts if that is your question.

Related

Is there a package to connect R to AWS SSM?

Python has an SSM client in the Boto 3 package: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ssm.html. Is there something similar for R? If not, any recommendations for how to make something similar? Thanks!
At the moment a package called paws on github
Access over 150 AWS services, including Machine Learning Translation
Natural Language Processing Databases File Storage
Or the cloudyr project
Welcome to the cloudyr project! The goal of this initiative is to make
cloud computing with R easier, starting with robust tools for working
with cloud computing platforms. The project’s inital work is with
Amazon Web Services, various crowdsourcing platforms, and popular
continuous integration services for R package development. Tools for
Google Cloud Services and Microsoft Azure are also on the long-term
agenda.
I only checked paws and that has the ssm functionality according to the paws documentation about ssm. The cloudyr project has many aws packages on cran. Not sure if in one of them is the ssm functionality.

Using R in Apache Spark

There are some options to access R libraries in Spark:
directly using sparkr
using language bindings like rpy2 or rscala
using standalone service like opencpu
It looks like SparkR is quite limited, OpenCPU requires keeping additional service and bindings can have stability issue. Is there something else specific to Spark architecture which make using any solution not easy.
Do you have any experience with integrating R and Spark you can share?
The main language for the project seems like an important factor.
If pyspark is a good way to use Spark for you (meaning that you are accessing Spark from Python) accessing R through rpy2 should not make much difference from using any other Python library with a C-extension.
There exist reports of users doing so (although with occasional questions such as How can I partition pyspark RDDs holding R functions or Can I connect an external (R) process to each pyspark worker during setup)
If R is your main language, helping the SparkR authors with feedback or contributions where you feel there are limitation would be way to go.
If your main language is Scala, rscala should be your first try.
While the combo pyspark + rpy2 would seem the most "established" (as in "uses the oldest and probably most-tried codebase"), this does not necessarily mean that it is the best solution (and young packages can evolve quickly). I'd assess first what is the preferred language for the project and try options from there.

Consume a web service in R

Here's the scenario:
I have JBoss serving a web service with JBossWS providing me with a wsdl. I have connected and used it from both .NET and Java so far (and it has been quite easy once I figured it out). I am now trying to do the same with R.
Is there anything out there considered to be "the right way" for doing this? I am not that familiar with R, and my searches have not turned up much, so I figured I'd ask and maybe spare my head and the wall a bit of damage.
I have had good luck using rJava to recreate in R something that works in Java. I use this method for connecting to Amazon's AWS Java SDK for their API with R. This allows me, for example, to transfer files to/from S3 from R without having to recreate the whole connection/handshake/boogieWoogie from R.
If you wanted to go more "pure R" I think you'll have to use some combination of RCurl and the XML package to grab and parse the wsdl.
There are a number of ways:
You could retain your Java approach and use the rJava package around it
You could use RCurl which is used to power a few higher-level packages (accessing Google APIs, say)
I believe there is an older SSOAP package on Omegahat which may help too.

Document/Scripts management for R code

I am looking for a solution that allows me to keep a track of a multitude of R scripts that I create for various projects and purposes. Some scripts are easily tracked to specific projects, whereas others are "convenience" functions created to serve a set of tasks.
Is there a way I can create a central DB and query it to find which scripts match most appropriately?
I could create a system using a DBMS manually, but are users aware of anything in general or specific to R, that comes in the form of a software tool (maybe FOSS) ?
EDIT: Thank you for the responses. My current system is just a set of scripts with comments that allow me to identify their intended task. Though I use StatET with SVN, I would like a search utility along the lines of the "sos" package.
The question
I am looking for a solution that allows me to keep a track of a multitude of R scripts
that I create for various projects and purposes. Some scripts are easily tracked to specific
projects, whereas others are "convenience" functions created to serve a set of tasks.
fails to address the obvious follow-up of why the existing mechanism is not suitable:
Create a local package for each project
Create one or more local packages for local utility functions
Use R's already existing mechanisms for searching, indexing, testing, cross-referencing
And use any revision control system of your liking, local or on the web, to host the code for 1. to 3. above.
Reinventing an RDBMS schema for 1. to 3. is just wrong in my book. But if you must, go ahead and replicate what you can already (mostly) get for free in tested and widely used code.
R comes with several mechanisms for searching for help, most of which naturally use CRAN. Some examples: the sos package, cranberries, crantastic, and rseek. In many cases, these could be adapted to use a local repository (you can find out how to create a local repository in the R manual, which is very easy to do). Otherwise, if you package your scripts and submit them to CRAN, you will naturally have these available to you. I would also highly recommend this presentation on the subject: Creating R Packages, Using CRAN, R-Forge, And Local R Archive Networks And Subversion (SVN) Repositories from Spencer Graves and Sundar Dorai-Raj.
These would require you to put your code in packages, and create documentation, all of which is worth doing anyway. The package documentation turns out to be very useful for both documenting what things do, and helping your find them in the future. You can use roxygen to create this documentation in-line with your code. Also read this related question: Organizing R Source Code.
Alternatively, the help.search() function can be very useful for searching local packages, regardless of whether you have a repository set up.
You'd probably be best working with a version control system. Many can be indexed and be made search-able. At my work, a stack of R, Eclipse, StatET, Subversion and Subclipse works very well for us.

R - Google Analytics Package [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there an R package that connects to the Google Analytics API? Does anyone have any pointers otherwise?
http://code.google.com/p/r-google-analytics/
This package is now available
Well, there's one option (that i am aware of) for explicitly connecting the two (Google Analytics & R).
This option requires R-DCOM (an interface to COM and DCOM to access R); you can get that here.
So i guess this is limited to Windows/.NET and C# (or any .NET language, i suppose).
I haven't used it (incompatible OS) but i have set it up for someone else; at least install & set-up are fairly straightforward:
install DCOM
then config--begin by executing the
"dcomcnfg" in the console window
this launches a component mgr; search
StatConnectorSrv in DCOM components
for 'properties'
update the permissions--done.
There's a also complete tutorial, source code included (C#), for DCOM setup/install and building a small App that has programmatic access to Google Analytics and R, available here.
But if all you want to do is get the data into R, all the pieces you need are readily available, e.g., my workflow:
export the data i need from the GA
main panel. GA delivers your data in
XML.
parse the raw data using the XML library (not part of the base distro, but available on CRAN)
(also pretty obvious) i store my
data in an R dataframe (for analysis
only, later it's broken up into
tables and stored in a PostgreSQL
database, using the RPostgreSQL
package, which provides the drivers
and R interface (DBI) to the pg
database).
Lastly, it's not GA but another Google data resource with an R interface: the Omega Project has a fairly new R Package that provides an interface to GoogleTrends (called 'RGoogleTrends'), available here.
I've put an updated version of the original r-google-analytics package on github: https://github.com/JerryWho/rgoogleanalytics
Here I've changed to version 2.4 of the API. The older version just used v2.3 which doesn't work since summer any more.
I'm actually building one now, i'll aim to get it onto CRAN as soon as possible
A new package has just been announced:
http://github.com/sorenmacbeth/googleanalytics4r
The Google Analytics API site has an example on how to retrieve analytics data using curl http://code.google.com/intl/fi-FI/apis/analytics/docs/gdata/2.0/gdataProtocol.html so supposedly you should be able to modify the examples and use Rcurl to retrieve the data.
There is a nice python package for getting data from GA that might give you some hints: http://github.com/clintecker/python-googleanalytics
There is a recently released R library on CRAN that enables Google Analytics Data extraction into R. It supports Google Analytics Core Reporting API v3 and uses OAuth2.0 under the hood for Authorization. You may be able to install the library via
install.packages("RGoogleAnalytics")
Or in case if you want the development version from Github you can try
require(devtools)
devtools::install_github("Tatvic/RGoogleAnalytics")
It would be fairly simple to create a wrapper using the RCurl and XML packages (very similar to the nytR or RGoogleDocs packages).
Just to give an update, i've now created the base script, which currently does the following:
Create a new export object.
Authenticate with your Google Account.
Return an account profile for an authorised Google Account.
Create a new API query
Use the query to return a data.frame populated with metrics.
I've also built in some low level error handling of the parameter types, but on some of the more complex parameters like segment, i've left the errors to the GA API.
I just need to build out the unit tests and package this up, and we should be good to go.
Mike
I've found another R-package for Google Anayltics: http://skardhamar.github.com/rga/
It uses OAuth2 for authentication.
I haven't tried it yet. But maybe that's the newest package out there.
There seems to be another Google Analytics-R package:
https://github.com/jdeboer/ganalytics/blob/master/README.md
I haven't tried it yet.

Resources