Learn R Programming

gemtc (version 0.7-1)

mtc.network.xml: Read and write mtc.network as legacy GeMTC XML files (.gemtc)

Description

Read and write legacy GeMTC XML (.gemtc) files - only arm-based data with responders/sampleSize or mean/std.dev/sampleSize are supported.

Usage

read.mtc.network(file)
write.mtc.network(network, file)

Arguments

network
An object of the S3 class mtc.network.
file
Path to the file to read (read.mtc.network) or write (write.mtc.network). For write.mtc.network, if file="", the output is printed to standard output. If it is file="|cmd", the output is pi

Value

  • read.mtc.network returns an object of S3 class mtc.network.

encoding

utf8

Details

read.mtc.network and write.mtc.network deal with the older GeMTC XML format. This format supports dichotomous data as responders/sampleSize and continuous data as mean/std.dev/sampleSize only. Relative effect data, or other forms of arm-based data, are not supported. In general, it may be more convenient to use native R methods to read and write networks (e.g. dput/dget or save/load).

These functions need the XML package to be installed.

See Also

mtc.network

Examples

Run this code
# Read an example GeMTC XML file
file <- system.file("extdata/luades-smoking.gemtc", package="gemtc")
network <- read.mtc.network(file)

# Summarize the network (generate some interesting network properties)
summary(network)
## $Description
## [1] "MTC dataset: Smoking cessation rates"
## 
## $`Studies per treatment`
##  A  B  C  D 
## 19  6 19  6 
## 
## $`Number of n-arm studies`
## 2-arm 3-arm 
##    22     2 

# Write the network to a temporary file in the GeMTC XML format
tmp <- tempfile()
write.mtc.network(network, file=tmp)

Run the code above in your browser using DataLab