diff --git a/CHANGES b/CHANGES index 43477b8..3322ce9 100644 --- a/CHANGES +++ b/CHANGES @@ -6,7 +6,7 @@ Version 0.1.15 -------------- - disable all unit tests that require downloaded data on CRAN - add Euclidean distance util functions for surface vertices, like vertexdists.to.point and closest.vert.to.point -- add doapply.transform.mtx function (it's just matmul with some input checks that are annoying to repeat) +- add doapply.transform.mtx function (it's just matrix multiplication with some input checks that are annoying to repeat) Version 0.1.14 diff --git a/R/gifti_writer.R b/R/gifti_writer.R index 122d303..863f3cc 100644 --- a/R/gifti_writer.R +++ b/R/gifti_writer.R @@ -36,6 +36,7 @@ #' @seealso The example for \code{\link{gifti_xml_write}} shows how to modify the tree. #' #' @examples +#' \dontrun{ #' my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L)); #' transforms = list(NA, list('transform_matrix'=diag(4), 'data_space'='NIFTI_XFORM_UNKNOWN', #' 'transformed_space'='NIFTI_XFORM_UNKNOWN')); @@ -43,6 +44,7 @@ #' # Verify that the tree is a valid GIFTI file: #' gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd"; #' xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd)); +#' } #' #' @importFrom xml2 xml_new_root xml_set_attr xml_add_child read_xml #' @export @@ -224,6 +226,7 @@ check_data_and_settings_consistency <- function(index, data, datatype, intent, f #' @references \url{https://www.nitrc.org/frs/download.php/2871/GIFTI_Surface_Format.pdf} #' #' @examples +#' \dontrun{ #' outfile = tempfile(fileext = '.gii'); #' my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L)); #' xmltree = gifti_xml(my_data_sets, datatype='NIFTI_TYPE_FLOAT32'); @@ -233,6 +236,7 @@ check_data_and_settings_consistency <- function(index, data, datatype, intent, f #' gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd"; #' xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd)); #' gifti_xml_write(outfile, xmltree); # Write your custom tree to a file. +#' } #' #' @export #' @importFrom xml2 write_xml diff --git a/man/gifti_xml.Rd b/man/gifti_xml.Rd index 9894304..241d8e2 100644 --- a/man/gifti_xml.Rd +++ b/man/gifti_xml.Rd @@ -39,6 +39,7 @@ Creates a GIFTI XML tree from your datasets (vectors and matrices). The tree can Unless you want to modify the returned tree manually, you should not need to call this function. Use \code{\link{gifti_writer}} instead. } \examples{ +\dontrun{ my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L)); transforms = list(NA, list('transform_matrix'=diag(4), 'data_space'='NIFTI_XFORM_UNKNOWN', 'transformed_space'='NIFTI_XFORM_UNKNOWN')); @@ -46,6 +47,7 @@ Unless you want to modify the returned tree manually, you should not need to cal # Verify that the tree is a valid GIFTI file: gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd"; xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd)); +} } \references{ diff --git a/man/gifti_xml_write.Rd b/man/gifti_xml_write.Rd index c95cbd0..1813457 100644 --- a/man/gifti_xml_write.Rd +++ b/man/gifti_xml_write.Rd @@ -17,6 +17,7 @@ gifti_xml_write(filepath, xmltree, options = c("as_xml", "format")) Write XML tree to a gifti file. } \examples{ +\dontrun{ outfile = tempfile(fileext = '.gii'); my_data_sets = list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L)); xmltree = gifti_xml(my_data_sets, datatype='NIFTI_TYPE_FLOAT32'); @@ -26,6 +27,7 @@ Write XML tree to a gifti file. gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd"; xml2::xml_validate(xmltree, xml2::read_xml(gifti_xsd)); gifti_xml_write(outfile, xmltree); # Write your custom tree to a file. +} } \references{ diff --git a/tests/testthat/test-gifti_xml_tools.R b/tests/testthat/test-gifti_xml_tools.R index 4234268..cbe0465 100644 --- a/tests/testthat/test-gifti_xml_tools.R +++ b/tests/testthat/test-gifti_xml_tools.R @@ -1,6 +1,8 @@ test_that("We can add global metadata to a GIFTI xml tree", { + testthat::skip_on_cran(); + testthat::skip_if_offline(host = "www.nitrc.org"); xmltree = gifti_xml(list(rep(3.1, 3L), matrix(seq(6)+0.1, nrow=2L))); newtree = gifti_xml_add_global_metadata(xmltree, list("User"="Me", "Weather"="Great")); gifti_xsd = "https://www.nitrc.org/frs/download.php/158/gifti.xsd";