<commit_before>{-# LANGUAGE DeriveGeneric, OverloadedStrings #-}

{-|

Monthly sunspots from 1749

Listed as sunspot.month here: http://vincentarelbundock.github.io/Rdatasets/datasets.html


-}

module Numeric.Datasets.Sunspots where

import Numeric.Datasets

import Data.Csv
import GHC.Generics

data Sunspot = Sunspot
  { time :: Double
  , sunspotMonth :: Double
  } deriving (Show, Read, Generic)

instance FromNamedRecord Sunspot where
    parseNamedRecord m = Sunspot <$>
                         m .: "time" <*>
                         m .: "sunspot.month"

sunspots :: Dataset Sunspot
sunspots = csvHdrDataset
   $ URL "http://vincentarelbundock.github.io/Rdatasets/csv/datasets/sunspot.month.csv"<commit_msg>fix sunspots for old GHC<commit_after>{-# LANGUAGE DeriveGeneric, OverloadedStrings #-}

{-|

Monthly sunspots from 1749

Listed as sunspot.month here: http://vincentarelbundock.github.io/Rdatasets/datasets.html


-}

module Numeric.Datasets.Sunspots where

import Numeric.Datasets

import Data.Csv
import GHC.Generics
import Control.Applicative

data Sunspot = Sunspot
  { time :: Double
  , sunspotMonth :: Double
  } deriving (Show, Read, Generic)

instance FromNamedRecord Sunspot where
    parseNamedRecord m = Sunspot <$>
                         m .: "time" <*>
                         m .: "sunspot.month"

sunspots :: Dataset Sunspot
sunspots = csvHdrDataset
   $ URL "http://vincentarelbundock.github.io/Rdatasets/csv/datasets/sunspot.month.csv"
{'fraction_non_alphanumeric': 0.10244233378561737, 'fraction_numerical': 0.005427408412483039, 'mean_word_length': 3.2142857142857144, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1986323', 'n_tokens_mistral': 505, 'n_tokens_neox': 485, 'n_words': 107}