# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Scan a binary TransCAD File
#'
#' This is a C++ implementation written by Amar Sarvepalli and adapted for Rcpp
#' by Greg Macfarlane.
#'
#' @param bin_file string with the path to the .bin file.
#' @param name character vector of each variable.
#' @param type CharacterVector with the information type for each variable.
#' @param start NumericVector with the number of bytes in which the variable
#' starts.
#' @param width NumericVector with the number of bytes given for a variable.
#' @param row_length int showing the number of bytes in a row.
#'
#' @details All input parameter values are available in the \code{.DCB} file
#' read by \link{read_dcb}. This is an internal function and should not
#' normally be used independent of \link{read_tcad}.
#'
#' @return characters in each element of the vector
#'
get_df_from_binary <- function(bin_file, name, type, start, width, row_length) {
.Call('_tcadr_get_df_from_binary', PACKAGE = 'tcadr', bin_file, name, type, start, width, row_length)
}
#' Get the dimensions of a data frame
#'
#' @param df DataFrame object
#' @details To get number of dataframe dimensions
#' @return Array with the number of rows and columns (r x c)
#' @name getDims
#'
NULL
#' Get the names of the field headers
#'
#' @param df DataFrame object
#' @return names field names
#' @name getNames
#'
NULL
#' Get the field width in bytes
#'
#' @param s character field
#' @return element_width width of the column
#' @name get_width
#'
NULL
#' Parse comma-delimited names line
#'
#' @name name_split
#' @details splits line by ","
#' @param line string line separated by delimiter
#' @param delim delimter can be anything
#' @return fields elements of string line
#'
NULL
#' Write a TransCAD Dictionary File
#'
#' @name write_dcb
#' @param df Data frame
#' @param file Name and path to the \code{.DCB} file.
#'
write_dcb <- function(df, file) {
invisible(.Call('_tcadr_write_dcb', PACKAGE = 'tcadr', df, file))
}
#' Write a binary TransCAD file from an R data frame.
#'
#' This is a C++ implementation written by Amar Sarvepalli and adapted for
#' Rcpp by Greg Macfarlane.
#' @param df List of variables (or a \code{data.frame}) that need to be
#' written out to TransCAD.
#' @param file A character string giving the output file name and path.
#' @param field_types A character vector giving the data types of each column.
#' @name write_df_to_binary
#'
#' @details Currently this function only exports only 3 datatypes: Character,
#' Integer and Double.
#'
write_df_to_binary <- function(df, file, field_types) {
invisible(.Call('_tcadr_write_df_to_binary', PACKAGE = 'tcadr', df, file, field_types))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.