MyNixOS website logo
Description

Access your Coletum's Data from API.

Get your data (forms, structures, answers) from Coletum <https://coletum.com> to handle and analyse.

RColetum

Actions Status CRAN_Status_Badge

An R package to get data from Coletum.

Prerequisites

To be able to use this package, first of all, you need access your Coletum's account [https://coletum.com] from your browser to generate your authenticated token in Web service page.

If you don't have an account, SIGN UP NOW.

How to install RColetum

Install this package from CRAN:

install.packages("RColetum")

Or install the development version from GitHub using the 'devtools' package:

install.packages("devtools")
devtools::install_github("geo-sapiens/RColetum")

How to use RColetum

In this version of the package, there are three main functions available, Those able you to get your main data from Coletum:

Get my forms

  • GetForms this function get the list of forms in your account.
myForms <- GetForms("TOKEN_HERE")

Get form structure

  • GetFormStructure this function gets the structure from a specific form. The structure contains the specifications of each field, like the name, type, hierarchy and others.
myFormStructure <- GetFormStructure(token = "TOKEN_HERE", idForm = FORM_ID)

Get answers

  • GetAnswers this function gets the answers from a specific form. The data structure returned depends of the form structure. When the form has no field with cardinality greater than 1, the structure is a data frame. When the form has one or more fields with cardinality greater then one, the structure is a list of data frames.
myAnswers <- GetAnswers(token = "TOKEN_HERE", idForm = FORM_ID)

If you want to get the answers in a single data frame with redundant data (caused by fields with cardinality greater than 1), you should use singleDataFrame parameter as TRUE.

myAnswers <- GetAnswers(token = "TOKEN_HERE", 
                        idForm = FORM_ID, 
                        singleDataFrame = TRUE)

Full example

install.packages("devtools")
devtools::install_github("geo-sapiens/RColetum")

####@> Loading RColetum package
library(RColetum)

####@> Creating a variable to store my Coletum API Token
####@> This variable will be used in all bellow methods
myToken <- "cizio7xeohwgc8k4g4koo008kkoocwg"

####@> Getting my forms
myForms <- GetForms(myToken)

####@> Getting form structure using form id
starWarsFormStructure <- GetFormStructure(token = myToken,
                                          idForm = 5713)

####@> Getting form structure using form name
starWarsFormStructure <- GetFormStructure(token = myToken,  
                                          nameForm = "RColetum Test - Star Wars")

####@> Getting answers for a form using form id
starWarsFormAnswer <- GetAnswers(token = myToken, 
                                 idForm = 5713)

####@> Getting answers for a form using form name
####@> In this case we have X + 1 dataframes, where X is number of 
####@> N fields (fields with cardinality > 1)
starWarsFormAnswer <- GetAnswers(token = myToken, 
                                 nameForm = "RColetum Test - Star Wars")

####@> Getting answers for a form getting result as single dataframe
####@> In this case we have redundancy for N fields
starWarsFormAnswerSingleDataframe <- GetAnswers(token = myToken, 
                                                idForm = 5713, 
                                                singleDataFrame = TRUE)


####@> LET'S HAVE SOME FUN AND SHOW A CHART WITH BMI (BODY MASS INDEX) 
####@> OF EACH STAR WARS CHARACTERS
library(ggplot2)

myChart <- ggplot(data = starWarsFormAnswer[[1]], 
                  mapping = 
                    aes(x = name66298, 
                        y = (mass66300) / (height66299/100)^2 )) +
  geom_bar(stat = "identity", 
           fill = "black", 
           colour = "green",
           alpha = 0.8) +
  geom_label(mapping = aes(label = (mass66300) / (height66299/100)^2)) +
  labs(x = "Character", 
       y = "BMI") +
  theme_bw(base_size = 14)

myChart

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.


Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Metadata

Version

0.2.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows