Package sfc. August 29, 2016

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package datasets.load

Package ecoseries. R topics documented: September 27, 2017

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package ECctmc. May 1, 2018

Package wrswor. R topics documented: February 2, Type Package

Package fastdummies. January 8, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package messaging. May 27, 2018

Package vinereg. August 10, 2018

Package mdftracks. February 6, 2017

Package widyr. August 14, 2017

Package bisect. April 16, 2018

Package canvasxpress

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package strat. November 23, 2016

Package kirby21.base

Package autoshiny. June 25, 2018

Package repec. August 31, 2018

Package raker. October 10, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package coga. May 8, 2018

Package calpassapi. August 25, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package validara. October 19, 2017

Package available. November 17, 2017

Package spark. July 21, 2017

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package vip. June 15, 2018

Package jstree. October 24, 2017

Package fastqcr. April 11, 2017

Package dbx. July 5, 2018

Package reval. May 26, 2015

Package geogrid. August 19, 2018

Package rcv. August 11, 2017

Package queuecomputer

Package QCAtools. January 3, 2017

Package gtrendsr. August 4, 2018

Package zoomgrid. January 3, 2019

Package deductive. June 2, 2017

Package docxtools. July 6, 2018

Package barcoder. October 26, 2018

Package splithalf. March 17, 2018

Package SEMrushR. November 3, 2018

Package gtrendsr. October 19, 2017

Package internetarchive

Package TrafficBDE. March 1, 2018

Package rgho. R topics documented: January 18, 2017

Package omu. August 2, 2018

Package quadprogxt. February 4, 2018

Package rngtools. May 15, 2018

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package PCADSC. April 19, 2017

Package opencage. January 16, 2018

Package comparedf. February 11, 2019

Package clipr. June 23, 2018

Package jpmesh. December 4, 2017

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package resumer. R topics documented: August 29, 2016

Package ibm. August 29, 2016

Package lumberjack. R topics documented: July 20, 2018

Package crochet. January 8, 2018

Package slickr. March 6, 2018

Package qicharts2. March 3, 2018

Package tidytransit. March 4, 2019

Package estprod. May 2, 2018

Package embed. November 19, 2018

Package ompr. November 18, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package knitrprogressbar

Package ether. September 22, 2018

Package sessioninfo. June 21, 2017

Package crossword.r. January 19, 2018

Package nngeo. September 29, 2018

Package chunked. July 2, 2017

Package ipft. January 4, 2018

Package AhoCorasickTrie

Package curry. September 28, 2016

Package rsppfp. November 20, 2018

R topics documented: 2 genbernoullidata

Package testit. R topics documented: June 14, 2018

Package shinyfeedback

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package CompGLM. April 29, 2018

Package csvread. August 29, 2016

Package graphframes. June 21, 2018

Package purrrlyr. R topics documented: May 13, Title Tools at the Intersection of 'purrr' and 'dplyr' Version 0.0.2

Package ezsummary. August 29, 2016

Package robotstxt. November 12, 2017

Package censusr. R topics documented: June 14, Type Package Title Collect Data from the Census API Version 0.0.

Package sfdct. August 29, 2017

Package farver. November 20, 2018

Package librarian. R topics documented:

Package tidyimpute. March 5, 2018

Package shinyhelper. June 21, 2018

Package fasttextr. May 12, 2017

Package pinyin. October 17, 2018

Package transformr. December 9, 2018

Package IATScore. January 10, 2018

Package Rspc. July 30, 2018

Transcription:

Type Package Title Substance Flow Computation Version 0.1.0 Package sfc August 29, 2016 Description Provides a function sfc() to compute the substance flow with the input files --- ``data'' and ``model''. If sample.size is set more than 1, uncertainty analysis will be executed while the distributions and parameters are supplied in the file ``data''. Depends R (>= 3.1.0), dplyr, tidyr Imports stats, utils, triangle, zoo, sna License GPL URL https://github.com/ctfysh/sfc BugReports https://github.com/ctfysh/sfc/issues LazyData TRUE RoxygenNote 5.0.1 NeedsCompilation no Author Hu Sheng [aut, cre] Maintainer Hu Sheng <shenghu@nju.edu.cn> Repository CRAN Date/Publication 2016-08-25 10:01:01 R topics documented: sfc-package......................................... 2 sfc.............................................. 2 Index 5 1

