Using R to connect to a sharepoint list
I've been working on reading SharePoint 2010 lists using R for a little while now. Basically, I use the SharePoint web service to return the results from the list, then use xmlToDataFrame to convert to a dataframe.
URL <- "http://yoursharepointserver/_vti_bin/ListData.svc/yourlist"
data = xmlParse(readLines(URL))
## get the individual list items
items = getNodeSet(data, "//m:properties")
## convert to a data frame
df = xmlToDataFrame(items, stringsAsFactors = FALSE)
Since I'm using the web service I can filter the list before I return the results, which is really helpful in overcoming the limitations of the SharePoint web service. The following link is quite helpful...
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/21/introduction-to-querying-lists-with-rest-and-listdata-svc-in-sharepoint-2010.aspx
Accessing Excel file from Sharepoint with R
I use
library(readxl)
read_excel('//companySharepointSite/project/.../ExcelFilename.xlsx', 'Sheet1', skip=1)
Note, no https:
, and sometimes I have to open the file first (i.e., cut and paste //companySharepointSite/project/.../ExcelFilename.xlsx
into my browser's address bar)
Related Topics
How Does R's Ifelse Work with Character Data
How to Perform a Pairwise T.Test in R Across Multiple Independent Vectors
Cbind Two Lists of Data.Frames to a New List
How to Sort Data by Column in Descending Order in R
Can You Make Geom_Ribbon Leave a Gap for Missing Values
R:Loops to Process Large Dataset(Gbs) in Chunks
Changing Class and Mode from Character to Numeric
How to Create an Infix %Between% Operator
Ggplot2': Label Values of Barplot That Uses 'Fun.Y="Mean"' of 'Stat_Summary'
How to Measure Area Between 2 Distribution Curves in R/Ggplot2
R Histogram with Multiple Populations
How to Create a Hyperlink Interactively in Shiny App