attachFile: Attaches a file to a thread on Labstep

Description Usage Arguments Value Examples

View source: R/attachFile.R

Description

This function allows you to attach a file to different content types

Usage

1
attachFile(user, object, filepath, caption)

Arguments

user

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

object

The labstep object you want to comment on. Can be 'protocol', 'experiment' or 'resource'

filepath

The path to ther file to attach.

caption

A caption describing your file (optional)

Value

Returns a 'comment' object with the file attached

Examples

1
2
3
4
5
6
7
8
9
user <- login("demo@labstep.com","demopassword")
expName = 'My First Experiment'
expDesc = 'An experiment testing the labstepR library'
experiment <- createExperiment(user,expName,expDesc)
filepath = 'mydata.RData'
save.image(filepath)
caption = 'The R workspace after running this script'
file <- attachFile(user,experiment,filepath,caption)
print(file)

Labstep/labstepR documentation built on Jan. 30, 2020, 7:11 p.m.