Connect R to the BoviSync Performance Data Link in Windows

Connect R to the BoviSync Performance Data Link in Windows

What is the R-Project?

R is a free, open-source programming language and software environment designed specifically for statistical computing and graphics. It was created by statisticians and is widely used by data analysts, data scientists, and researchers for data analysis, data visualization, and statistical modeling. https://www.r-project.org/about.html

Instructions and R script provided are for the purposes of getting started with R and the BoviSync Performance Data Link in Snowflake.
Warning
These instructions, the script, and data queried are provide as-is.

Prerequisites

  1. BoviSync Team
  2. Snowflake Account
  3. Permission Grant to teams from farms
  4. R studio

Here are the steps to install and setup R on Windows:

  1. Download R:
    1. Go to the CRAN website.
    2. Click on the link to “Download R for Windows.”
  2. Run the Installer:
  3. Once the download is complete, run the .exe file.
    1. Follow the installation instructions. You can usually just click “Next” through the default settings.
  4. Launch R:
  5. After the installation is complete, you can launch R from the Start menu or by searching for it in your applications
  6. Install ODBC and connect to the BoviSync Performance Data Link - Installing and configuring the ODBC Driver for Windows | Snowflake Documentation
  7. Access ODBC from R console. Success will result in current version result. 
    1. myconn <- odbcConnect("YourODBCConnection", uid="YourSnowflakeUser", pwd="")

      mydata <- sqlQuery(myconn, "YourSnowflakeWarehouse")

      mydata <- sqlQuery (myconn, "select current_version()")

      mydata

  8. A sample R script is attached for connecting to a table in the BoviSync Performance Data Link. 



Scripts and samples 

DopnXfarm.r 
Test your connection in R by running a small script with a function to generate scatterplots for farms in your Snowflake account from the BoviSync Performance Data Link

Instructions:
  1. edit the connection information in the script to match the ODBC listing for your Snowflake Account and database. 
  2. run the script once connected. File will create and save scatterplots with regression lines for each herd accessible in your team link. 


    • Related Articles

    • BoviSync Performance Data Link

      BoviSync provides insights for dairies and the companies that serve them. Team Accounts are the portal for companies to access their customer information. As a feature, we are interested in providing more powerful connections to BoviSync such as the ...
    • Power BI Template

      Power BI is a powerful business intelligence (BI) tool developed by Microsoft. It transforms raw data into meaningful insights through interactive visualizations and reports. BoviSync has developed Power BI templates for accessing the BoviSync ...
    • Uninstalling Data Client (BoviSync Data Service)

      1. Open Control Panel and click 'Uninstall a Program/Feature' select 'BoviSync Data Service' and click 'Uninstall' 2. Follow the steps of uninstaller package. The Windows uninstaller will remove all files/folders associated with 'BoviSync Data ...
    • BoviSync Data Service Stuck

      If your data stops automatically syncing such as for a parlor or activity monitor system, the BoviSync Data Service may be 'stuck/stopped' on the computer. This can occur if the computer is left on for long extended periods of time. The first thing ...
    • Connect Processor Data to BoviSync

      Background Processor data can now be integrated into BoviSync and viewed in the current reporting system. The addition of this information allows greater insights into dairy production and performance. 1) Setup BoviSync Integration with your ...