package output
Provides extensions for writing common scala types to text files. Two formats are used: CSV and JSON. Although CSV is simpler, it can be used for writing data to be read by TIKZ (latex). JSON is more flexible and is useful when different models or analyses must share data.
Overview
The implicit functions are designed to be used like this:
val v: Vector[Double] = Vector(1,2,3,4,5) v.writetoCSV("myVectorTestCSV.csv") v.writeToJSON("travel_times", "myVectortestJSON.json") val m: Map[String,Vector[Double]] = Map("lausanne" -> Vector(1.1,2.0,3.7,4.3), "basel" -> Vector(9.0, 3.55, 3.2)) m.writeToCSV("myMapTestCSV.csv") m.writeToJSON("train_stations", "myMaptestJSON.json") val ab: scala.collection.mustable.ArrayBuffer[(Int. Double)] = scala.collectection.mutable.ArrayBuffer((1,2.156),(2,3.1415),(3,42.23)) ab.writeToCSV("myABTestCSV.csv")
- Alphabetic
- By Inheritance
- output
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
object
MapSeqExtensions
Function to write a Map[U, Seq[T]] to a CSV or JSON file.
Function to write a Map[U, Seq[T]] to a CSV or JSON file. Also designed to be as generic as possible. Both type parameters only require the toString method to exist.
-
object
SeqExtension
Extensions of scala.collection.Seq, a parent of many collections classes which look like a Vector.
Extensions of scala.collection.Seq, a parent of many collections classes which look like a Vector. The only requirement is the existance of a toString method. As this always exists (if no specific method exists, the address in memory is printed) these implicit functions are very generic. These functions work on both mutable and immutable collections.
-
object
SeqOfSeqExtensions
Extensions of scala.collection.mutable.Seq.
Extensions of scala.collection.mutable.Seq. More general than specific implementations.
-
object
SeqTuplesExtensions
Extensions of scala.collection.Seq with tuples