How to create and append to a dataset using R labkey API? | chetc (LabKey Support) | 2021-05-06 12:55 |
Status: Closed | ||
Hello Kristen, There may be an issue with "labkey.domain.createAndLoad", a bug has been filed for this. I tested "labkey.domain.create" endpoint with the result of "labkey.domain.inferFields" as the "domainDesign", and initially I did get the same error you did. But if you remove "ParticipantId" from the the dataframe (inDF in this case) it should resolve the error and create the domain. Even though "ParticipantId" in not a part of the design you passed in it will still be created. After the domain has been created you can use "labkey.insertRows" to insert data into the dataset. When you do this be sure to include all of the required fields. I got locked up for a while since I wasn't passing in the date. Attached to this post you will find a short R example that creates a dataset using fields inferred from a dataframe. Then insertRows was used to load data into the dataset. Thanks, |
||