Title: | Connect to PhotosynQ |
---|---|
Description: | Connect R to the PhotosynQ platform (<https://photosynq.org>). It allows to login and logout, as well as receive project information and project data. Further it transforms the received JSON objects into a data frame, which can be used for the final data analysis. |
Authors: | Sebastian Kuhlgert [aut, cre] |
Maintainer: | Sebastian Kuhlgert <[email protected]> |
License: | MIT + file LICENCE |
Version: | 0.2.3 |
Built: | 2025-03-12 05:45:12 UTC |
Source: | https://github.com/photosynq/photosynq-r |
This function creates a data frame with the data for a single 'PhotosynQ' Project.
createDataframe(project_info = NULL, project_data = NULL)
createDataframe(project_info = NULL, project_data = NULL)
project_info |
Object returned by |
project_data |
Object returned by |
This function allows to create a data frame based on the Project's
information (getProjectInfo
) and the Project's data
(getProjectData
). If more than one Protocol was used in a
Project, the data frame contains multiple frames, each one named after the
corresponding measurement Protocol.
Data frame(s) with Project's data for subsequent analysis. In case of
issues it will return NULL
.
project_info <- getProjectInfo(1566) project_data <- getProjectData(1566) createDataframe(project_info, project_data)
project_info <- getProjectInfo(1566) project_data <- getProjectData(1566) createDataframe(project_info, project_data)
Get Project data using the Project's ID and create data frame(s).
getProject(projectID = "", processedData = TRUE, rawTraces = FALSE)
getProject(projectID = "", processedData = TRUE, rawTraces = FALSE)
projectID |
The ID of your Project (Just copy the Project ID from the project page or your user page) |
processedData |
(optional) Receive the processed data when set to
|
rawTraces |
(optional) Adds raw traces to processed data. It is ignored
when processedData is set to |
This function produces a data frame for a 'PhotosynQ' Project using the
Project's ID. The ID can be found on the Project's page on the 'PhotosynQ'
website. This function call includes the Project data as well as information.
In case multiple protocols were used, each protocol is in a separate data
frame. By default the processed data is not included. The parameter
rawTraces
can be set to TRUE
to include the rawTraces
in
combination with the processed data. By default the recorded traces are not
received. When the original data structure is needed, separate calls have to
be used including getProjectInfo
and
getProjectData
.
Separate data frame per protocol including measurement data and answers to Project.
Including the raw data and/or the traces will increase the data frame size significantly.
getProject(1566)
getProject(1566)
Get Project Data using the Project's ID
getProjectData(projectID = "", processedData = TRUE, rawTraces = FALSE)
getProjectData(projectID = "", processedData = TRUE, rawTraces = FALSE)
projectID |
The ID of your Project (Just copy the Project's ID from the project page or your user page) |
processedData |
(optional) Receive the processed data when set to
|
rawTraces |
(optional) Adds raw traces to processed data. It is ignored
when processedData is set to |
This function receives the data from 'PhotosynQ' for a specific Project. The
revceived data is in the original 'JSON' structure. When setting the
processedDate
to FALSE
the raw data will be received instead of
the processed data. By default the processed data is not included. The
parameter rawTraces
can be set to TRUE
to include the
rawTraces
in combination with the processed data. By default the
traces are not received.
Project data is returned in the 'JSON' format. In case of issues it
will return NULL
.
Including the raw data and/or the traces will increase the data frame size significantly.
getProjectData(1566)
getProjectData(1566)
Get Project Information using the Project's ID
getProjectInfo(projectID = "")
getProjectInfo(projectID = "")
projectID |
The ID of your Project (Just copy the Project ID from the project page or your user page) |
This function receives the information about a project from 'PhotosynQ'
including used Protocols and Project Questions. The information is also
required to process the Project's data for the data frame used in the
createDataframe
function.
Project information is returned in the 'JSON' format. In case of
issues it will return NULL
.
getProjectInfo(1566)
getProjectInfo(1566)
Login to 'PhotosynQ' to allow data access.
login(email = "", url = photosynq.env$DEFAULT_API_DOMAIN)
login(email = "", url = photosynq.env$DEFAULT_API_DOMAIN)
email |
Your email address you use to login |
url |
(optional) Change the default URL to point to another instance |
This function allows a user to login to 'PhotosynQ' and start a session. The
functions getProjectInfo
, getProjectData
,
getProject
and logout
require a session started
by login in. A login is only required once at the beginning of a session.
Session key is received and session data is stored as a global variable. Otherwise nothing is returned.
The password needs to be entered in a dialog and gets never saved nor should it be saved anywhere in the code.
## Not run: login("[email protected]") ## End(Not run)
## Not run: login("[email protected]") ## End(Not run)
Logout from 'PhotosynQ' and end session
logout()
logout()
This function ends the current session and logs out the current user out from 'PhotosynQ'. Use the login function to sign in again and start a new session if needed.
Session data is removed from the global variables. Nothing is returned
logout()
logout()