This function allows you to attach a Protocol to an existing Experiment.

attachProtocol(user, experiment, protocol)

Arguments

user

A labstep user object. Must contain an `api_key` field. Returned from `login` command

experiment

The experiment you want to attach the protocol to. Must have at least an `id` field.

protocol

The protocol you want to attach. Must have at least an `id` field

Value

Returns an `experiment` object

Examples

user <- login("demo@labstep.com","demopassword") expName = 'My First Experiment' expDesc = 'An experiment testing the labstepR library' experiment <- createExperiment(user,expName,expDesc) protocol <- createProtocol(user,'My First Protocol') experiment <- attachProtocol(user,experiment,protocol) print(experiment)
#> $id #> [1] 29799 #> #> $created_at #> [1] "2020-01-30T16:39:27+00:00" #> #> $updated_at #> [1] "2020-01-30T16:39:27+00:00" #> #> $locked_at #> NULL #> #> $deleted_at #> NULL #> #> $started_at #> [1] "2020-01-30T16:39:27+00:00" #> #> $ended_at #> NULL #> #> $due_at #> NULL #> #> $name #> [1] "My First Experiment" #> #> $description #> [1] "An experiment testing the labstepR library" #> #> $author #> $author$id #> [1] 4524 #> #> $author$username #> [1] "demo@labstep.com" #> #> $author$name #> [1] "Demo Labstep" #> #> $author$first_name #> [1] "Demo" #> #> $author$last_name #> [1] "Labstep" #> #> $author$profile #> $author$profile$id #> [1] 5751 #> #> $author$profile$photo #> NULL #> #> #> #> $thread #> $thread$all_comment_count #> [1] 0 #> #> $thread$comment_count #> [1] 0 #> #> $thread$id #> [1] 673386 #> #> #> $experiments #> $experiments[[1]] #> $experiments[[1]]$locked_at #> NULL #> #> $experiments[[1]]$id #> [1] 25617 #> #> $experiments[[1]]$created_at #> [1] "2020-01-30T16:39:28+00:00" #> #> $experiments[[1]]$deleted_at #> NULL #> #> $experiments[[1]]$started_at #> NULL #> #> $experiments[[1]]$ended_at #> NULL #> #> $experiments[[1]]$position #> [1] 1 #> #> $experiments[[1]]$protocol #> $experiments[[1]]$protocol$version #> [1] 0 #> #> $experiments[[1]]$protocol$id #> [1] 16737 #> #> $experiments[[1]]$protocol$created_at #> [1] "2020-01-30T16:39:28+00:00" #> #> $experiments[[1]]$protocol$collection #> $experiments[[1]]$protocol$collection$id #> [1] 13634 #> #> $experiments[[1]]$protocol$collection$created_at #> [1] "2020-01-30T16:39:27+00:00" #> #> $experiments[[1]]$protocol$collection$name #> [1] "My First Protocol" #> #> $experiments[[1]]$protocol$collection$owner #> $experiments[[1]]$protocol$collection$owner$id #> [1] 6867 #> #> $experiments[[1]]$protocol$collection$owner$name #> [1] "Demo Labstep workspace" #> #> $experiments[[1]]$protocol$collection$owner$created_at #> [1] "2019-08-06T20:34:00+00:00" #> #> $experiments[[1]]$protocol$collection$owner$deleted_at #> NULL #> #> $experiments[[1]]$protocol$collection$owner$description #> NULL #> #> $experiments[[1]]$protocol$collection$owner$profile #> $experiments[[1]]$protocol$collection$owner$profile$id #> [1] 19084 #> #> $experiments[[1]]$protocol$collection$owner$profile$photo #> NULL #> #> #> $experiments[[1]]$protocol$collection$owner$is_home #> [1] TRUE #> #> #> #> #> $experiments[[1]]$experiment_steps #> $experiments[[1]]$experiment_steps[[1]] #> $experiments[[1]]$experiment_steps[[1]]$locked_at #> NULL #> #> $experiments[[1]]$experiment_steps[[1]]$id #> [1] 125218 #> #> $experiments[[1]]$experiment_steps[[1]]$ended_at #> NULL #> #> $experiments[[1]]$experiment_steps[[1]]$thread #> $experiments[[1]]$experiment_steps[[1]]$thread$all_comment_count #> [1] 0 #> #> $experiments[[1]]$experiment_steps[[1]]$thread$comment_count #> [1] 0 #> #> $experiments[[1]]$experiment_steps[[1]]$thread$id #> [1] 673388 #> #> #> #> #> $experiments[[1]]$permissions #> $experiments[[1]]$permissions$view #> [1] TRUE #> #> $experiments[[1]]$permissions$edit #> [1] TRUE #> #> $experiments[[1]]$permissions$owner #> [1] TRUE #> #> #> #> #> $signatures #> list() #> #> $perma_link #> $perma_link$id #> [1] 480268 #> #> $perma_link$token #> [1] "8a9cde7e-8aab-433b-a6e4-2bb26752abab" #> #> #> $share_link #> NULL #> #> $permissions #> $permissions$view #> [1] TRUE #> #> $permissions$edit #> [1] TRUE #> #> $permissions$owner #> [1] TRUE #> #> #> $locked_log #> NULL #> #> $comment_count #> [1] 0 #> #> $owner #> $owner$id #> [1] 6867 #> #> $owner$name #> [1] "Demo Labstep workspace" #> #> $owner$created_at #> [1] "2019-08-06T20:34:00+00:00" #> #> $owner$deleted_at #> NULL #> #> $owner$description #> NULL #> #> $owner$profile #> $owner$profile$id #> [1] 19084 #> #> $owner$profile$photo #> NULL #> #> #> $owner$is_home #> [1] TRUE #> #>