2 sfc sfc-package sfc: A package for substance flow computation. Description The sfc package provides an important functions sfc() to compute the substance flow with the input files "data" and "model". If sample.size is set more than 1, uncertainty analysis will be executed while the distributions and parameters are supplied in the file "data". sfc Substance Flow Computation Description sfc is the function for computing the substance flow with the input file "data" and "model", and furtherly analyzing the uncertainty of the computing results which are propagated from the activity data and parameters. Usage sfc(data, model, sample.size = 1, rand.seed = NULL, check = TRUE, inner = FALSE,...) Arguments data model sample.size rand.seed check inner a path for a ".csv" file or a data frame which contains the basic data for substance flow computation. The details of data are given under "Details". a path for a text file or a string vector which contains the formulas for substance flow computation. The details of model specification are given under "Details". a single value, interpreted as an integer. The details of sample.size are given under "Details". a single value, interpreted as an integer or NULL, which is the same with seed in set.seed. logical. If FALSE, the summary of uncertainty analysis will use all the samples. IF TRUE, they only use the valid samples. The details of check are given under "Details". logical. IF TRUE, the intermediate results will be returnd, such as the input samples and the results for each sample.... Further arguments to be passed to both read.csv and scan.

sfc 3 Details Value There are two important inputs in sfc function: data and model. "data" is a table in the form of ".csv" which includes a line of the header and the other lines of the specific data. The header can be divided into two categories: special fields and general fields. Special fields represent the fields which are meaningful for computation, while general fields only describe each row in details which will not be used in computation, such as the description of the concept or unit of a variable. So general fields are not as necessary as special fields. Special fields can also be divided into two parts: fixed fields and flexible fields. Fixed fields contains: NAME, DATA, TIME, SITE and DIST. Flexible fields contains: P1, P2, P3,... and C1, C2, C3,... NAME means the variable name. DATA means the variable value. TIME means the specific time while SITE means the specific place where the variable observed. DIST is a character of distribution in Distributions, such as "norm", "unif", etc. P1, P2, P3,... are the distribution parameters which are flexible because different distribution has different number or meaning of parameters. C1, C2, C3,... are supplementary fields for other distinguished information like TIME and SITE. All the letters of field names are in the capital form to distinguish with the normal R variables or functions. "model" is a special R code fragment which only contains flow computation expressions, like "PF[i, j, ] = DX * PX" or "PF[i, j, ] <- DX * PX". Here, "i" is the start node and "j" is the end node. "DX" and "PX" represent activity data and parameters, respectively. They also correspond to the "NAME" field in the "data" file. "PF[i, j, ]" is an array which means the flow from "i" to "j", while "PF" is the default flow name. If you do not like coding, this package provides another alternative: to write model as into a ".csv" file. This file contains four critical fields: NAME, START, END and FUN. They are required fields while you can add other optional fields to make the model more readable freely. The NAME field is used to define flow label, e.g. "PF_01" labels "PF[i, j, ]". The START and END field are used to define the start node "i" and the end node "j" in "PF[i, j, ]". The last one, "FUN" is used to define the formula to calculate the flow, such as the righthand expression "DX * PX". To keep the code easy and simple, some auxiliary functions are supplied: p, comp0, suma and rnone. p is used to keep flow positive while the negative value will be set zero. comp0 is used to change the value near zero to be zero. suma is used to sum an array at the margin m. rnone is used to sample the same value. If sample.size are greater than 1, the uncertainty of substance flow computation result, i.e. "PF[i, j, ]", will be evaluated. However, we will still compute the scenario when sample.size = 1, which represent the expected scenario (or most valid scenario), to compare with each result of each sample. If the sign of each flow are the same, the sample are valid, otherwise are invalid. So the sample.size in the result list is the valid sample size. To trigger the above comparation, check should be set TRUE. sfc returns a list which contains four objects: result, sample.size, sample and inner.result. result is a data frame of substance flow computation result. sample.size is the sample size of valid samples. sample is the data frame of the input samples. inner.result is the data frame of substance flow computation result for each sample. Examples library(sfc) ## model as txt

4 sfc data <- system.file("extdata", "data_utf8.csv", package = "sfc") model <- system.file("extdata", "model_utf8.txt", package = "sfc") sfc(data, model, sample.size = 100, fileencoding = "UTF-8") ## model as csv data <- system.file("extdata", "data_utf8.csv", package = "sfc") model <- system.file("extdata", "model_utf8.csv", package = "sfc") sfc(data, model, fileencoding = "UTF-8")

Index Distributions, 3 read.csv, 2 scan, 2 set.seed, 2 sfc, 2 sfc-package, 2 5