Visit map access from RLabkey interface

LabKey Support Forum (Inactive)
Visit map access from RLabkey interface gkericks  2017-03-06 09:26
Status: Closed
 
Hi,

I'm use the R scripting functionality for writing reports within a Labkey project. It is simple enough to work with the data that is in a particular dataset but I am hitting a wall when trying to access other data about a study. In particular, I would love to be able to query the visit map for a study. I have found the RLabkey R library that lets a person query study metadata, but have not figured out how to query the visit map (and it is not stated explicitly in the RLabkey documentation). Does anybody know what function should be used and how the parameters should look (or if it is even possible)?
 
 
cnathe responded:  2017-03-06 12:33
Yes, the Rlabkey library is what you are looking for. Once you have that package installed for the R version on your given server, you can use the following command to make a query to get the study.Visit information into your R Report as a new data frame:

library(Rlabkey)
visit.data = labkey.data <- labkey.selectRows(
    baseUrl=labkey.url.base,
    folderPath=labkey.url.path,
    schemaName="study",
    queryName="Visit"
)
print(visit.data)

Let me know if that doesn't work or is not the information that you were looking for.
Thanks,
Cory Nathe
 
gkericks responded:  2017-03-06 12:39
Thanks this works great!