Skip to content
Snippets Groups Projects
getDataFromFile.Rd 1.12 KiB
Newer Older
  • Learn to ignore specific revisions
  • Laura A DeCicco's avatar
    Laura A DeCicco committed
    \name{getDataFromFile}
    \alias{getDataFromFile}
    \title{Basic Data Import for Water Flow Data}
    \usage{
    
    getDataFromFile(filePath, fileName, hasHeader = TRUE, separator = ",")
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    }
    \arguments{
      \item{filePath}{string specifying the path to the file}
    
      \item{fileName}{string name of file to open}
    
      \item{hasHeader}{logical true if the first row of data is
      the column headers}
    
      \item{separator}{string character that separates data
      cells}
    }
    \value{
    
    retval dataframe with dateTime, value, and code columns
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    }
    \description{
    
    Imports data from user-supplied data file. Specifically
    used to import water flow data for use in the WRTDS
    package. For WRTDS usage, the first column is expected to
    be dates, the second column measured values. The third
    column is optional, it contains any remark codes.
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    }
    \examples{
    # Examples of how to use getDataFromFile:
    # Change the file path and file name to something meaningful:
    
    filePath <- system.file("extdata", package="dataRetrieval")
    filePath <- paste(filePath,"/",sep="")
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    fileName <- 'ChoptankRiverFlow.txt'
    
    getDataFromFile(filePath,fileName, separator="\\t")
    
    Laura A DeCicco's avatar
    Laura A DeCicco committed
    }
    \keyword{data}
    \keyword{file}
    \keyword{import}