Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 76
Steven(Yuhang) Wang edited this page Sep 20, 2016
·
3 revisions
Welcome to the statistics wiki!
Usage:
importControl.Applicative ((<$>))
importStatistics.Sample.KernelDensity (kde)
importText.Hastache (MuType(..), defaultConfig, hastacheFile)
importText.Hastache.Context (mkStrContext)
importqualifiedData.Attoparsec.ByteStringasBimportqualifiedData.Attoparsec.ByteString.Char8asAimportqualifiedData.ByteStringasBimportqualifiedData.ByteString.LazyasLimportqualifiedData.Vector.UnboxedasUimportqualifiedData.Text.Lazy.IOasTL
csv =doB.takeTill A.isEndOfLine
(A.double `A.sepBy`A.char ',') `A.sepBy`A.endOfLine
main =do
waits <- (eithererror (U.fromList .maplast.filter (not.null)) .A.parseOnly csv) <$>B.readFile"data/faithful.csv"let xs =map (\(a,b) -> [a,b]) .U.toList .uncurryU.zip. kde 64$ waits
context "data"=MuVariable.show$ xs
s <- hastacheFile defaultConfig "kde.tpl" (mkStrContext context)
TL.writeFile"kde.html" s