This package allows to download Project data from the PhotosynQ online platform right into RStudio or R, providing a data frame that can be used for a subsequent advanced analysis.
If you don't already have, install RStudio and R first.
The easiest way to install PhotosynQ for R is through R-Studio using the CRAN network that is hosting the repository for R Packages.
- Open RStudio
- Select Tools from the menu and click on Install Packages
- Select Install from: Repository (CRAN)
- Type
PhotosynQ
into the Packages input field - Make sure the Install dependencies checkbox is checked
- Click on Install to finish the installation and close the dialog
Note: If you are not using CRAN to install the PhotosynQ Package you might have to install the Packages httr
and getPass
it depends on manually using the command: install.packages(c("httr","getPass"))
.
Download the latest release of the PhotosynQ R package. Select the file indicated as Source code (tar.gz)
. This is the format required by RStudio.
- Open RStudio
- Select Tools from the menu and click on Install Packages.
- Select Install from:
Package Archive File (.tgz; .tar-gz)
- Package archive: Click on Browse... and select the downloaded file.
- Click on Install to finish the installation and close the dialog.
For users that already have a development environment, devtools provides an easy installation from the GitHub repository.
- Open RStudio
- Install the release version of devtools from CRAN with
install.packages("devtools")
- Make sure you have a working development environment.
- Windows: Install Rtools.
- Mac: Install Xcode from the Mac App Store.
- Linux: Install a compiler and various development libraries (details vary across different flavors of Linux).
- Install the development version of PhotosynQ-R:
devtools::install_github("PhotosynQ/PhotosynQ-R")
Create a list of data frames in a single step from the data of a Project. Each frame in the list represents one measurement protocol. A user account for PhotosynQ is required to access the data. You will find the ID
of your project on the project page.
PhotosynQ::login("[email protected]")
ID <- 1556
dfs <- PhotosynQ::getProject(ID)
The flagged measurements are included in the dataset and most likely needs to be removed for further analysis. You can use the filter()
function of the dplyr
library to remove the flagged measurement from the data frame. You might want to use the same function to select a subset of measurement from your data frame.
# Select a Protocol from the List of Data Frames
df <- dfs$`Protocol Name`
# View the Protocol Output
View(df)
# Filter out flagged data
library(dplyr)
df_filtered <- filter(df, status == "submitted")
email <- "[email protected]"
login <- PhotosynQ::login(email)
PhotosynQ::logout()
ID <- 1556
project_info <- PhotosynQ::getProjectInfo(ID)
ID <- 1556
project_data <- PhotosynQ::getProjectData(ID)
# Use raw data
processed_data <- FALSE
project_data <- PhotosynQ::getProjectData(ID, processed_data)
dataframe <- PhotosynQ::createDataframe(project_info, project_data)