# Read the dataset for the first time.
result_read1 <- REDCapR::redcap_read_oneshot(redcap_uri=uri, token=token)
ds1 <- result_read1$data
ds1$telephone
# Manipulate a field in the dataset in a VALID way
ds1$telephone <- paste0("(405) 321-000", seq_len(nrow(ds1)))
ds1 <- ds1[1:3, ]
ds1$age <- NULL; ds1$bmi <- NULL # Drop the calculated fields before writing.
# Upload the data to the server.
result_write <- REDCapR::redcap_write(ds1, redcap_uri=uri, token=token)
1条答案
按热度按时间vojdkbi01#
REDCapR::redcap_write()
将信息从本地R示例上的data.frame移动到远程REDCap服务器。文件和参考:
(我是REDCapR的主要开发者,
REDCapR::redcap_write()
函数是2013最早添加的函数之一。)