[
  {
    "path": ".Rbuildignore",
    "content": "imputeTS-header.png\nimputeTS-header.jpg\nimputeTS-logo1800x2100.png\n^.*\\.Rproj$\n^\\.Rproj\\.user$\n^.*\\.yml$\n^.*\\.yaml$\n^.*\\.ini$\n^.*\\.txt$\n^.*\\.pptx$\n^appveyor\\.yml$\nIcon\nIcon?\nDocs\n^doc$\n^Meta$\n^revdep\n\n^\\.github$\n^codecov\\.yml$\n"
  },
  {
    "path": ".github/.gitignore",
    "content": "*.html\n"
  },
  {
    "path": ".github/workflows/R-CMD-check.yaml",
    "content": "# Workflow derived from https://github.com/r-lib/actions/tree/master/examples\n# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help\n#\n# NOTE: This workflow is overkill for most R packages and\n# check-standard.yaml is likely a better choice.\n# usethis::use_github_action(\"check-standard\") will install it.\non:\n  push:\n    branches: [main, master]\n  pull_request:\n    branches: [main, master]\n\nname: R-CMD-check\n\njobs:\n  R-CMD-check:\n    runs-on: ${{ matrix.config.os }}\n\n    name: ${{ matrix.config.os }} (${{ matrix.config.r }})\n\n    strategy:\n      fail-fast: false\n      matrix:\n         config:\n          - {os: macos-latest,   r: 'release'}\n          - {os: windows-latest, r: 'release'}\n          # exercise older Windows toolchain via oldrel-4 (R 4.1.x, rtools40)\n          - {os: windows-latest, r: 'oldrel-4'}\n          - {os: ubuntu-latest,  r: 'release'}\n          - {os: ubuntu-latest,  r: 'oldrel-1'}\n          - {os: ubuntu-latest,  r: 'oldrel-2'}\n          - {os: ubuntu-latest,  r: 'oldrel-3'}\n          - {os: ubuntu-latest,  r: 'oldrel-4'}\n\n    env:\n      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}\n      R_KEEP_PKG_SOURCE: yes\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: r-lib/actions/setup-pandoc@v2\n      \n      - uses: r-lib/actions/setup-tinytex@v2\n\n      - uses: r-lib/actions/setup-r@v2\n        with:\n          r-version: ${{ matrix.config.r }}\n          http-user-agent: ${{ matrix.config.http-user-agent }}\n          use-public-rspm: true\n\n      - uses: r-lib/actions/setup-r-dependencies@v2\n        with:\n          extra-packages: rcmdcheck\n\n      - name: Install dependencies\n        run: |\n          tinytex::parse_install(text = \"! LaTeX Error: File `etex.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `tikz.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `fancyhdr.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `microtype.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `setspace.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `titlesec.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `placeins.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `caption.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `environ.sty' not found.\")\n          tinytex::parse_install(text = \"! LaTeX Error: File `upquote.sty' not found.\")\n          tinytex::parse_install(text = \"! Font OML/zplm/m/it/9=zplmr7m at 9.0pt not loadable: Metric (TFM) file not found.\")\n          tinytex::parse_install(text = \"! Font T1/ppl/m/n/10=pplr8t at 10.0pt not loadable: Metric (TFM) file not found.\")\n        shell: Rscript {0}\n\n      - uses: r-lib/actions/check-r-package@v2\n      \n      - name: Show testthat output\n        if: always()\n        run: find check -name 'testthat.Rout*' -exec cat '{}' \\; || true\n        shell: bash\n\n      - name: Upload check results\n        if: failure()\n        uses: actions/upload-artifact@main\n        with:\n          name: ${{ runner.os }}-r${{ matrix.config.r }}-results\n          path: check\n"
  },
  {
    "path": ".github/workflows/pkgdown.yaml",
    "content": "# Workflow derived from https://github.com/r-lib/actions/tree/master/examples\n# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help\non:\n  push:\n    branches: [main, master]\n  release:\n    types: [published]\n  workflow_dispatch:\n\nname: pkgdown\n\njobs:\n  pkgdown:\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: r-lib/actions/setup-pandoc@v2\n\n      - uses: r-lib/actions/setup-r@v2\n        with:\n          use-public-rspm: true\n\n      - uses: r-lib/actions/setup-r-dependencies@v2\n        with:\n          extra-packages: pkgdown\n          needs: website\n\n      - name: Install the package\n        run: R CMD INSTALL .\n\n      - name: Deploy package\n        run: |\n          git config --local user.name \"$GITHUB_ACTOR\"\n          git config --local user.email \"$GITHUB_ACTOR@users.noreply.github.com\"\n          Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'\n"
  },
  {
    "path": ".github/workflows/pr-commands.yaml",
    "content": "# Workflow derived from https://github.com/r-lib/actions/tree/master/examples\n# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help\non:\n  issue_comment:\n    types: [created]\n\nname: Commands\n\njobs:\n  document:\n    if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}\n    name: document\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: r-lib/actions/pr-fetch@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - uses: r-lib/actions/setup-r@v2\n        with:\n          use-public-rspm: true\n\n      - uses: r-lib/actions/setup-r-dependencies@v2\n        with:\n          extra-packages: roxygen2\n\n      - name: Document\n        run: Rscript -e 'roxygen2::roxygenise()'\n\n      - name: commit\n        run: |\n          git config --local user.name \"$GITHUB_ACTOR\"\n          git config --local user.email \"$GITHUB_ACTOR@users.noreply.github.com\"\n          git add man/\\* NAMESPACE\n          git commit -m 'Document'\n\n      - uses: r-lib/actions/pr-push@v1\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n  style:\n    if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}\n    name: style\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: r-lib/actions/pr-fetch@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n\n      - uses: r-lib/actions/setup-r@v2\n\n      - name: Install dependencies\n        run: Rscript -e 'install.packages(\"styler\")'\n\n      - name: Style\n        run: Rscript -e 'styler::style_pkg()'\n\n      - name: commit\n        run: |\n          git config --local user.name \"$GITHUB_ACTOR\"\n          git config --local user.email \"$GITHUB_ACTOR@users.noreply.github.com\"\n          git add \\*.R\n          git commit -m 'Style'\n\n      - uses: r-lib/actions/pr-push@v2\n        with:\n          repo-token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/test-coverage.yaml",
    "content": "# Workflow derived from https://github.com/r-lib/actions/tree/master/examples\n# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help\non:\n  push:\n    branches: [main, master]\n  pull_request:\n    branches: [main, master]\n\nname: test-coverage\n\njobs:\n  test-coverage:\n    runs-on: ubuntu-latest\n    env:\n      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: r-lib/actions/setup-r@v2\n        with:\n          use-public-rspm: true\n\n      - uses: r-lib/actions/setup-r-dependencies@v2\n        with:\n          extra-packages: covr\n\n      - name: Test coverage\n        run: covr::codecov()\n        shell: Rscript {0}\n"
  },
  {
    "path": ".gitignore",
    "content": ".Rproj.user\n/.Rhistory\n/.dropbox\n/desktop.ini\n/.RData\nIcon?\nIcon\n*.o\n*.dll\n*.so\ndoc\nMeta\n/doc/\n/Meta/\n"
  },
  {
    "path": "DESCRIPTION",
    "content": "Package: imputeTS\nVersion: 3.4\nDate: 2025-08-25\nTitle: Time Series Missing Value Imputation\nDescription: Imputation (replacement) of missing values \n             in univariate time series. \n             Offers several imputation functions\n             and missing data plots. \n             Available imputation algorithms include: \n            'Mean', 'LOCF', 'Interpolation', \n            'Moving Average', 'Seasonal Decomposition', \n            'Kalman Smoothing on Structural Time Series models',\n            'Kalman Smoothing on ARIMA models'. Published in Moritz and Bartz-Beielstein (2017) \n            <doi:10.32614/RJ-2017-009>.\nAuthor: Steffen Moritz [aut, cre, cph] (<https://orcid.org/0000-0002-0085-1804>), Sebastian Gatscha [aut], Earo Wang [ctb] (<https://orcid.org/0000-0001-6448-5260>), Ron Hause [ctb] (<https://orcid.org/0000-0002-5229-7366>)\nAuthors@R: \n  c(\n  person(\"Steffen\", \"Moritz\", email=\"steffen.moritz10@gmail.com\", role=c(\"aut\", \"cre\", \"cph\"), comment = c(ORCID = \"0000-0002-0085-1804\")),\n  person(\"Sebastian\", \"Gatscha\", email=\"sebastian_gatscha@gmx.at\", role=\"aut\"),\n  person(\"Earo\", \"Wang\", email = \"earo.wang@gmail.com\", role = c(\"ctb\"), comment = c(ORCID = \"0000-0001-6448-5260\")),\n  person(\"Ron\", \"Hause\", email = \"ronaldhause@gmail.com\", role = c(\"ctb\"), comment = c(ORCID = \"0000-0002-5229-7366\"))\n  )\nMaintainer: Steffen Moritz <steffen.moritz10@gmail.com>\nLazyData: yes\nType: Package\nByteCompile: TRUE\nBugReports: https://github.com/SteffenMoritz/imputeTS/issues\nURL: https://github.com/SteffenMoritz/imputeTS, https://steffenmoritz.github.io/imputeTS/\nRepository: CRAN\nDepends:\n    R (>= 3.6)\nImports:\n    stats,\n    grDevices,\n    ggplot2 (>= 3.3.0),\n    ggtext,\n    stinepack,\n    forecast,\n    magrittr,\n    methods,\n    Rcpp\nSuggests:\n    testthat,  R.rsp, knitr, zoo, timeSeries, tis, xts, tibble, tsibble, rmarkdown, covr\nLicense: GPL-3\nVignetteBuilder: R.rsp, knitr, rmarkdown\nRoxygenNote: 7.3.2\nRoxygen: list(markdown = TRUE)\nLinkingTo: Rcpp\nEncoding: UTF-8\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "NAMESPACE",
    "content": "# Generated by roxygen2: do not edit by hand\n\nexport(\"%>%\")\nexport(ggplot_na_distribution)\nexport(ggplot_na_distribution2)\nexport(ggplot_na_gapsize)\nexport(ggplot_na_gapsize2)\nexport(ggplot_na_imputations)\nexport(ggplot_na_intervals)\nexport(na.interpolation)\nexport(na.kalman)\nexport(na.locf)\nexport(na.ma)\nexport(na.mean)\nexport(na.random)\nexport(na.remove)\nexport(na.replace)\nexport(na.seadec)\nexport(na.seasplit)\nexport(na_interpolation)\nexport(na_kalman)\nexport(na_locf)\nexport(na_ma)\nexport(na_mean)\nexport(na_random)\nexport(na_remove)\nexport(na_replace)\nexport(na_seadec)\nexport(na_seasplit)\nexport(plotNA.distribution)\nexport(plotNA.distributionBar)\nexport(plotNA.gapsize)\nexport(plotNA.imputations)\nexport(statsNA)\nimport(stats)\nimportFrom(Rcpp,sourceCpp)\nimportFrom(forecast,auto.arima)\nimportFrom(forecast,findfrequency)\nimportFrom(ggplot2,aes)\nimportFrom(ggplot2,after_stat)\nimportFrom(ggplot2,alpha)\nimportFrom(ggplot2,coord_flip)\nimportFrom(ggplot2,element_blank)\nimportFrom(ggplot2,element_text)\nimportFrom(ggplot2,geom_bar)\nimportFrom(ggplot2,geom_line)\nimportFrom(ggplot2,geom_point)\nimportFrom(ggplot2,geom_text)\nimportFrom(ggplot2,ggplot)\nimportFrom(ggplot2,ggtitle)\nimportFrom(ggplot2,guide_legend)\nimportFrom(ggplot2,guides)\nimportFrom(ggplot2,labs)\nimportFrom(ggplot2,position_dodge)\nimportFrom(ggplot2,scale_color_manual)\nimportFrom(ggplot2,scale_fill_gradientn)\nimportFrom(ggplot2,scale_fill_manual)\nimportFrom(ggplot2,scale_size_identity)\nimportFrom(ggplot2,scale_x_continuous)\nimportFrom(ggplot2,scale_x_discrete)\nimportFrom(ggplot2,scale_y_continuous)\nimportFrom(ggplot2,stat_bin)\nimportFrom(ggplot2,theme)\nimportFrom(ggplot2,theme_classic)\nimportFrom(ggplot2,theme_linedraw)\nimportFrom(ggplot2,xlab)\nimportFrom(ggplot2,ylab)\nimportFrom(ggtext,element_markdown)\nimportFrom(grDevices,heat.colors)\nimportFrom(grDevices,nclass.Sturges)\nimportFrom(magrittr,\"%>%\")\nimportFrom(methods,hasArg)\nimportFrom(stats,KalmanRun)\nimportFrom(stats,KalmanSmooth)\nimportFrom(stats,StructTS)\nimportFrom(stats,approx)\nimportFrom(stats,arima)\nimportFrom(stats,frequency)\nimportFrom(stats,median)\nimportFrom(stats,runif)\nimportFrom(stats,spline)\nimportFrom(stats,stl)\nimportFrom(stats,ts)\nimportFrom(stinepack,stinterp)\nimportFrom(utils,globalVariables)\nuseDynLib(imputeTS)\n"
  },
  {
    "path": "NEWS.md",
    "content": "\n# Changes in Version 3.4\n\n* Added ggplot_na_gapsize2 plot (and unit tests). \n  Nice way to illustrate how different NA gapsizes (consecutive NAs in a row) amount for NA totals.\n\n* Fix of the CITATION file to comply with newer CRAN rules\n\n* Update of ggplot_na_imputations() to avoid using now depreciated ggplot2 options\n\n* Update of unit tests for all plotting functions (ggplot_na_...). Now using is_ggplot() to check for correct output.\n  This was necessary because of a major ggplot2 update (switch to s7 classes).\n\n# Changes in Version 3.3\n\nThanks to Sabrina Krys, Kevin Villalobos, Tracy Shen, hezhichao1991, englianhu for bug / issue reporting.\nThanks to RicardaP for fixing documentation error.\nThanks to Ronald Hause for the commit to optimize parameter pass trough from approx to na_interpolation.\n\n\n* Renamed ggplot_na_intervals to ggplot_na_distribution2\n\n* Updates to ggplot_na_gapsize: Space between the bars adjusted for better optics.\n  Added parameters for directly choosing the bar border color and alpha value for\n  filling of the bars.\n  \n* Improved notification message for na_seadec/na_seasplit when find_frequency couldn't find\n  a seasonal pattern.\n\n* Corrected error in na_kalman documentation - auto.arima was wrongly described as default parameter choice, while in reality it is StructTS \n  (reported by RicardaP)\n\n* Changes for the error handling. (**These changes got reverted and did not make it into the CRAN release**). For some specific cases the input checks performed by imputeTS stop pipe workflows in their entirety. E.g. a problem when group_by leads to  all NA subsets - which fail the input check and then stop the whole pipe workflow. To prevent this, stop() is only called, when the user supplied imputeTS algorithm parameter options are wrong or misspelled. Unsupported input data will only give a warning() (and do not perform any action on the data). Thus, there is no call to stop(), that cancels the whole pipe workflow.  (issue reported by Sabrina Krys). This works fine, but after closer consideration we figured people fail to notice warnings way too often and thus it is more user friendly to clearly stop with an error for these issues. After all, the users data analysis clearly profits from taking a closer look in these specific cases. If you are anyhow interested in the version without the reverted changes, it can be installed from github with the following command: devtools::install_github(\"https://github.com/SteffenMoritz/imputeTS/commit/aaf759216b4091e36dee6e8e3a10185ff8f4647b\")\n\n* Improved error messages (especially for multivariate inputs) and unit tests for the warnings and errors.\n\n* Corrected typo in 'Input data needs at least x non-NA data points' error message\n\n*  Better parameter pass trough from approx to na_interpolation- Added capability to alter rule for linear extrapolation outside the interval [min(x), max(x)] \n   (commit by Ronald Hause)\n\n* Improved na_interpolation documentation (more information about possible parameter pass \n  through from underlying spline, approx,stinterp functions)\n\n* Additional unit tests\n\n* Moved to Github Actions instead of TravisCI / AppVeyor.\n\n* Bugfix for \"Error in optim(init[mask], getLike, method = \"L-BFGS-B\", lower = rep(0, : L-BFGS-B needs finite values of 'fn'.\", which comes for completely constant input to na_kalman e.g. 4,4,4,NA,4,4. (reported by Kevin Villalobos, Tracy Shen, hezhichao1991, englianhu)\n\n* Improved na_seadec documentation (algorithm details)\n\n* Changed R Version requirement in Description to R (>= 3.6) since imported packages like ggtext and also some testthat   tests were already requiring newer versions than the old R (≥ 3.0.1) requirement of imputeTS\n\n\n# Changes in Version 3.2\n\nThanks to Mark J. Lamias for bug / issue reporting.\nThanks to Cyrus Mohammadian for bug reporting.\nThanks to Miroslaw Janik for issue reporting. \n\n* Fix to remove CRAN note - removed not used utils from DESCRIPTION imports\n\n* Minor fix to ggplot_na_distribution (bars end now at max(timeseries)*1.05)\n\n* Typo corrections in statsNA\n\n* Specified ggplot2 (>= 3.3.0) in imports, to prevent errors with older ggplot2 versions (reported by Cyrus Mohammadian)\n\n* Updated na_locf documentation to make behavior of na_remaining parameter more clear (issue reported by Mark J. Lamias)\n\n* ggplot_na_intervals, has now percentages with % sign (e.g. 10%) on y-scale instead of just numbers (e.g. 0,1)\n  (suggestion from Miroslaw Janik)\n  \n* Added some figures and the Cheat Sheet .pptx to .Rbuildignore to avoid CRAN warning about  \n  package size. These files and figures were not needed for the CRAN version. \n\n\n# Changes in Version 3.1\n\nThanks to Johannes Menzel for bug reporting, Thanks to Jan (jmablans) for bug reporting. \nThanks to Earo Wang for speedup of plotNA.gapsize.\nSpecial Thanks to Sebastian Gatscha for plotting functions, new na_mean options, new unit tests.\n\n* Plotting functions are all in ggplot now (way better looking). Additionally they got renamed accordingly ggplot_na_distribution, ggplot_na_intervals, ggplot_na_gapsize, ggplot_na_imputations.\n\n* Speedup for plotNA_gapsize calculation (now renamed ggplot_na_gapsize)  (thx to Earo Wang) \n  \n* Added harmonic and geometric mean as option for na_mean\n\n* Removed bug in na_replace - it can now be used with all NA vectors since \n it requires no minimum of non-NA values (reported by Jan - jmablans)\n \n* Improved na.random input check (usable with all NA input now if upper and lower bound\n  parameters are explicitly set to numeric values)\n\n* Additional unit tests for the plotting functions\n\n* Additional unit tests for the all imputation functions (testing all NA input)\n\n* Update for testthat unit tests\n\n* Fixed a mistake in README.md (reported by Johannes Menzel)\n\n* Added to statsNA: Number of Gaps, Average Gap Size + reformatting of code + \n  compatibility with other ts objects\n\n* Documentation improvements through newer roxygen version (Markup now possible in documentation)\n\n* updated Readme + Vignette to new function names\n\n* Added the imputeTS Cheat Sheet as Vignette\n\n* Added new vignette Gallery Missing Data Visualizations\n\n* Added revdep\n\n# Changes in Version 3.0\n\nThanks to Jim Maas, shreydesai, Breza, CameronNemo for reporting bugs.\nThanks to  Sebastian Gatscha providing the (way faster) C++ na.ma() implementation.\n\n * tibble and tstibble compatibility\n \n * Reworked internal code documentation\n\n * na.ma speed up via C++ \n\n * Changed vignette builder to R.rsp\n\n * Used R package styler package to optimize source code readability\n \n * Made some changes to better follow tidyverse style guide\n \n * Replaced na. with na_ e.g. na.mean with na_mean usw.This fits better to modern code\n   style guidelines. The old function names will still work for a while,\n   but give a warning.\n\n * Added findFrequency option to na.seadec and na.seasplit\n\n * Added maxgap option\n \n * Fixed bug for na.seadec - also imputed known values in some special cases\n   (reported by CameronNemo)\n\n * Added doi: 10.32614/RJ-2017-009 to describtion, references, readme and citation file\n\n * Added StackExchange link to Readme\n\n * Moved stinepack from imports to suggested\n \n * Internal reorganization of imports - now always using pkg::function and importFrom pkg x1 x2 x3instead of just import pkg\n\n* Fixed bug in na.ma when using xts time series with NA at the end\n\n* Fixed error message in na.interpolation if wrong parameter is given       \n   stop(\"Wrong parameter 'option' given. Value must be either 'linear', 'spline' or 'stine'.\")\n   (reported by Breza)\n\n* Fixed spelling mistakes in na.seadec and na.seasplit (reported by shreydesai)\n\n* Fixed bug with na.random() output (reported by Jim Maas)\n\n\n# Changes in Version 2.7\n\n  * Updated Description: Orcid Id added, packages required for unit test add as \"Suggested\"\n\n  * Small correction in README.md, small update to citation file\n  \n  * Replaced NEWS with NEWS.md for better formatting\n  \n\n# Changes in Version 2.6\n\n  * Updated citation file\n  \n  * Minor changes to vignette\n\n\n# Changes in Version 2.5\n\n  * Adjusted unit test to a update of forecast package\n  \n  \n\n# Changes in Version 2.4\n\n  * Small speed improvments for na.kalman\n  \n  * Improved input check for all functions\n\n  * Bugfix for unit tests \n\n  * Changes to unit test (because of zoo update)\n  \n\n# Changes in Version 2.3\n\n  * Bugfix for na.kalman with integer input\n  \n  * Readme Update\n\n  * Improved error messages for na.seasplit and na.seadec\n\n  * Minor vignette changes\n\n\n# Changes in Version 2.2\n\n  * Bugfix for na.locf (also concerned na.kalman) \n  \n\n# Changes in Version 2.1\n\n  * Fixed for problems with Solaris/Sparc\n  \n  * Fixes for problems with vignette on osx\n\n\n# Changes in Version 2.0\n\n  * Bugfix for plots without missing data\n  \n  * Increased performance for na.locf\n  \n  * Minor bugfixes for specific data.frame inputs\n  \n  * Minor bugfixes for specific xts object inputs\n\n  * Improved Code Documentation\n  \n  * Added new software tests\n\n\n# Changes in Version 1.9\n\n  * Added Vignette\n\n\n# Changes in Version 1.8\n\n  * Computation time improvments for na.locf (up to 10000 times faster)\n  \n  * Computation time improvments for na.interpolation (up to 10000 times faster)\n  \n  * Computation time improvments for na.kalman (only slightly faster, under 10%)\n  \n  * Fixed unnecessary warning message with some na.kalman options\n  \n  * Adjusted default parameters for plotNA.distributionBar (using nclass.Sturges for breaks parameter)\n  \n  * Fixed issue with too sensitive input checking\n  \n\n# Changes in Version 1.7\n  \n  * Enabled usage of multivariate input (data.frame, mts, matrix,...) for all imputation \n    functions except na.remove. This means users do not have to loop through all columns \n    by themselfes anymore if they want to use the package with multivariate data. The\n    imputation itself is still performend in univariate manner (column after column). \n  \n  * Improved compatibility with different advanced time series objects like zoo and xts.\n    Using the imputation functions with these time series objects should be possible now. \n    These series will not be explicitly named as possible input in the user documentation.\n    Absence of errors can not be guaranteed. However, there are no known issues yet.\n  \n  * Added several things for unit tests with pkg 'testthat'\n  \n  * Added unit tests for every function\n  \n  * Adjusted error messages\n  \n  * Internal Coding style improvement: replaced all T with TRUE and all F with FALSE\n  \n  * Adjustment tsHeating / tsHeatingComplete datasets (set 1440 as frequency parameter)\n  \n  * Adjustment tsNH4 / tsNH4Complete datasets (set 144 as frequency parameter)\n  \n  * Fixes for grammar, spelling and citations in the whole documentation\n  \n  * Revised examples in the documentation for all functions\n \n  * Restricted output of na.remove to vector only (issue with incorrect time information otherwise)\n  \n  * Added better x-axes labels for plotNA.distribution\n  \n\n# Changes in Version 1.6\n  \n  * Added github links to description file\n  \n  * Added citation file\n  \n  * Updated Readme (badges for travis ci and cran status)\n  \n  * Fix in documentation for na.interpolation \n   (due to outdated descriptions)\n   \n  * Fix in documentation plotNA.distribution / plotNA.distributionBar\n    (due to interchanged descriptions)\n    \n  * Added references to used packages in na.kalman and na.interpolation documentation\n\n\n# Changes in Version 1.5\n\n  * Allows now also numeric vectors as input\n\n  * Removed na.identifier parameter for all functions (too error prone, better handled \n    individually by the user)\n\n  * Minor changes in na.interpolation with option = \"stine\"\n  \n  * Added na.ma imputation function\n\n  * Replaced \"data\" in all function parameters with the more common \"x\"\n\n  * Improvement of all code examples\n\n  * Renamed heating/heatingComplete dataset to tsHeating/tsHeatingComplete\n\n  * Renamed nh4/nh4Complete dataset to tsNH4/tsNH4Complete\n\n  * Added tsAirgap / tsAirgapComplete datasets\n\n  * Improved imputeTS-package documentation\n\n  * Added na.kalman imputation function\n\n  * Added README.md function\n\n  * Added statsNA function\n\n  * Added plotNA.gapsize function\n  \n  * Renamed vis.imputations to plotNA.imputations\n\n  * Renamed vis.barMissing to plotNA.distributionBar\n\n  * Renamed vis.missing to plotNA.distribution\n  \n  * Fixed issues with parameter pass through and legend for\n    all plotting functions\n    \n  * Improved dataset documentation \n\n\n# Changes in Version 0.4\n\n  * Update of vis.differences (better looking plot now)\n  \n  * Added vis.missing to visualize the distribution of missing data in a time series\n  \n  * Added vis.barMissing, which is especially suited to visualize missing data in very huge time series\n  \n  * Update na.interpolate (added Stineman interpolation and enabled ... parameter \n    for all interpolation algorithms to pass through parameters to the underlying functions)\n\n\n# Changes in Version 0.3\n\n  * Added two datasets of sensor data\n  \n  * vis.differences for plotting differences between real and imputed values\n  \n\n# Changes in Version 0.2\n\n  * Removed internal functions from visible package documentation\n\n  * Added additional algorithms: na.seasplit and na.seadec\n  \n  * internal function for algorithm selection\n  \n\n# Changes in Version 0.1\n\n  * Created initial version of imputeTS package for univariate time series imputation\n\n  * added the simple imputation functions: na.locf, na.mean, na.random, na.interpolation, \n    na.replace\n\n  * added na.remove function for removing all NAs from a time series\n"
  },
  {
    "path": "R/.Rapp.history",
    "content": ""
  },
  {
    "path": "R/RcppExports.R",
    "content": "# Generated by using Rcpp::compileAttributes() -> do not edit by hand\n# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393\n\nlocf <- function(x, reverse) {\n    .Call('_imputeTS_locf', PACKAGE = 'imputeTS', x, reverse)\n}\n\nma <- function(x, k, weighting) {\n    .Call('_imputeTS_ma', PACKAGE = 'imputeTS', x, k, weighting)\n}\n\n"
  },
  {
    "path": "R/deprecated_defunct.R",
    "content": "#--------------------------------------------------------------#\n# Collection of DEPRECATED AND DEFUNCT FUNCTIONS\n#--------------------------------------------------------------#\n\n\n\n#--------------------------------------------------------------#\n# IMPUTATION FUNCTIONS\n# Old na. imputation functions, replaced by na_ \n# Deprecated since Version 3.0 (2019-07-01)\n#--------------------------------------------------------------#\n\n\n# na.interpolation()\n# replaced by na_interpolation\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_interpolation}} instead.\n#' @description na.interpolation is replaced by \\code{\\link[imputeTS]{na_interpolation}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_interpolation\n#' @keywords internal\n#' @export\nna.interpolation <- function(x, option = \"linear\", maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_interpolation\",\n    old = \"na.interpolation\",\n    msg = \"na.interpolation will be replaced by na_interpolation.\n           Functionality stays the same.\n           The new function name better fits modern R code style guidelines.\n           Please adjust your code accordingly.\"\n  )\n  na_interpolation(x, option, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.kalman()\n# replaced by na_kalman\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_kalman}} instead.\n#' @description na.kalman is replaced by \\code{\\link[imputeTS]{na_kalman}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_kalman\n#' @keywords internal\n#' @export\nna.kalman <- function(x, model = \"StructTS\", smooth = TRUE, nit = -1, maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_kalman\",\n    old = \"na.kalman\",\n    msg = \"na.kalman will be replaced by na_kalman.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_kalman(x, model, smooth, nit, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.locf()\n# replaced by na_locf\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_locf}} instead.\n#' @description na.locf is replaced by \\code{\\link[imputeTS]{na_locf}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_locf\n#' @keywords internal\n#' @export\nna.locf <- function(x, option = \"locf\", na.remaining = \"rev\", maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_locf\",\n    old = \"na.locf\",\n    msg = \"na.locf will be replaced by na_locf.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_locf(x, option, na.remaining, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.ma()\n# replaced by na_ma\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_ma}} instead.\n#' @description na.ma is replaced by \\code{\\link[imputeTS]{na_ma}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_ma\n#' @keywords internal\n#' @export\nna.ma <- function(x, k = 4, weighting = \"exponential\", maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_ma\",\n    old = \"na.ma\",\n    msg = \"na.ma will be replaced by na_ma.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_ma(x, k, weighting, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.mean()\n# replaced by na_mean\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_mean}} instead.\n#' @description na.mean is replaced by \\code{\\link[imputeTS]{na_mean}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_mean\n#' @keywords internal\n#' @export\nna.mean <- function(x, option = \"mean\", maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_mean\",\n    old = \"na.mean\",\n    msg = \"na.mean will be replaced by na_mean.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_mean(x, option, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.random()\n# replaced by na_random\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_random}} instead.\n#' @description na.random is replaced by \\code{\\link[imputeTS]{na_random}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_random\n#' @keywords internal\n#' @export\nna.random <- function(x, lower_bound = NULL, upper_bound = NULL, maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_random\",\n    old = \"na.random\",\n    msg = \"na.random will be replaced by na_random.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_random(x, lower_bound, upper_bound, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.remove()\n# replaced by na_remove\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_remove}} instead.\n#' @description na.remove is replaced by \\code{\\link[imputeTS]{na_remove}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_remove\n#' @keywords internal\n#' @export\nna.remove <- function(x, ...) {\n  .Deprecated(\n    new = \"na_remove\",\n    old = \"na.remove\",\n    msg = \"na.remove will be replaced by na_remove.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_remove(x, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.replace()\n# replaced by na_replace\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_replace}} instead.\n#' @description na.replace is replaced by \\code{\\link[imputeTS]{na_replace}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_replace\n#' @keywords internal\n#' @export\nna.replace <- function(x, fill = 0, maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_replace\",\n    old = \"na.replace\",\n    msg = \"na.replace will be replaced by na_replace.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_replace(x, fill, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.seadec()\n# replaced by na_seadec\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_seadec}} instead.\n#' @description na.seadec is replaced by \\code{\\link[imputeTS]{na_seadec}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_seadec\n#' @keywords internal\n#' @export\nna.seadec <- function(x, algorithm = \"interpolation\", find_frequency = FALSE, maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_seadec\",\n    old = \"na.seadec\",\n    msg = \"na.seadec will be replaced by na_seadec.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_seadec(x, algorithm, find_frequency, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# na.seasplit()\n# replaced by na_seasplit\n#--------------------------------------------------------------------------------------#\n#' Deprecated use \\code{\\link[imputeTS]{na_seasplit}} instead.\n#' @description na.seasplit is replaced by \\code{\\link[imputeTS]{na_seasplit}}.\n#' The functionality stays the same. The new name better fits modern R code\n#' style guidelines (which prefer _ over . in function names).\n#' @inheritParams na_seasplit\n#' @keywords internal\n#' @export\nna.seasplit <- function(x, algorithm = \"interpolation\", find_frequency = FALSE, maxgap = Inf, ...) {\n  .Deprecated(\n    new = \"na_seasplit\",\n    old = \"na.seasplit\",\n    msg = \"na.seasplit will be replaced by na_seasplit.\n    Functionality stays the same.\n    The new function name better fits modern R code style guidelines.\n    Please adjust your code accordingly.\"\n  )\n  na_seasplit(x, algorithm, find_frequency, maxgap, ...)\n}\n#--------------------------------------------------------------------------------------#\n\n\n\n\n\n\n#--------------------------------------------------------------#\n# PLOTTING FUNCTIONS\n# Old plotNA. visualization functions, replaced by ggplot_na_ \n# Deprecated since Version 3.1 (2020-07-30)\n#--------------------------------------------------------------#\n\n\n\n# plotNA.distribution()\n# replaced by ggplot_na_distribution\n#--------------------------------------------------------------------------------------#\n#' @title Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution}} instead.\n#' @description plotNA.distribution was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution}}.\n#' The new plotting function provides an improved version of the old plot, e.g. it looks better now and is better adjustable, \n#' because it is based on ggplot2. If you absolutely want to use the old function, \n#' you need to download an older package version. Versions 3.0 and below still have the old functions.\n#' @keywords internal\n#' @export\n\nplotNA.distribution <- function(x, ... ) {\n  \n  .Defunct(\n    new = \"ggplot_na_distribution\",\n    msg = \"\n    plotNA.distribution was replaced by ggplot_na_distribution.\n    Use this function instead.\n    \n    The plot itself is the same, but looks better now and is better adjustable, because it is based on ggplot2.\n    \n    If you absolutely want to use the old function, you need to manually download an older package version.\n    (Versions 3.0 and below still have the old functions)\"\n  )\n}\n#--------------------------------------------------------------------------------------#\n\n\n# ggplot_na_intervals\n# replaced by ggplot_na_intervals\n#--------------------------------------------------------------------------------------#\n#' @title Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution2}} instead.\n#' @description plotNA.distributionBar was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution2}}.\n#' The new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable, \n#' because it is based on ggplot2. If you absolutely want to use the old function, \n#' you need to download an older package version. Versions 3.0 and below still have the old functions.\n#' @keywords internal\n#' @export\n\nggplot_na_intervals <- function(x, ... ) {\n  \n  .Defunct(\n    new = \"ggplot_na_distribution2\",\n    msg = \"\n    ggplot_na_intervals was renamed to ggplot_na_distribution2.\n    Use this function instead.\n    \n    Functionality stays the same. \"\n  )\n  \n}\n#--------------------------------------------------------------------------------------#\n\n\n\n\n# plotNA.distributionBar()\n# replaced by ggplot_na_intervals\n#--------------------------------------------------------------------------------------#\n#' @title Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution2}} instead.\n#' @description plotNA.distributionBar was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution2}}.\n#' The new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable, \n#' because it is based on ggplot2. If you absolutely want to use the old function, \n#' you need to download an older package version. Versions 3.0 and below still have the old functions.\n#' @keywords internal\n#' @export\n\nplotNA.distributionBar <- function(x, ... ) {\n  \n  .Defunct(\n    new = \"ggplot_na_distribution2\",\n    msg = \"\n    plotNA.distributionBar was replaced by ggplot_na_distribution2.\n    Use this function instead.\n    \n    The plot itself is the same, but looks better now and is better adjustable, because it is based on ggplot2.\n    \n    If you absolutely want to use the old function, you need to manually download an older package version.\n    (Versions 3.0 and below still have the old functions)\"\n  )\n  \n}\n#--------------------------------------------------------------------------------------#\n\n\n\n\n# plotNA.gapsize()\n# replaced by ggplot_na_gapsize\n#--------------------------------------------------------------------------------------#\n#' @title Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_gapsize}} instead.\n#' @description plotNA.gapsize was replaced by \\code{\\link[imputeTS]{ggplot_na_gapsize}}.\n#' The new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable, \n#' because it is based on ggplot2. If you absolutely want to use the old function, \n#' you need to download an older package version. Versions 3.0 and below still have the old functions.\n#' @keywords internal\n#' @export\n\nplotNA.gapsize <- function(x, ... ) {\n  \n  .Defunct(\n    new = \"ggplot_na_gapsize\",\n    msg = \"\n    plotNA.gapsize was replaced by ggplot_na_gapsize.\n    Use this function instead.\n    \n    The plot itself is the same, but looks better now and is better adjustable, because it is based on ggplot2.\n    \n    If you absolutely want to use the old function, you need to manually download an older package version.\n    (Versions 3.0 and below still have the old functions)\"\n  )\n  \n}\n#--------------------------------------------------------------------------------------#\n\n\n\n# plotNA.imputations()\n# replaced by ggplot_na_imputations\n#--------------------------------------------------------------------------------------#\n#' @title Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_imputations}} instead.\n#' @description plotNA.imputations was replaced by \\code{\\link[imputeTS]{ggplot_na_imputations}}.\n#' The new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable, \n#' because it is based on ggplot2. If you absolutely want to use the old function, \n#' you need to download an older package version. Versions 3.0 and below still have the old functions.\n#' @keywords internal\n#' @export\n\nplotNA.imputations <- function(x, ... ) {\n  \n  .Defunct(\n    new = \"ggplot_na_imputations\",\n    msg = \"\n    plotNA.imputations was replaced by ggplot_na_imputations.\n    Use this function instead.\n    \n    The plot itself is the same, but looks better now and is better adjustable, because it is based on ggplot2.\n    \n    If you absolutely want to use the old function, you need to manually download an older package version.\n    (Versions 3.0 and below still have the old functions)\"\n  )\n  \n}\n#--------------------------------------------------------------------------------------#"
  },
  {
    "path": "R/ggplot_na_distribution.R",
    "content": "#' @title Line Plot to Visualize the Distribution of Missing Values\n#'\n#' @description Visualize the distribution of missing values within a time series.\n#'\n#' @param x Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n#' (\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\n#' parameter - all other parameters are only needed for adjusting the plot appearance.\n#'\n#' @param x_axis_labels For adding specific x-axis labels. Takes a vector of\n#'  \\code{\\link[base]{Date}} or \\code{\\link[base]{POSIXct}} objects\n#' as an input (needs the same length as x) . The Default (NULL) uses the\n#' observation numbers as  x-axis tick labels.\n#'\n#' @param color_points Color for the Symbols/Points.\n#'\n#' @param color_lines Color for the Lines.\n#'\n#' @param color_missing Color used for highlighting the time spans with NA values.\n#'\n#' @param color_missing_border Color used as border for time spans with NA values.\n#'\n#' @param alpha_missing Alpha (transparency) value used for color_missing.\n#'\n#' @param title Title of the Plot (NULL for deactivating title).\n#'\n#' @param subtitle Subtitle of the Plot (NULL for deactivating subtitle).\n#'\n#' @param xlab Label for x-Axis.\n#'\n#' @param ylab Label for y-Axis.\n#'\n#' @param shape_points Symbol to use for the Observations/Points. See\n#' https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.\n#'\n#' @param size_points Size of Symbols/Points.\n#'\n#' @param theme Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n#' (\\code{\\link[ggplot2]{theme_linedraw})}\n#'\n#' @details This function visualizes the distribution of missing values within\n#'  a time series. If a value is NA, the background is colored differently.\n#'  This gives a good overview of where most missing values occur.\n#'\n#' The only really needed parameter for this function is x (the univariate\n#' time series that shall be visualized). All other parameters are solely\n#' for altering the appearance of the plot.\n#'\n#' As long as the input is univariate and numeric the function also takes\n#' data.frame, tibble, tsibble, zoo, xts as an input.\n#'\n#' The plot can be adjusted to your needs via the function parameters.\n#' Additionally, for more complex adjustments, the output can also be\n#' adjusted via ggplot2 syntax. This is possible, since the output\n#' of the function is a ggplot2 object. Also take a look at the Examples\n#' to see how adjustments are made.\n#'\n#' For very long time series it might happen, that the plot gets too crowded\n#' and overplotting issues occur. In this case the\n#' \\code{\\link[imputeTS]{ggplot_na_distribution2}} plotting function can provide\n#' a more condensed overview.\n#'\n#'\n#' @author Steffen Moritz, Sebastian Gatscha\n#'\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_distribution2}},\n#' \\code{\\link[imputeTS]{ggplot_na_gapsize}},\n#' \\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n#' \\code{\\link[imputeTS]{ggplot_na_imputations}}\n#'\n#' @examples\n#' # Example 1: Visualize the missing values in x\n#' x <- stats::ts(c(1:11, 4:9, NA, NA, NA, 11:15, 7:15, 15:6, NA, NA, 2:5, 3:7))\n#' ggplot_na_distribution(x)\n#'\n#' # Example 2: Visualize the missing values in tsAirgap time series\n#' ggplot_na_distribution(tsAirgap)\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' x <- ts(c(1:11, 4:9, NA, NA, NA, 11:15, 7:15, 15:6, NA, NA, 2:5, 3:7))\n#' x %>% ggplot_na_distribution()\n#'\n#' # Example 4: Visualize NAs in tsAirgap - different color for points\n#' # Plot adjustments via ggplot_na_distribution function parameters\n#' ggplot_na_distribution(tsAirgap, color_points = \"grey\")\n#'\n#' # Example 5: Visualize NAs in tsAirgap - different theme\n#' # Plot adjustments via ggplot_na_distribution function parameters\n#' ggplot_na_distribution(tsAirgap, theme = ggplot2::theme_classic())\n#'\n#' # Example 6: Visualize NAs in tsAirgap - title, subtitle in center\n#' # Plot adjustments via ggplot2 syntax\n#' ggplot_na_distribution(tsAirgap) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n#'   ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 7: Visualize NAs in tsAirgap - title in center, no subtitle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_distribution(tsAirgap, subtitle = NULL) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 8: Visualize NAs in tsAirgap - x-axis texts with angle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_distribution(tsAirgap, color_points = \"grey\") +\n#'   ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n#'   \n#' @importFrom ggplot2 theme_linedraw ggplot geom_point aes geom_line geom_bar ggtitle\n#' xlab ylab theme element_text theme_classic\n#'\n#' @importFrom stats ts\n#'\n#' @importFrom magrittr %>%\n#'\n#' @export\n\nggplot_na_distribution <- function(x,\n                                   x_axis_labels = NULL,\n                                   color_points = \"steelblue\",\n                                   color_lines = \"steelblue2\",\n                                   color_missing = \"indianred\",\n                                   color_missing_border = \"indianred\",\n                                   alpha_missing = 0.5,\n                                   title = \"Distribution of Missing Values\",\n                                   subtitle = \"Time Series with highlighted missing regions\",\n                                   xlab = \"Time\",\n                                   ylab = \"Value\",\n                                   shape_points = 20,\n                                   size_points = 2.5,\n                                   theme = ggplot2::theme_linedraw()) {\n  data <- x\n\n\n  ##\n  ## 1. Input Check and Transformation\n  ##\n\n  # 1.1 special handling data types\n  if (any(class(data) == \"tbl_ts\")) {\n    data <- as.vector(as.data.frame(data)[, 2])\n  }\n  else if (any(class(data) == \"tbl\")) {\n    data <- as.vector(as.data.frame(data)[, 1])\n  }\n  \n  # 1.2 Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    stop(\"x is not univariate. The function only works with univariate\n    input for x. For data types with multiple variables/columns only input\n    the column you want to plot as parameter x.\")\n  }\n\n\n  # 1.3 Checks and corrections for wrong data dimension\n\n  # Altering multivariate objects with 1 column (which are essentially\n  # univariate) to be dim = NULL\n  if (!is.null(dim(data)[2])) {\n    data <- data[, 1]\n  }\n  \n  \n  # 1.4 Input as vector\n  data <- as.vector(data)\n  \n  \n  # 1.5 Check if input is numeric\n  if (!is.numeric(data)) {\n    stop(\"Input x is not numeric\")\n  }\n  \n  \n  # 1.6 Check preconditions about amount of NAs\n  \n  # exclude NA only inputs\n  missindx <- is.na(data)\n  if (all(missindx)) {\n    stop(\"Input data consists only of NAs. At least one non-NA numeric value is needed\n    for creating a meaningful ggplot_na_distribution plot)\")\n  }\n  \n  \n\n  ##\n  ## End Input Check and Transformation\n  ##\n\n\n  \n\n  ##\n  ## 2. Preparations\n  ##\n\n  # 2.1 Create required data\n\n  # Get NA positions\n  id_na <- which(is.na(data))\n\n  \n  # 2.2 Create dataframe for ggplot2\n\n  # Define x-axis label data\n  # if Date or POSIXct given for x_axis_labels time information can be plotted\n  if (any(class(x_axis_labels) == \"Date\")) {\n    time <- x_axis_labels\n    width_na_bar <- as.numeric(time[2] - time[1]) * 0.9\n  }\n  else if (any(class(x_axis_labels) == \"POSIXct\")) {\n    time <- x_axis_labels\n    width_na_bar <- as.numeric(difftime(time[2], time[1], units = \"secs\")) * 0.9\n  }\n  else if (is.null(x_axis_labels)) {\n    time <- seq_along(data)\n    width_na_bar <- as.numeric(time[2] - time[1]) * 0.9\n  }\n  else {\n    stop(\"Input for x_axis_labels is not in a supported format, must a\n           vector of Date or a POSIXct objects with the same length as x\")\n  }\n\n  # Create the remainder of the data.frame for ggplot2\n  value <- data\n  df <- data.frame(time, value)\n\n  ##\n  ## End Preparations\n  ##\n\n\n  ##\n  ## 3. Create the ggplot2 plot\n  ##\n\n  # Create the plot\n  gg <- ggplot2::ggplot() +\n\n    # Adding the Line +  Parameters\n    ggplot2::geom_line(\n      data = df, na.rm = T,\n      ggplot2::aes(x = time, y = value), col = color_lines\n    ) +\n\n    # Adding the Points + Parameters\n    ggplot2::geom_point(\n      data = df, na.rm = TRUE,\n      ggplot2::aes(x = time, y = value), shape = shape_points,\n      col = color_points, size = size_points\n    ) +\n\n    # Adding additional modifications like title, subtitle, theme,...\n    ggplot2::ggtitle(label = title, subtitle = subtitle) +\n    ggplot2::xlab(xlab) +\n    ggplot2::ylab(ylab) +\n    theme\n\n  # Add the red background bars for missing data areas\n\n  if (length(id_na) > 0) {\n    # Red Bars only if missing data in time series\n    na_val <- max(df$value*1.05, na.rm = TRUE)\n    gg <- gg +\n      ggplot2::geom_bar(\n        data = df[is.na(df$value), ], stat = \"identity\",\n        ggplot2::aes(x = time, y = na_val),\n        col = color_missing_border, fill = color_missing,\n        alpha = alpha_missing, width = width_na_bar\n      )\n  }\n\n  ##\n  ##  End creating the ggplot2 plot\n  ##\n\n\n  return(gg)\n}\n"
  },
  {
    "path": "R/ggplot_na_distribution2.R",
    "content": "#' @title Stacked Bar Plot to Visualize Missing Values per Time Interval\n#'\n#' @description Visualization of missing values in barplot form.\n#' Especially useful when looking at specific intervals and for\n#' time series with a lot of observations.\n#'\n#' @param x Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n#' (\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\n#' parameter - all other parameters are only needed for adjusting the plot appearance.\n#'\n#' @param number_intervals Defines the number of bins to be created. Default\n#' number of intervals (denoted by NULL) is calculated by \\code{\\link[grDevices]{nclass.Sturges}}\n#' using Sturges' formula. If the interval_size parameter is set to a value\n#' different to NULL this parameter is ignored.\n#'\n#' @param interval_size Defines how many observations should be in one bin/interval.\n#' The required number of overall bins is afterwards calculated automatically.\n#' If used this parameter overwrites the number_intervals parameter.\n#' For a very long time series be sure to make the interval_size not extremely\n#' small, otherwise because of  overplotting issues nothing can be seen until\n#' you also increase the plot width.\n#'\n#' @param measure Whether the NA / non-NA ratio should be given as\n#' percent or absolute numbers.\n#'\n#' \\itemize{\n#'    \\item{\"percent\" - for percentages}\n#'\n#'    \\item{\"count\" - for absolute numbers of NAs}\n#'    }\n#'\n#' @param color_missing Color for the amount of missing values.\n#'\n#' @param color_existing Color for the amount of existing values.\n#'\n#' @param alpha_missing Alpha (transparency) value for the missing values.\n#'\n#' @param alpha_existing Alpha (transparency) value for the existing values.\n#'\n#' @param title Title of the Plot (NULL for deactivating title).\n#'\n#' @param subtitle Subtitle of the Plot (NULL for deactivating subtitle).\n#'\n#' @param xlab Label for x-Axis. Automatically set to the current interval size, if\n#' no custom text is chosen.\n#'\n#' @param ylab Label for y-Axis. As default (NULL), the axis is automatically set\n#'  to either 'Percent' or 'Count' dependent on the settings of parameter \\code{measure}.\n#'\n#' @param color_border Color for the small borders between the intervals/bins.\n#' Default is 'white'.\n#'\n#' @param theme Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n#' (\\code{\\link[ggplot2]{theme_linedraw})}\n#'\n#' @details This function visualizes the distribution of missing values within\n#' a time series. In comparison to the \\code{\\link[imputeTS]{ggplot_na_distribution}}\n#' function this is not done by plotting each observation of the time series\n#' separately. Instead observations for time intervals are represented as\n#' intervals/bins of multiple values. For these intervals information about\n#' the amount of missing values are shown. This has the advantage, that also\n#' for large time series a plot which is easy to overview can be created.\n#'\n#' The only really needed parameter for this function is x (the univariate\n#' time series that shall be visualized). All other parameters are solely\n#' for altering the appearance of the plot.\n#'\n#' As long as the input is univariate and numeric the function also takes\n#' data.frame, tibble, tsibble, zoo, xts as an input.\n#'\n#' The plot can be adjusted to your needs via the function parameters.\n#' Additionally, for more complex adjustments, the output can also be\n#' adjusted via ggplot2 syntax. This is possible, since the output\n#' of the function is a ggplot2 object. Also take a look at the Examples\n#' to see how adjustments are made.\n#'\n#' @author Steffen Moritz, Sebastian Gatscha\n#'\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_distribution}},\n#'  \\code{\\link[imputeTS]{ggplot_na_gapsize}},\n#'  \\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n#'  \\code{\\link[imputeTS]{ggplot_na_imputations}}\n#'\n#' @examples\n#' # Example 1: Visualize the missing values in tsNH4 time series as percentages\n#' ggplot_na_distribution2(tsNH4)\n#' \n#' # Example 2: Visualize the missing values in tsNH4 time series as counts \n#' ggplot_na_distribution2(tsNH4, measure = \"count\")\n#' \n#' # Example 3: Visualize the missing values in tsHeating time series\n#' ggplot_na_distribution2(tsHeating)\n#'\n#' # Example 4: Same as example 1, just written with pipe operator\n#' tsNH4 %>% ggplot_na_distribution2()\n#' \n#' # Example 5: Visualize NAs in tsNH4 - exactly 8 intervals\n#' ggplot_na_distribution2(tsNH4, number_intervals = 8)\n#' \n#' # Example 6: Visualize NAs in tsNH4 - 300 observations per interval\n#' ggplot_na_distribution2(tsNH4, interval_size = 300)\n#' \n#' # Example 7: Visualize NAs in tsAirgap - different color for NAs\n#' # Plot adjustments via ggplot_na_distribution2 function parameters\n#' ggplot_na_distribution2(tsAirgap, color_missing = \"pink\")\n#'\n#' # Example 8: Visualize NAs in tsNH4 - different theme\n#' # Plot adjustments via ggplot_na_distribution2 function parameters\n#' ggplot_na_distribution2(tsNH4, theme = ggplot2::theme_classic())\n#'\n#' # Example 9: Visualize NAs in tsAirgap - title, subtitle in center\n#' # Plot adjustments via ggplot2 syntax\n#' ggplot_na_distribution2(tsAirgap) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n#'   ggplot2::theme(plot.subtitle = ggtext::element_markdown(hjust = 0.5))\n#'\n#' # Example 10: Visualize NAs in tsAirgap - title in center, no subtitle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_distribution2(tsAirgap, subtitle = NULL) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 11: Visualize NAs in tsAirgap - x-axis texts with angle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_distribution2(tsAirgap, color_missing = \"grey\") +\n#'   ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n#'   \n#' @importFrom magrittr %>%\n#'\n#' @importFrom grDevices nclass.Sturges\n#'\n#' @importFrom ggplot2 theme_linedraw alpha ggplot aes scale_fill_manual\n#' theme element_blank scale_x_continuous scale_y_continuous\n#' labs xlab ylab stat_bin after_stat theme_classic\n#'\n#' @importFrom ggtext element_markdown\n#'\n#' @export\nggplot_na_distribution2 <- function(x,\n                                number_intervals = NULL,\n                                interval_size = NULL,\n                                measure = \"percent\",\n                                color_missing = \"indianred2\",\n                                color_existing = \"steelblue\",\n                                alpha_missing = 0.8,\n                                alpha_existing = 0.3,\n                                title = \"Missing Values per Interval\",\n                                subtitle = \"Amount of NA and non-NA for successive intervals\",\n                                xlab = \"Time Lapse (Interval Size: XX)\",\n                                ylab = NULL,\n                                color_border = \"white\",\n                                theme = ggplot2::theme_linedraw()) {\n  data <- x\n\n\n\n  ##\n  ## 1. Input Check and Transformation\n  ##\n\n  # 1.1 special handling data types\n  if (any(class(data) == \"tbl_ts\")) {\n    data <- as.vector(as.data.frame(data)[, 2])\n  }\n  else if (any(class(data) == \"tbl\")) {\n    data <- as.vector(as.data.frame(data)[, 1])\n  }\n\n  # 1.2 Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    stop(\"x is not univariate. The function only works with univariate\n    input for x. For data types with multiple variables/columns only input\n    the column you want to plot as parameter x.\")\n  }\n\n\n  # 1.3 Checks and corrections for wrong data dimension\n\n  # Altering multivariate objects with 1 column (which are essentially\n  # univariate) to be dim = NULL\n  if (!is.null(dim(data)[2])) {\n    data <- data[, 1]\n  }\n\n\n  # 1.4 Input as vector\n  data <- as.vector(data)\n\n\n  # 1.5 Check if input is numeric\n  if (!is.numeric(data)) {\n    stop(\"Input x is not numeric\")\n  }\n\n\n  # 1.6 Check preconditions about amount of NAs\n\n  # exclude NA only inputs\n  missindx <- is.na(data)\n  if (all(missindx)) {\n    stop(\"Input data consists only of NAs. At least one non-NA numeric value is needed\n    for creating a meaningful ggplot_na_distribution plot)\")\n  }\n\n\n  ##\n  ## End Input Check and Transformation\n  ##\n\n\n\n  ##\n  ## 2. Preparations\n  ##\n\n  # 2.1 Calculation default number of intervals\n  if (is.null(number_intervals)) {\n    number_intervals <- grDevices::nclass.Sturges(data)\n  }\n\n\n  # 2.2 Calculation break points\n\n  if (!is.null(interval_size)) {\n    breaks <- seq(from = 0, to = length(data) - 1, by = interval_size)\n    breaks <- c(breaks, length(data))\n  }\n  else {\n    breaks <- seq(from = 0, to = length(data) - 1, by = floor(length(data) / number_intervals))\n    breaks <- c(breaks, length(data))\n  }\n  binwidth <- breaks[2]\n\n\n  # 2.3 Process parameter settings\n\n  # Add alpha values to colors\n  color_missing <- ggplot2::alpha(color_missing, alpha_missing)\n  color_existing <- ggplot2::alpha(color_existing, alpha_existing)\n\n  # Set subtitle to default\n  # (needed because .Rd usage section gives error when using defaults > 90 chars )\n  if ( (!is.null(subtitle)) && (subtitle == \"Amount of NA and non-NA for successive intervals\")) {\n    subtitle <- paste0(\"Amount of <b style='color:\", color_missing, \";' >NA</b>\n                and  <b style='color:\", color_existing, \"' >non-NA</b>\n                for successive intervals\")\n  }\n\n  # Set ylab according to choosen measure\n  if (is.null(ylab)) {\n    ifelse(measure == \"percent\", ylab <- \"Percent\", ylab <- \"Count\")\n  }\n\n  # Set xlab according to choosen parameters\n  if (xlab == \"Time Lapse (Interval Size: XX)\") {\n    xlab <- paste(\"Time Lapse (Interval Size:\", binwidth, \")\")\n  }\n\n\n  # 2.4 Create dataframe for ggplot2\n\n  index <- seq_along(data)\n  miss <- as.factor(is.na(data))\n  df <- data.frame(index, miss)\n\n  ##\n  ## End Preparations\n  ##\n\n\n  ##\n  ## 3. Create the ggplot2 plot\n  ##\n\n  # Create the ggplot2 plot\n  gg <- ggplot2::ggplot(df, ggplot2::aes(index, fill = miss)) +\n    ggplot2::scale_fill_manual(\n      values = c(color_existing, color_missing),\n      labels = c(\"NAs\", \"non-NAs\")\n    ) +\n    theme +\n    ggplot2::theme(\n      legend.position = \"none\",\n      legend.title = ggplot2::element_blank(),\n      plot.subtitle = ggtext::element_markdown(),\n      panel.grid.major = ggplot2::element_blank(),\n      panel.grid.minor.x = ggplot2::element_blank(),\n    ) +\n    ggplot2::scale_x_continuous(expand = c(0, 0)) +\n    ggplot2::labs(title = title, subtitle = subtitle) +\n    ggplot2::xlab(xlab) +\n    ggplot2::ylab(ylab)\n\n  count <- NULL\n  if (measure == \"percent\") {\n    gg <- gg + ggplot2::stat_bin(ggplot2::aes(y = ggplot2::after_stat(count / binwidth)),\n      col = color_border, breaks = breaks, closed = \"right\"\n    ) + \n    ggplot2::scale_y_continuous(expand = c(0, 0), labels = function(x) paste0(x*100, \"%\"))\n  }\n  else {\n    gg <- gg + ggplot2::stat_bin(ggplot2::aes(y = ggplot2::after_stat(count)),\n      col = color_border, breaks = breaks, closed = \"right\"\n    ) +  \n    ggplot2::scale_y_continuous(expand = c(0, 0))\n  }\n\n  return(gg)\n}\n"
  },
  {
    "path": "R/ggplot_na_gapsize.R",
    "content": "#' @title Bar Plot to Visualize Occurrences of Different NA Gap Sizes\n#'\n#' @description Visualize the Number of Occurrences for existing NA Gap Sizes\n#' (NAs in a row) in a Time Series\n#'\n#' @param x Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n#' (\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\n#' parameter - all other parameters are only needed for adjusting the plot appearance.\n#'\n#' @param limit Specifies how many of the most common gap sizes are shown in\n#' the plot.Default is 10. So only the 10 most often occurring gapsizes will\n#' be shown. If more or all present gap sizes should be displayed, the limit needs\n#' to be increased. Since this might add a lot of additional data, having\n#' parameter  \\code{orientation} set to 'horizontal' avoids overlaps in the axis\n#' labels.\n#'\n#' @param include_total When set to TRUE the total NA count for a gapsize is\n#' included in the plot (total = number occurrence x gap size).\n#' E.g. if a gapsize of 3 occurs 10 times, this means this gap size makes\n#' up for 30 NAs in total. This can be a good indicator of the\n#' overall impact of a gapsize.\n#'\n#' @param ranked_by Should the results be sorted according to the number of\n#' occurrence or total resulting NAs for a gapsize. Total resulting NAs\n#' are calculated by (total = number occurrence x gap size).\n#' \\itemize{\n#'    \\item{\"occurrence\" - Sorting by 'number of occurrence' of a gap size}\n#'\n#'    \\item{\"total\" - Sorting by 'total resulting NAs' of a gap size}\n#'    }\n#'\n#'    The default setting is \"occurrence\".\n#'\n#' @param color_occurrence Defines the Color for the Bars of\n#' 'number of occurrence'.\n#'\n#' @param color_total Defines the color for the bars of\n#' 'total resulting NAs'.\n#'\n#' @param color_border Defines the color for the border of the bars.\n#' \n#' @param alpha_bars Alpha (transparency) value used for filling the bars.\n#' \n#' @param title Title of the Plot.\n#'\n#' @param subtitle Subtitle of the Plot.\n#'\n#' @param xlab Label for x-Axis.\n#'\n#' @param ylab Label for y-Axis.\n#'\n#' @param legend If TRUE a legend is added at the bottom.\n#'\n#' @param orientation Can be either 'vertical' or 'horizontal'. Defines\n#' if the bars are plotted vertically or horizontally. For large amounts\n#' of different gap sizes horizontal illustration is favorable (also see\n#' parameter \\code{limit}).\n#'\n#' @param label_occurrence Defines the label assigned to 'number of occurrence'\n#' in the legend.\n#' @param label_total Defines the label assigned to 'total resulting NAs'\n#' in the legend.\n#'\n#' @param theme Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n#' (\\code{\\link[ggplot2]{theme_linedraw})}\n#'\n#' @author Steffen Moritz, Sebastian Gatscha\n#'\n#' @return The output is a \\code{\\link[ggplot2]{ggplot2}} object that can be\n#' further adjusted by using the ggplot syntax\n#'\n#' @details This plotting function can be used to visualize the length of\n#' the NA gaps (NAs in a row) in a time series. It shows a ranking of which\n#' gap sizes occur most often. This ranking can be ordered by the number\n#' occurrence of the gap sizes or by total resulting NAs for this gap size\n#' (occurrence * gap length). A NA-gap of 3 occurring 10 times means 30 total\n#' resulting NAs.\n#'\n#' A resulting plot can for example be described like this:\n#' a 2 NA-gap (2 NAs in a row) occurred  27 times,\n#' a 9 NA-gap (9 NAs in a row) occurred  11 times,\n#' a 27 NA-gap (27 NAs in a row) occurred  1 times, ...\n#'\n#' The only really needed parameter for this function is x (the univariate\n#' time series with NAs that shall be visualized). All other parameters\n#' are solely for altering the appearance of the plot.\n#'\n#' As long as the input is univariate and numeric, the function also takes\n#' data.frame, tibble, tsibble, zoo, xts as an input.\n#'\n#' The plot can be adjusted to your needs via the function parameters.\n#' Additionally, for more complex adjustments, the output can also be\n#' adjusted via ggplot2 syntax. This is possible, since the output\n#' of the function is a ggplot2 object. Also take a look at the Examples\n#' to see how adjustments are made.\n#'\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n#'   \\code{\\link[imputeTS]{ggplot_na_distribution}},\n#'   \\code{\\link[imputeTS]{ggplot_na_distribution2}},\n#'   \\code{\\link[imputeTS]{ggplot_na_imputations}}\n#'\n#' @examples\n#' # Example 1: Visualize the top gap sizes in tsNH4 (top 10 by default)\n#' ggplot_na_gapsize(tsNH4)\n#'\n#' # Example 2: Visualize the top gap sizes in tsAirgap - horizontal bars\n#' ggplot_na_gapsize(tsAirgap, orientation = \"vertical\")\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' tsNH4 %>% ggplot_na_gapsize()\n#'\n#' # Example 4: Visualize the top 20 gap sizes in tsNH4\n#' ggplot_na_gapsize(tsNH4, limit = 20)\n#'\n#' # Example 5: Visualize top gap sizes in tsNH4 without showing total NAs\n#' ggplot_na_gapsize(tsNH4, limit = 20, include_total = FALSE)\n#'\n#' # Example 6: Visualize top gap sizes in tsNH4 but ordered by total NAs\n#' # (total = occurrence * gap length)\n#' ggplot_na_gapsize(tsNH4, limit = 20, ranked_by = \"total\")\n#'\n#' # Example 7: Visualize top gap sizes in tsNH4 - different theme\n#' # Plot adjustments via ggplot_na_gapsize function parameters\n#' ggplot_na_gapsize(tsNH4, theme = ggplot2::theme_classic())\n#'\n#' # Example 8: Visualize top gap sizes in tsNH4 - title, subtitle in center\n#' # Plot adjustments via ggplot2 syntax\n#' ggplot_na_gapsize(tsNH4) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n#'   ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 9: Visualize top gap sizes in tsNH4 - title in center, no subtitle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_gapsize(tsNH4, subtitle = NULL) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 10: Top gap sizes in tsNH4 - legend on the right and color change\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_gapsize(tsNH4, color_total = \"grey\") +\n#'   ggplot2::theme(legend.position = \"right\")\n#' @importFrom magrittr %>%\n#'\n#' @importFrom ggplot2 theme_linedraw ggplot geom_bar position_dodge aes scale_x_discrete\n#' scale_fill_manual ggtitle xlab ylab theme element_text element_blank\n#' coord_flip theme_classic\n#'\n#' @export\nggplot_na_gapsize <- function(x,\n                              limit = 10,\n                              include_total = TRUE,\n                              ranked_by = \"occurrence\",\n                              color_occurrence = \"indianred\",\n                              color_total = \"steelblue\",\n                              color_border = \"black\",\n                              alpha_bars = 1,\n                              title = \"Occurrence of gap sizes\",\n                              subtitle = \"Gap sizes (NAs in a row) ordered by most common\",\n                              xlab = NULL,\n                              ylab = \"Number occurrence\",\n                              legend = TRUE,\n                              orientation = \"horizontal\",\n                              label_occurrence = \"Number occurrence gapsize\",\n                              label_total = \"Resulting NAs for gapsize\",\n                              theme = ggplot2::theme_linedraw()) {\n  data <- x\n\n\n\n  ##\n  ## 1. Input Check and Transformation\n  ##\n\n  # 1.1 special handling data types\n  if (any(class(data) == \"tbl_ts\")) {\n    data <- as.vector(as.data.frame(data)[, 2])\n  }\n  else if (any(class(data) == \"tbl\")) {\n    data <- as.vector(as.data.frame(data)[, 1])\n  }\n\n  # 1.2 Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    stop(\"x is not univariate. The function only works with univariate\n    input for x. For data types with multiple variables/columns only input\n    the column you want to plot as parameter x.\")\n  }\n\n\n  # 1.3 Checks and corrections for wrong data dimension\n\n  # Altering multivariate objects with 1 column (which are essentially\n  # univariate) to be dim = NULL\n  if (!is.null(dim(data)[2])) {\n    data <- data[, 1]\n  }\n\n  \n  \n  # 1.4 Input as vector\n  data <- as.vector(data)\n  \n  \n  \n  # 1.5 Check if input is numeric\n  if (!is.numeric(data)) {\n    stop(\"Input x is not numeric\")\n  }\n  \n  \n  # 1.6 Check preconditions about amount of NAs\n  \n  # exclude NA only inputs\n  missindx <- is.na(data)\n  if (all(missindx)) {\n    stop(\"Input data consists only of NAs. At least one non-NA numeric value is needed\n    for creating a meaningful ggplot_na_gapsize plot)\")\n  }\n  \n  # exclude inputs without NAs\n  if (!anyNA(data)) {\n    stop(\"Input data contains no NAs. At least one missing value is needed \n         to create a meaningful ggplot_na_gapsize plot)\")\n  }\n  \n \n\n  ##\n  ## End Input Check and Transformation\n  ##\n\n  \n\n  ##\n  ## 2. Preparations\n  ##\n\n\n  # 2.1 Create required data\n  \n\n  # Calculation consecutive NA information\n  rle_na <- base::rle(is.na(data))\n  vec <- rle_na$lengths[rle_na$values]\n  occurrence_bar <- table(vec)\n  gaps_vec <- as.integer(names(occurrence_bar))\n  totals_bar <- occurrence_bar * gaps_vec\n  labels1 <- paste0(gaps_vec, \" NA-gap\")\n\n\n\n  # 2.2 Adjust to parameter selection by user\n\n  # Sorting for ranked_by param\n  if (ranked_by == \"occurrence\") {\n    # sort according to occurrence of gapsizes\n    fooind <- order(occurrence_bar)\n    occurrence_bar <- occurrence_bar[fooind]\n    totals_bar <- totals_bar[fooind]\n    labels1 <- labels1[fooind]\n  } else if (ranked_by == \"total\") {\n    # sort accoding to total NAs\n    fooind <- order(totals_bar)\n    occurrence_bar <- occurrence_bar[fooind]\n    totals_bar <- totals_bar[fooind]\n    labels1 <- labels1[fooind]\n  }\n  else {\n    stop(\"Wrong input for parameter ranked_by. Input must be either 'occurrence' or 'total'.\n    Call ?ggplot_na_gapsize to view the documentation.\")\n  }\n\n  # Adjust to show only a limited amount of bars for limit param\n  if (length(occurrence_bar) > limit) {\n    occurrence_bar <- occurrence_bar[(length(occurrence_bar) - limit + 1):length(occurrence_bar)]\n    totals_bar <- totals_bar[(length(totals_bar) - limit + 1):length(totals_bar)]\n    labels1 <- labels1[(length(labels1) - limit + 1):length(labels1)]\n  }\n\n\n\n  # 2.3 Create dataframe for ggplot2\n\n  # data.frame for ggplot\n  id <- seq_along(occurrence_bar)\n  val <- c(occurrence_bar, totals_bar)\n  label <- c(\n    rep(\"occurrence_bar\", length(occurrence_bar)),\n    rep(\"totals_bar\", length(totals_bar))\n  )\n  df <- data.frame(id, val, label)\n\n  # Only number of occurrences bar\n  if (include_total == FALSE) {\n    df <- subset(df, label == \"occurrence_bar\")\n  }\n\n  ##\n  ## End Preparations\n  ##\n\n\n\n  ##\n  ## 3. Create the ggplot2 plot\n  ##\n\n\n  # Create ggplot\n  gg <- ggplot2::ggplot(data = df) +\n    ggplot2::geom_bar(aes(x = id, y = val, fill = label),\n      color = color_border,\n      width= 0.6,\n      alpha = alpha_bars,\n      stat = \"identity\", position = position_dodge(width = 0.7)\n    ) +\n    ggplot2::scale_x_discrete(\n      labels = labels1,\n      limits = labels1\n    ) +\n    ggplot2::scale_fill_manual(\n      values = c(color_occurrence, color_total),\n      labels = c(label_occurrence, label_total),\n    ) +\n    ggplot2::ggtitle(title, subtitle = subtitle) +\n    ggplot2::xlab(xlab) +\n    ggplot2::ylab(ylab) +\n    theme +\n    ggplot2::theme(\n      legend.position = \"bottom\",\n      axis.text.x = ggplot2::element_text(angle = 30, hjust = 1),\n      legend.title = ggplot2::element_blank()\n    )\n\n  # For flipping from vertical to horizontal bars\n  if (orientation == \"horizontal\") {\n    gg <- gg + ggplot2::coord_flip()\n  }\n\n  # Removing legend\n  if (!legend) {\n    gg <- gg +\n      ggplot2::theme(\n        legend.position = \"none\",\n      )\n  }\n\n\n  ##\n  ##  End creating the ggplot2 plot\n  ##\n\n\n  return(gg)\n}\n"
  },
  {
    "path": "R/ggplot_na_gapsize2.R",
    "content": "#' @title Bubble Plot to Visualize Total NA Count of NA gap sizes\n#'\n#' @description Visualize the total NA count (gap size * occurrence) for\n#' the existing gaps sizes (NAs in a row).\n#' \n#' @param x Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n#' (\\code{\\link[stats]{ts}}) object containing NAs. This is the only\n#' mandatory parameter - all other parameters are only needed for adjusting\n#' the plot appearance.\n#'\n#' @param colors_bubbles Choose a color gradient that encodes lower to\n#' higher total NA counts.\n#' Color codes can be given as vector. Using color palettes from  colorspace,\n#' grDevices, RColorBrewer or other packages is useful here.\n#' E.g. grDevices::heat.colors(10) would be a possible input.\n#'\n#' @param color_border Color for the border of the bubbles.\n#'\n#' @param alpha_bubbles Alpha (transparency) value used for filling the bubbles.\n#'\n#' @param labels_bubbles Should labels be added to the individual bubbles inside\n#' the plot.\n#' For many datasets there will be overplotting issues once labels are added.\n#' In these cases using the min_gapsize, min_totals or min_occurrence options\n#' might be useful to only display the most relevant gap sizes.\n#'\n#' You can choose between these labels to be added:\n#' \\itemize{\n#'    \\item{\"none\" - No label gets added to the bubbles}\n#'    (default choice)\n#'\n#'    \\item{\"gap\" - Adds a label displaying the gap size belonging to the\n#'    respective bubble}\n#'\n#'    \\item{\"total\" - Adds a label displaying the total NA count for the\n#'    respective bubble}\n#'\n#'    \\item{\"gap-occurrence\" - Adds a label displaying the respective\n#'    gap size and number of its occurrence}\n#'    }\n#'\n#'    The default setting is \"none\".\n#'\n#' @param size_bubbles Allows to scale the size of the bubbles.\n#' Some experimenting with this parameter might be needed to get\n#' a good visualization for your specific dataset.\n#'\n#' @param min_totals Only print bubbles for gap sizes that account\n#' for at least min_totals NAs in the time series.\n#'\n#' @param min_occurrence Only print bubbles for gap sizes that occur at least\n#' min_occurrence times in the time series.\n#'\n#' @param min_gapsize Only show gap sizes larger than min_gapsize. Together with\n#' max_gapsize enables zooming into in certain regions of interest.\n#'\n#' @param max_gapsize Only show gapsizes smaller than max_gapsize. Together with\n#' min_gapsize enables zooming into in certain regions of interest.\n#'\n#' @param title Title of the Plot.\n#'\n#' @param subtitle Subtitle of the Plot.\n#'\n#' @param xlab Label for x-Axis.\n#'\n#' @param ylab Label for y-Axis.\n#'\n#' @param legend If TRUE a legend is added on the right side\n#'\n#' @param legend_breaks Number of displayed breaks / labels in the legend.\n#' Needs an integer giving the desired number of breaks as input. Breakpoints are\n#' internally calculated by R's pretty() function, which can also lead to\n#' values slightly smaller or larger than the desired number.\n#'\n#'\n#' @param legend_title Defines the title of the legend.\n#'\n#' @param legend_position Defines position of the legend. Choose either\n#' 'bottom', right', 'left' or 'top'.\n#'\n#' @param legend_point_sizes Defines the size of the symbols representing the total\n#' NA bubbles in the legend.\n#'\n#' You can choose between \"default\", \"actual\" or a custom vector of sizes.\n#'\n#' \\itemize{\n#'    \\item{\"default\" - Scales the points in the legend to symbolically\n#'    resemble the size differences} (default choice)\n#'\n#'    \\item{\"actual\" - Scales the points in the legend according\n#'    to their actual size in the plot}\n#'    }\n#'\n#' Since these two options are not be always sufficient, a custom vector of\n#' sizes can be used as input. This would look like this: c(4,5,6,7). Be\n#' aware, that the length of this vector must match the number of breakpoints\n#' (can be adjusted with legend_breaks).\n#'\n#' @param theme Set a theme for ggplot2. Default is ggplot2::theme_linedraw().\n#' (\\code{\\link[ggplot2]{theme_linedraw})}\n#'\n#' @author Steffen Moritz\n#'\n#' @return The output is a \\code{\\link[ggplot2]{ggplot2}} object that can be\n#' further adjusted by using the ggplot syntax\n#'\n#' @details This function visualizes total NA counts by individual gap size\n#' (consecutive NAs) in a time series. The bubble plot makes it easy to see\n#' which gap sizes account for most of the NAs in the series. The size and\n#' color of the bubbles represent the total number of NAs a given gap size\n#' accounts for.\n#'\n#' Total NAs for a gap size are calculated as follows:\n#' total NAs = occurrence * gap length\n#'\n#' For example, interpret a bubble for gap size 2 as follows:\n#' a 2-NA gap (two NAs in a row) occurred 27 times in the time series and thus\n#' accounts for 54 total NAs.\n#'\n#' On the x-axis, the different gap sizes are plotted in increasing order.\n#' The y-axis shows the occurrence count of these gap sizes in the time series.\n#'\n#' The plot is useful for investigating possible root causes of the missing\n#' data. It can indicate whether the missing data are random or whether there\n#' are patterns of interest.\n#'\n#' Depending on the input time series, there might be too much information in\n#' the plot, leading to overplotting. In these cases, use the parameters\n#' \\code{min_totals}, \\code{min_occurrence}, and \\code{min_gapsize} to display\n#' only the information of interest.\n#'\n#' The only required parameter is \\code{x} (the univariate time series with NAs\n#' to visualize). All other parameters alter the appearance of the plot.\n#'\n#' As long as the input is univariate and numeric, the function also accepts\n#' \\code{data.frame}, \\code{tibble}, \\code{tsibble}, \\code{zoo}, or \\code{xts}\n#' input.\n#'\n#' The plot can be adjusted via function parameters. For more complex\n#' adjustments, you can modify the result using ggplot2 syntax, since the\n#' function returns a ggplot2 object. See the Examples for typical adjustments.\n#' \n#'\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_distribution}},\n#'   \\code{\\link[imputeTS]{ggplot_na_distribution2}},\n#'   \\code{\\link[imputeTS]{ggplot_na_gapsize}},\n#'   \\code{\\link[imputeTS]{ggplot_na_imputations}}\n#'\n#' @examples\n#' # Example 1: Visualize total NA counts in tsNH4\n#' ggplot_na_gapsize2(tsNH4)\n#'\n#' # Example 2: Visualize total NA counts in tsNH4, different color gradient\n#' ggplot_na_gapsize2(tsNH4, colors_bubbles = rev(grDevices::heat.colors(10)))\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' tsNH4 %>% ggplot_na_gapsize2()\n#'\n#' # Example 4: Visualize total NA counts in tsHeating\n#' # Limited to gap sizes that account for a total of > 600 NAs\n#' ggplot_na_gapsize2(tsHeating, min_totals = 600)\n#'\n#' # Example 5: Visualize total NA counts in tsNH4 - no legend\n#' ggplot_na_gapsize2(tsNH4, legend = FALSE)\n#'\n#' # Example 6: Visualize total NA counts in tsAirgap - increased bubble size\n#' ggplot_na_gapsize2(tsAirgap, size_bubbles = 35)\n#'\n#' # Example 7: Visualize total NA counts in tsNH4\n#' # Plot adjustments via ggplot_na_gapsize2 function parameters\n#' ggplot_na_gapsize2(tsNH4, theme = ggplot2::theme_classic())\n#'\n#' # Example 8: Visualize total NA counts in tsNH4 - title, subtitle in center\n#' # Plot adjustments via ggplot2 syntax\n#' ggplot_na_gapsize2(tsNH4) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n#'   ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 9: Visualize total NA counts in tsNH4 - title in center, no subtitle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_gapsize2(tsNH4, subtitle = NULL) +\n#'   ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n#'\n#' # Example 10: Total NA counts in tsNH4 - legend on the bottom and color change\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' ggplot_na_gapsize2(tsNH4, colors_bubbles = grDevices::heat.colors(10)) +\n#'   ggplot2::theme(legend.position = \"bottom\")\n#' @importFrom magrittr %>%\n#'\n#' @importFrom ggplot2 theme_linedraw ggplot aes geom_point scale_size_identity\n#' geom_text scale_x_continuous scale_y_continuous scale_fill_gradientn\n#' guide_legend ggtitle xlab ylab  theme element_text theme_classic\n#'\n#' @importFrom grDevices heat.colors\n#'\n#' @export\nggplot_na_gapsize2 <- function(x,\n                               colors_bubbles = c(\"#FCFBFF\", \"#EFEEFA\", \"#DDDAEF\",\n                                                  \"#C8C3E2\", \"#B1AAD4\", \"#9A8FC4\",\n                                                  \"#8273B5\", \"#6B56A7\", \"#553695\",\n                                                  \"#3D1778\"),\n                               color_border = \"black\",\n                               alpha_bubbles = 0.4,\n                               labels_bubbles = \"none\",\n                               size_bubbles = 25,\n                               min_totals = NULL,\n                               min_occurrence = NULL,\n                               min_gapsize = NULL,\n                               max_gapsize = NULL,\n                               title = \"Gap Size Analysis\",\n                               subtitle = \"Total NA counts for different gapsizes\",\n                               xlab = \"Gapsize\",\n                               ylab = \"Number occurrence\",\n                               legend = TRUE,\n                               legend_breaks = 4,\n                               legend_title = \"Total NAs\",\n                               legend_position = \"right\",\n                               legend_point_sizes = \"default\",\n                               theme = ggplot2::theme_linedraw()) {\n  data <- x\n\n\n\n  ##\n  ## 1. Input Check and Transformation\n  ##\n\n  # 1.1 special handling data types\n  if (any(class(data) == \"tbl_ts\")) {\n    data <- as.vector(as.data.frame(data)[, 2])\n  }\n  else if (any(class(data) == \"tbl\")) {\n    data <- as.vector(as.data.frame(data)[, 1])\n  }\n\n  # 1.2 Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    stop(\"x is not univariate. The function only works with univariate\n    input for x. For data types with multiple variables/columns only input\n    the column you want to plot as parameter x.\")\n  }\n\n\n  # 1.3 Checks and corrections for wrong data dimension\n\n  # Altering multivariate objects with 1 column (which are essentially\n  # univariate) to be dim = NULL\n  if (!is.null(dim(data)[2])) {\n    data <- data[, 1]\n  }\n\n\n\n  # 1.4 Input as vector\n  data <- as.vector(data)\n\n\n\n  # 1.5 Check if input is numeric\n  if (!is.numeric(data)) {\n    stop(\"Input x is not numeric\")\n  }\n\n\n  # 1.6 Check preconditions about amount of NAs\n\n  # exclude NA only inputs\n  missindx <- is.na(data)\n  if (all(missindx)) {\n    stop(\"Input data consists only of NAs. At least one non-NA numeric value is needed\n    for creating a meaningful ggplot_na_gapsize2 plot)\")\n  }\n\n  # exclude inputs without NAs\n  if (!anyNA(data)) {\n    stop(\"Input data contains no NAs. At least one missing value is needed\n         to create a meaningful ggplot_na_gapsize2 plot)\")\n  }\n\n\n\n  ##\n  ## End Input Check and Transformation\n  ##\n\n\n\n  ##\n  ## 2. Preparations\n  ##\n\n\n  # 2.1 Create required data\n\n\n  # Calculation consecutive NA information\n  rle_na <- base::rle(is.na(data))\n  vec <- rle_na$lengths[rle_na$values]\n  gap_table <- table(vec)\n  gap_names <- as.integer(names(gap_table))\n  occurrences <- as.integer(gap_table)\n  totals <- occurrences * gap_names\n\n\n\n\n  # 2.2 Create dataframe for ggplot2\n\n  df <- data.frame(gap = gap_names, occurrence = occurrences, total = totals)\n\n\n  # 2.3 Adjust data to user selected parameters / filter\n\n  # Filters to display only subsets of the data\n\n  # Maximum Gapsize\n  if (!is.null(max_gapsize)) {\n    df <- subset(df, gap <= max_gapsize)\n  }\n  # Minimum gapsize\n  if (!is.null(min_gapsize)) {\n    df <- subset(df, gap >= min_gapsize)\n  }\n  # Minimum Total NAs\n  if (!is.null(min_totals)) {\n    df <- subset(df, total >= min_totals)\n  }\n  # Minimum Occurrence NAs\n  if (!is.null(min_occurrence)) {\n    df <- subset(df, occurrence >= min_occurrence)\n  }\n  \n  # Error for too restrictive filters leaving no NA data to display\n  if (length(df$gap) < 1) {\n    stop(\"Too restrictive filter options set - nothing to display left.\n          Your setting of either max_gapsize, min_gapsize, min_totals, min_occurrence or the\n          combination of them left no NA data to display.)\")\n  }\n  \n\n  # 2.4 Calculate legend breaks and sizes\n\n\n  # Create legend break points with pretty function.\n  # Only use points within limits - otherwise there will be an error\n  leg_breaks <- base::pretty(df$total, n = legend_breaks)\n  leg_breaks <- leg_breaks[leg_breaks >= min(df$total) & leg_breaks <= max(df$total)]\n\n  # Prevent empty breaks, when pretty() only chooses values outside limits\n  if (length(leg_breaks) == 0) {\n    leg_breaks <- totals[1]\n  }\n\n  # Define size of points in legend\n\n  # Manual definition of legend point size\n  if (is.numeric(legend_point_sizes)) {\n    if (length(legend_point_sizes) == length(leg_breaks)) {\n      leg_sizes <- legend_point_sizes\n    }\n    else {\n      stop(\"When you input your own custom values for the size of the points in the legend,\n             make sure your vector has the same size as are breaks in the legend.\")\n    }\n  }\n  # Scale points in the  legend with a symbolic, sensible size\n  else if (legend_point_sizes == \"default\") {\n    leg_sizes <- seq(from = 3, by = 2, length.out = length(leg_breaks))\n  }\n  # Scale points in the legend according to their actual size in the plot\n  else if (legend_point_sizes == \"actual\") {\n    leg_sizes <- leg_breaks / (max(df$total) / size_bubbles)\n  }\n  else {\n    stop(\"Wrong values for parameter legend_pont_sizes chosen.\n  To influence the size of points in the legend,\n  either choose 'default', 'actual' or give a vector with your own desired sizes.\n  This custom vector needs to have exactly as many elements as the legend has breaks\")\n  }\n\n\n  ##\n  ## End Preparations\n  ##\n\n\n\n  ##\n  ## 3. Create the ggplot2 plot\n  ##\n\n  # Workaround for 'no visible binding' check() caused by ggplot2 vars\n  gap <- df$gap\n  occurrence <- df$occurrence\n  total <- df$total\n  \n\n  # Create ggplot\n\n  gg <- ggplot2::ggplot(data = df, ggplot2::aes(x = gap, y = occurrence)) +\n    ggplot2::geom_point(\n      alpha = alpha_bubbles, ggplot2::aes(\n        fill = total, size =\n          total / (max(total) / size_bubbles)\n      ),\n      color = color_border, pch = 21\n    ) +\n    ggplot2::scale_size_identity()\n\n  # What to appear in the label, default no label\n  if (labels_bubbles == \"gap-occurrence\") {\n    gg <- gg + ggplot2::geom_text(ggplot2::aes(label = paste0(gap, \"-gap\\n\", occurrence, \"x\")),\n      size = 2, alpha = 1, color = \"black\"\n    )\n  }\n  else if (labels_bubbles == \"gap\") {\n    gg <- gg + ggplot2::geom_text(ggplot2::aes(label = paste0(gap, \"-gap\")),\n      size = 2, alpha = 1, color = \"black\"\n    )\n  }\n  else if (labels_bubbles == \"total\") {\n    gg <- gg + ggplot2::geom_text(ggplot2::aes(label = paste0(total)),\n      size = 2, alpha = 1, color = \"black\"\n    )\n  }\n  else if (labels_bubbles == \"occurrence\") {\n    gg <- gg + ggplot2::geom_text(ggplot2::aes(label = paste0(occurrence,\"x\")),\n      size = 2, alpha = 1, color = \"black\"\n    )\n  }\n\n  gg <- gg + ggplot2::scale_x_continuous(\n    expand = c(0.1, 0.1),\n    breaks = function(x) unique(floor(base::pretty(seq(0, (max(x) + 1) * 1.1))))\n  ) +\n    ggplot2::scale_y_continuous(\n      expand = c(0.1, 0.1),\n      breaks = function(x) unique(floor(base::pretty(seq(0, (max(x) + 1) * 1.1))))\n    ) +\n    ggplot2::scale_fill_gradientn(\n      colors = colors_bubbles,\n      breaks = leg_breaks,\n      guide = ggplot2::guide_legend(\n        title = legend_title,\n        override.aes = list(size = leg_sizes)\n      )\n    ) +\n    ggplot2::ggtitle(title, subtitle = subtitle) +\n    ggplot2::xlab(xlab) +\n    ggplot2::ylab(ylab) +\n    theme +\n    ggplot2::theme(\n      legend.position = legend_position,\n      axis.text.x = ggplot2::element_text(angle = 30, hjust = 1),\n    )\n\n  # Removing legend\n  if (!legend) {\n    gg <- gg +\n      ggplot2::theme(\n        legend.position = \"none\",\n      )\n  }\n\n\n\n  ##\n  ##  End creating the ggplot2 plot\n  ##\n\n\n  return(gg)\n}\n"
  },
  {
    "path": "R/ggplot_na_imputations.R",
    "content": "#' @title Line Plot to Visualize Imputed Values\n#'\n#' @description Visualize the imputed values in a time series.\n#'\n#' @param x_with_na Numeric Vector or Time Series (\\code{\\link{ts}}) object\n#' with NAs before imputation. This parameter and x_with_imputation shave to\n#' be set. The rest of the parameters are mostly needed for adjusting the plot\n#' appearance.\n#'\n#' @param x_with_imputations Numeric Vector or Time Series (\\code{\\link{ts}})\n#' object with NAs replaced by imputed values. This parameter and\n#' x_with_imputation shave to be set.The rest of the parameters are mostly\n#' needed for adjusting the plot appearance.\n#'\n#' @param x_with_truth Numeric Vector or Time Series (\\code{\\link{ts}}) object\n#' with the real values (optional parameter). If the ground truth is known\n#' (e.g. in experiments where the missing values were artificially added)\n#' it can be displayed in the plot with this parameter.\n#' Default is NULL (ground truth not known).\n#'\n#' @param x_axis_labels For adding specific x-axis labels. Takes a vector of\n#' \\code{\\link[base]{Date}} or \\code{\\link[base]{POSIXct}} objects as an input\n#' (needs the same length as x_with_na).\n#' The Default (NULL) uses the observation numbers as x-axis tick labels.\n#'\n#' @param title Title of the Plot.\n#'\n#' @param subtitle Subtitle of the Plot.\n#'\n#' @param xlab Label for x-Axis.\n#'\n#' @param ylab Label for y-Axis.\n#'\n#' @param color_points Color for the Symbols/Points of the non-NA Observations.\n#'\n#' @param color_imputations Color for the Symbols/Points of the Imputed Values.\n#'\n#' @param color_truth Color for the Symbols/Points of the NA value Ground Truth\n#' (only relevant when x_with_truth available).\n#'\n#' @param shape_points Shape for the Symbols/Points of the non-NA observations.\n#' See https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.\n#'\n#' @param shape_imputations Shape for the Symbols/Points of the imputed values.\n#' See https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.\n#'\n#' @param shape_truth Shape for the Symbols/Points of the NA value Ground Truth\n#' (only relevant when x_with_truth available).\n#'\n#' @param size_points Size for the Symbols/Points of the non-NA Observations.\n#'\n#' @param size_imputations Size for the Symbols/Points of the Imputed Values.\n#'\n#' @param size_truth Size for the Symbols/Points of the NA value Ground Truth\n#' (only relevant when x_with_truth available).\n#'\n#' @param color_lines Color for the Lines connecting the Observations/Points.\n#'\n#' @param width_lines Width for the Lines connecting the Observations/Points.\n#'\n#' @param linetype Linetype for the Lines connecting the Observations/Points.\n#'\n#' @param connect_na If TRUE the Imputations are connected\n#' to the non-NA observations in the plot. Otherwise there are no\n#' connecting lines between symbols in NA areas.\n#'\n#' @param legend If TRUE a Legend is added at the bottom.\n#'\n#' @param legend_size Size of the Symbols used in the Legend.\n#'\n#' @param label_known Legend label for the non-NA Observations.\n#'\n#' @param label_imputations Legend label for the Imputed Values.\n#'\n#' @param label_truth Legend label for the Ground Truth of the NA values.\n#'\n#' @param theme Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n#' (\\code{\\link[ggplot2]{theme_linedraw})}\n#'\n#' @details This plot can be used, to visualize imputed values for a time\n#' series. Imputed values (filled NA gaps) are shown in a different color\n#' than the other values. If real values (ground truth) for the NA gaps are known,\n#' they can be optionally added in a different color.\n#'\n#' The only really needed parameters for this function are x_with_na\n#' (the time series with NAs before imputation) and x_with_imputations\n#' (the time series without NAs after imputation). All other parameters \n#' are msotly for altering the appearance of the plot.\n#'\n#' As long as the input is univariate and numeric the function also takes\n#' data.frame, tibble, tsibble, zoo, xts as an input.\n#'\n#' The plot can be adjusted to your needs via the function parameters.\n#' Additionally, for more complex adjustments, the output can also be\n#' adjusted via ggplot2 syntax. This is possible, since the output\n#' of the function is a ggplot2 object. Also take a look at the Examples\n#' to see how adjustments are made.\n#'\n#' @author Steffen Moritz, Sebastian Gatscha\n#'\n#'\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_distribution}},\n#'  \\code{\\link[imputeTS]{ggplot_na_distribution2}},\n#'  \\code{\\link[imputeTS]{ggplot_na_gapsize}},\n#'  \\code{\\link[imputeTS]{ggplot_na_gapsize2}}\n#'\n#' @examples\n#' # Example 1: Visualize imputation by na_mean\n#' imp_mean <- na_mean(tsAirgap)\n#' ggplot_na_imputations(tsAirgap, imp_mean)\n#'\n#'\n#' # Example 2: Visualize imputation by na_locf and added ground truth \n#' imp_locf <- na_locf(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap, \n#'                       x_with_imputations = imp_locf,\n#'                       x_with_truth = tsAirgapComplete\n#'                       )\n#' \n#' \n#' # Example 3: Visualize imputation by na_kalman\n#' imp_kalman <- na_kalman(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap, x_with_imputations = imp_kalman)\n#'\n#'\n#' # Example 4: Same as example 1, just written with pipe operator\n#' tsAirgap %>%\n#'   na_mean() %>%\n#'   ggplot_na_imputations(x_with_na = tsAirgap)\n#'   \n#'\n#' # Example 5: Visualize imputation by na_seadec - different color for imputed points\n#' # Plot adjustments via ggplot_na_imputations function parameters\n#' imp_seadec <- na_seadec(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap, \n#'                       x_with_imputations = imp_seadec,\n#'                       color_imputations = \"gold\")\n#' \n#' \n#' # Example 6: Visualize imputation - different theme, point size imputations\n#' # Plot adjustments via ggplot_na_imputations function parameters\n#' imp_seadec <- na_seadec(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap, \n#'                       x_with_imputations = imp_seadec,\n#'                       theme = ggplot2::theme_classic(),\n#'                       size_imputations = 5)\n#'\n#'                  \n#' # Example 7: Visualize imputation - title, subtitle in center\n#' # Plot adjustments via ggplot2 syntax\n#' imp_seadec <- na_seadec(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap,  x_with_imputations = imp_seadec) + \n#'     ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n#'     ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))   \n#'\n#'\n#' # Example 8: Visualize imputation - title in center, no subtitle\n#' # Plot adjustments via ggplot2 syntax and function parameters\n#' imp_mean <- na_mean(tsAirgap)\n#' ggplot_na_imputations(x_with_na = tsAirgap,  \n#'                       x_with_imputations = imp_mean,\n#'                       subtitle = NULL) +\n#'      ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n#'   \n#' @importFrom magrittr %>%\n#'\n#' @importFrom ggplot2 theme_linedraw ggplot geom_line aes geom_point\n#' scale_color_manual element_blank xlab ylab ggtitle guides guide_legend\n#' theme theme_classic\n#'\n#'\n#' @export\n\nggplot_na_imputations <- function(x_with_na,\n                                  x_with_imputations,\n                                  x_with_truth = NULL,\n                                  x_axis_labels = NULL,\n                                  title = \"Imputed Values\",\n                                  subtitle = \"Visualization of missing value replacements\",\n                                  xlab = \"Time\",\n                                  ylab = \"Value\",\n                                  color_points = \"steelblue\",\n                                  color_imputations = \"indianred\",\n                                  color_truth = \"seagreen3\",\n                                  color_lines = \"lightslategray\",\n                                  shape_points = 16,\n                                  shape_imputations = 18,\n                                  shape_truth = 16,\n                                  size_points = 1.5,\n                                  size_imputations = 2.5,\n                                  size_truth = 1.5,\n                                  width_lines = 0.5,\n                                  linetype = \"solid\",\n                                  connect_na = TRUE,\n                                  legend = TRUE,\n                                  legend_size = 5,\n                                  label_known = \"known values\",\n                                  label_imputations = \"imputed values\",\n                                  label_truth = \"ground truth\",\n                                  theme = ggplot2::theme_linedraw()) {\n\n\n  ##\n  ## 1. Input Check and Transformation\n  ##\n\n  # 1.1 special handling data types\n  # x_with_na\n  if (any(class(x_with_na) == \"tbl_ts\")) {\n    x_with_na <- as.vector(as.data.frame(x_with_na)[, 2])\n  }\n  else if (any(class(x_with_na) == \"tbl\")) {\n    x_with_na <- as.vector(as.data.frame(x_with_na)[, 1])\n  }\n  # x_with_imputations\n  if (any(class(x_with_imputations) == \"tbl_ts\")) {\n    x_with_imputations <- as.vector(as.data.frame(x_with_imputations)[, 2])\n  }\n  else if (any(class(x_with_imputations) == \"tbl\")) {\n    x_with_imputations <- as.vector(as.data.frame(x_with_imputations)[, 1])\n  }\n  # x_with_truth\n  if (any(class(x_with_truth) == \"tbl_ts\")) {\n    x_with_truth <- as.vector(as.data.frame(x_with_truth)[, 2])\n  }\n  else if (any(class(x_with_truth) == \"tbl\")) {\n    x_with_truth <- as.vector(as.data.frame(x_with_truth)[, 1])\n  }\n\n  # 1.2 Check if the input is multivariate\n\n  if (!is.null(dim(x_with_na)[2]) && dim(x_with_na)[2] > 1) {\n    stop(\"x_with_na is not univariate.\n    The function only works with univariate input for x_with_na.\n    For data types with multiple variables/columns only input the\n         column you want to plot as parameter x_with_na.\")\n  }\n\n  if (!is.null(dim(x_with_imputations)[2]) && dim(x_with_imputations)[2] > 1) {\n    stop(\"x_with_imputations is not univariate.\n    The function only works with univariate input for x_with_imputations.\n    For data types with multiple variables/columns only input the column\n         you want to plot as parameter x_with_imputations\")\n  }\n\n  if (!is.null(dim(x_with_truth)[2]) && dim(x_with_truth)[2] > 1) {\n    stop(\"x_with_na is not univariate.\n    The function only works with univariate input for x_with_truth.\n    For data types with multiple variables/columns only input the\n         column you want to plot as parameter x_with_truth\")\n  }\n\n\n  # 1.3 Checks and corrections for wrong data dimension\n\n  # Altering multivariate objects with 1 column (which are essentially\n  # univariate) to be dim = NULL\n  if (!is.null(dim(x_with_na)[2])) {\n    x_with_na <- x_with_na[, 1]\n  }\n  if (!is.null(dim(x_with_imputations)[2])) {\n    x_with_imputations <- x_with_imputations[, 1]\n  }\n  if (!is.null(dim(x_with_truth)[2])) {\n    x_with_truth <- x_with_truth[, 1]\n  }\n\n\n  # 1.4 Input as vector\n\n  x_with_na <- as.vector(x_with_na)\n  x_with_imputations <- as.vector(x_with_imputations)\n  x_with_truth <- as.vector(x_with_truth)\n\n\n  # 1.5 Check if input is numeric\n\n  if (!is.numeric(x_with_na)) {\n    stop(\"Input x_with_na is not numeric\")\n  }\n  if (!is.numeric(x_with_imputations)) {\n    stop(\"Input x_with_imputations is not numeric\")\n  }\n  if (!is.numeric(x_with_truth) && !is.null(x_with_truth)) {\n    stop(\"Input x_with_truth is not numeric\")\n  }\n\n\n  # 1.6 Same length of the series\n\n  # x_with_na and x_with_imputations need same length\n  if (length(x_with_na) != length(x_with_imputations)) {\n    stop(\"Input x_with_na and x_with_imputations need to have the same length.\n         x_with_na is the time series with NAs before imputation.\n         x_with_imputations is the time series with filled NAs after applying imputation.\")\n  }\n\n  # if x_with_truth available it needs also same length\n  if (!is.null(x_with_truth) && (length(x_with_na) != length(x_with_truth))) {\n    stop(\"Input x_with_na, x_with_imputations and x_with_truth need to have the same length.\n         x_with_na is the time series with NAs before imputation.\n         x_with_imputations is the time series with filled NAs after applying imputation.\n         x_with_truth (optional) is the series with the ground truth for the imputed values\")\n  }\n\n\n\n  # 1.7 Check preconditions about amount of NAs\n\n  # Unwanted all NA inputs\n  missindx_x_with_na <- is.na(x_with_na)\n  if (all(missindx_x_with_na)) {\n    stop(\"Input x_with_na consists only of NAs.\n     Something with the input likely went wrong.\n     Creating a ggplot_na_imputations plot does not make sense with an all NA input.\n     This are the required inputs:\n     x_with_na (time series before imputation that still has NAs),\n     x_with_imputations (time series after imputation, where NAs were replaced by imputation\")\n  }\n\n  missindx_x_with_imputations <- is.na(x_with_imputations)\n  if (all(missindx_x_with_imputations)) {\n    stop(\"Input x_with_imputations consists only of NAs.\n     Something with the input likely went wrong.\n     Creating a ggplot_na_imputations plot does not make sense with an all NA input.\n     This are the required inputs:\n     x_with_na (time series before imputation that still has NAs),\n     x_with_imputations (time series after imputation, where NAs were replaced by imputation\")\n  }\n\n\n  # Unwanted no NA inputs\n  if (!anyNA(x_with_na)) {\n    stop(\"Input x_with_na contains no NAs. At least one missing value is needed\n     to create a meaningful ggplot_na_imputations plot)\n     This are the required inputs:\n     x_with_na (time series before imputation that still has NAs),\n     x_with_imputations (time series after imputation, where NAs were replaced by imputation\")\n  }\n\n\n  ##\n  ## End Input Check and Transformation\n  ##\n\n\n\n  ##\n  ## 2. Preparations\n  ##\n\n  # 2.1 Create dataframe for ggplot2\n\n  # Define x-axis label data\n  # if Date or POSIXct given for x_axis_labels time information can be plotted\n  if (any(class(x_axis_labels) == \"Date\")) {\n    time <- x_axis_labels\n  }\n  else if (any(class(x_axis_labels) == \"POSIXct\")) {\n    time <- x_axis_labels\n  }\n  else if (is.null(x_axis_labels)) {\n    time <- seq_along(x_with_na)\n  }\n  else {\n    stop(\"Input for x_axis_labels is not in a supported format, must be a\n           vector of Date or a POSIXct objects with the same length as\n           x_with_na and x_with_imputations\")\n  }\n\n  if (!is.null(x_with_truth)) {\n    df <- data.frame(time, x_with_imputations, x_with_na, x_with_truth)\n  }\n  else {\n    df <- data.frame(time, x_with_imputations, x_with_na)\n  }\n\n  ##\n  ## End Preparations\n  ##\n\n\n\n  ##\n  ## 3. Create the ggplot2 plot\n  ##\n\n  # Create the plot\n  gg <- ggplot2::ggplot(data = df)\n\n  ## Add Lines\n  # Don't connect the lines in the missing areas\n  if (connect_na == FALSE) {\n    gg <- gg + ggplot2::geom_line(\n      data = df, ggplot2::aes(x = time, y = x_with_na),\n      na.rm = TRUE, color = color_lines,\n      linetype = linetype, linewidth = width_lines\n    )\n  }\n  # If truth available connect the true values in the missing areas\n  else if (!is.null(x_with_truth)) {\n    gg <- gg + ggplot2::geom_line(\n      data = df, ggplot2::aes(x = time, y = x_with_truth),\n      na.rm = TRUE, color = color_lines,\n      linetype = linetype, linewidth = width_lines\n    )\n  }\n  # If no truth available connect the imputed values in the missing areas\n  else {\n    gg <- gg + ggplot2::geom_line(\n      data = df, ggplot2::aes(x = time, y = x_with_imputations),\n      na.rm = TRUE, color = color_lines,\n      linetype = linetype, linewidth = width_lines\n    )\n  }\n\n\n  # Remove known values from imputations - to avoid overplotting\n  df$x_with_imputations[!is.na(x_with_na)] <- NA\n  if (!is.null(x_with_truth)) {\n    df$x_with_truth[!is.na(x_with_na)] <- NA\n  }\n\n  ## Add points\n\n  # Points for regular, known values\n  gg <- gg + ggplot2::geom_point(\n    data = df, ggplot2::aes(x = time, y = x_with_na, color = \"1\"),\n    na.rm = TRUE, shape = shape_points, size = size_points\n  )\n\n\n  # Points for Imputations\n  gg <- gg + ggplot2::geom_point(\n    data = df, ggplot2::aes(x = time, y = x_with_imputations, color = \"2\"),\n    na.rm = TRUE, size = size_imputations, shape = shape_imputations\n  )\n\n  # Points for truth\n  if (!is.null(x_with_truth)) {\n    gg <- gg + ggplot2::geom_point(\n      data = df, ggplot2::aes(x = time, y = x_with_truth, color = \"3\"),\n      na.rm = TRUE, shape = shape_truth, size = size_truth\n    )\n  }\n\n\n  if (!is.null(x_with_truth)) {\n    gg <- gg + ggplot2::scale_color_manual(\n      name = ggplot2::element_blank(),\n      breaks = c(\"1\", \"2\", \"3\"),\n      labels = c(label_known, label_imputations, label_truth),\n      values = c(color_points, color_imputations, color_truth)\n    )\n  }\n  else {\n    gg <- gg + ggplot2::scale_color_manual(\n      name = ggplot2::element_blank(),\n      breaks = c(\"1\", \"2\"),\n      labels = c(label_known, label_imputations),\n      values = c(color_points, color_imputations)\n    )\n  }\n\n  gg <- gg + ggplot2::ylab(ylab) + ggplot2::xlab(xlab) +\n\n    ggplot2::ggtitle(label = title, subtitle = subtitle) + theme\n\n  if (!is.null(x_with_truth)) {\n    gg <- gg + ggplot2::guides(color = ggplot2::guide_legend(\n      override.aes = list(size = legend_size,\n                          shape = c(shape_points, shape_imputations, shape_truth))\n    ))\n  }\n  else {\n    gg <- gg + ggplot2::guides(color = ggplot2::guide_legend(\n      override.aes = list(size = legend_size,\n                          shape = c(shape_points, shape_imputations))\n    ))\n  }\n\n  gg <- gg + ggplot2::theme(\n    legend.position = base::ifelse(legend == TRUE, \"bottom\", \"none\"),\n    legend.title = ggplot2::element_blank()\n  )\n\n  ##\n  ##  End creating the ggplot2 plot\n  ##\n\n  return(gg)\n}\n"
  },
  {
    "path": "R/imputeTS-package.R",
    "content": "#' @keywords internal\n\"_PACKAGE\"\n\n#' @title imputeTS-package description\n#' \n#' @description \n#' The imputeTS package is a collection of algorithms and tools for univariate time series imputation.\n#' \n#' @details The imputeTS package specializes on (univariate) time series imputation. \n#' It offers several different imputation algorithm implementations. Beyond the imputation algorithms \n#' the package also provides plotting and printing functions of missing data statistics.\n#' \n#' The package is easy to use:\n#' \n#' - To impute (fill all missing values) in a time series \\code{x}, run:\\cr\n#'  \\code{na_interpolation(x)} \\cr\n#'          \n#' - To plot missing data statistics for a time series \\code{x}, run:\\cr\n#'  \\code{ggplot_na_distribution(x)}\\cr\n#'\n#' - To print missing data statistics for a time series \\code{x}, run:\\cr\n#'  \\code{statsNA(x)}\\cr\n#' \n#' Every other imputation function (starting with na_'algorithm name') and plotting\n#' function (starting with plotNA_'plot name') work the same way as in this example.\n#'   \n#' @name imputeTS-package\n#' \n#' @references Moritz, Steffen, and Thomas Bartz-Beielstein. \"imputeTS: Time Series Missing Value Imputation in R.\" R Journal 9.1 (2017). doi:10.32614/RJ-2017-009.\n#' \n#' @import stats\n#' @importFrom magrittr %>%\n#' @importFrom utils globalVariables\n#' @importFrom Rcpp sourceCpp\n#' @useDynLib imputeTS\nNULL\n\n.onUnload <- function (libpath) {\n  library.dynam.unload(\"imputeTS\", libpath)\n}\n\nutils::globalVariables(c(\"rule\"))\n\n#' @export \nmagrittr::`%>%`\n\n\n"
  },
  {
    "path": "R/internal_algorithm_interface.R",
    "content": "##De-Roxygenized to avoid appearance in the package documentation\n\n# @title Algorithm selection (Internal function)\n# @description Internal function for choosing between the basic univariate imputation algortihms\n# @param x  Supposed to be a univariate time series \n# @return Time Series (\\code{\\link{ts}}) object that fulfills the requirements\n# @author Steffen Moritz\n#' @import stats\n\n\napply_base_algorithm <- function(x, algorithm, ...) { \n  \n  data <- x\n  \n  #checking for false input\n  if(algorithm == \"locf\")\n  { data <- na_locf(data, ...) }\n  \n  else if(algorithm == \"mean\")\n  { data <- na_mean(data, ...) }\n  \n  else if(algorithm == \"random\")\n  { data <- na_random(data,  ...) }\n  \n  else if(algorithm == \"interpolation\")\n  { data <- na_interpolation(data,  ...) }\n  \n  else if(algorithm == \"kalman\")\n  { data <- na_kalman(data,  ...) }\n  \n  else if(algorithm == \"ma\")\n  { data <- na_ma(data,  ...) }\n  \n  else \n  {\n    stop(\"Wrong parameter for option algorithm chosen.\")\n  }\n  \n  return(data)\n  \n}\n"
  },
  {
    "path": "R/na_interpolation.R",
    "content": "#' @title Missing Value Imputation by Interpolation\n#'\n#' @description Uses either linear, spline or stineman interpolation\n#' to replace missing values.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#'  object in which missing values shall be replaced\n#'\n#' @param option Algorithm to be used. Accepts the following input:\n#' \\itemize{\n#'    \\item{\"linear\" - for linear interpolation using \\link{approx} } (default choice)\n#'    \\item{\"spline\" - for spline interpolation using \\link{spline}}\n#'    \\item{\"stine\" - for Stineman interpolation using \\link[stinepack]{stinterp}}\n#'    }\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @param ... Additional parameters to be passed through to \\link{approx} or\n#'  \\link{spline} interpolation functions\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#'  object (dependent on given input at parameter x)\n#'\n#' @details Missing values get replaced by values of \\link{approx}, \\link{spline}\n#' or \\link[stinepack]{stinterp} interpolation.\n#' \n#'  The na_interpolation function also supports the use of additional parameters from the respective\n#'  underlying interpolation functions. While usually not really needed, it is useful to know that \n#'  this advanced use is in principle possible. These additional parameters are not specified explicitly \n#'  in the na_interpolation function documentation. Take a look into the documentation of the \\link[stinepack]{stinterp}, \\link{approx} and \\link{spline} functions to get an overview about these additional parameters.\n#'  \n#'  An example for such a parameter is the 'method' argument of spline, which can be used to\n#'  further specify the type of spline to be used. Possible values are \"fmm\", \"natural\", \n#'  \"periodic\", \"monoH.FC\" and \"hyman\" (as can be seen in the \\link{spline}\n#'   documentation). The respective function call using this additional parameter would  \n#'   look like this: \n#'   \\code{na_interpolation(x, option =\"spline\", method =\"natural\")}\n#'   \n#'  Like in this example other additional detail parameters (gained from \\link{approx}, \n#'  \\link{spline}, \\link[stinepack]{stinterp} documentation) can be used by just including \n#'  them in the na_interpolation function call. As already mentioned, these advanced possibilities\n#'  for settings parameters are only helpful for specific use cases. For regular use\n#'  the standard parameters provided directly in the na_interpolation documentation should be\n#'  more than enough.\n#'  \n#'\n#' @author Steffen Moritz, Ron Hause\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Prerequisite: Create Time series with missing values\n#' x <- ts(c(2, 3, 4, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Perform linear interpolation\n#' na_interpolation(x)\n#'\n#' # Example 2: Perform spline interpolation\n#' na_interpolation(x, option = \"spline\")\n#'\n#' # Example 3: Perform stine interpolation\n#' na_interpolation(x, option = \"stine\")\n#' \n#' # Example 4: Perform linear interpolation, with additional parameter pass through from spline()\n#' # Take a look at the 'Details' section of the na_interpolation documentation \n#' # for more information about advanced parameter pass through options\n#' na_interpolation(x, option =\"spline\", method =\"natural\")\n#' \n#' # Example 5: Same as example 1, just written with pipe operator\n#' x %>% na_interpolation()\n#'\n#' # Example 6: Same as example 2, just written with pipe operator\n#' x %>% na_interpolation(option = \"spline\")\n#' @references Johannesson, Tomas, et al. (2015). \"Package stinepack\".\n#' @importFrom stats ts approx spline\n#' @importFrom methods hasArg\n#' @importFrom stinepack stinterp\n#' @importFrom magrittr %>%\n#' @export\n\nna_interpolation <- function(x, option = \"linear\", maxgap = Inf, ...) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_interpolation(data[, i], option, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_interpolation: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 2) {\n      stop(\"At least 2 non-NA data points required in the time series to apply na_interpolation.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    ##\n    ## End Input Check\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    n <- length(data)\n\n    allindx <- 1:n\n    indx <- allindx[!missindx]\n\n    data_vec <- as.vector(data)\n\n    # Linear Interpolation\n    if (option == \"linear\") {\n      # Check if 'rule' is used in function call, to allow parameter pass through for rule\n      # Needed since parameter pass through via (...) to approx does not work, when value for 'rule' is also set in the code. \n      if (methods::hasArg(rule)) {\n        interp <- stats::approx(indx, data_vec[indx], 1:n, ...)$y\n      }\n      else {\n        interp <- stats::approx(indx, data_vec[indx], 1:n, rule = 2, ...)$y\n      }\n    }\n    # Spline Interpolation\n    else if (option == \"spline\") {\n      interp <- stats::spline(indx, data_vec[indx], n = n, ...)$y\n    }\n    # Stineman Interpolation\n    else if (option == \"stine\") {\n      interp <- stinepack::stinterp(indx, data_vec[indx], 1:n, ...)$y\n      # avoid NAs at the beginning and end of series // same behavior like\n      # for approx with rule = 2.\n      if (any(is.na(interp))) {\n        interp <- na_locf(interp, na_remaining = \"rev\")\n      }\n    }\n    # Wrong parameter option\n    else {\n      stop(\"Wrong parameter 'option' given. Value must be either 'linear', 'spline' or 'stine'.\")\n    }\n\n    # Merge interpolated values back into original time series\n    data[missindx] <- interp[missindx]\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_kalman.R",
    "content": "#' @title Missing Value Imputation by Kalman Smoothing and State Space Models\n#'\n#' @description Uses Kalman Smoothing on structural time series models\n#' (or on the state space representation of an arima model) for imputation.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param model Model to be used. With this parameter the State Space Model\n#' (on which KalmanSmooth is performed) can be chosen. Accepts the following input:\n#'\n#' \\itemize{\n#'\n#'    \\item{\"StructTS\" - For using a structural model fitted by maximum\n#'     likelihood (using \\link[stats]{StructTS}) } (default choice)\n#'\n#'    \\item{\"auto.arima\" - For using the state space representation of\n#'    arima model (using \\link[forecast]{auto.arima})}\n#'\n#'    }\n#'\n#'  For both auto.arima and StructTS additional parameters for model building can\n#'  be given with the \\dots parameter\n#'\n#'  Additionally it is also possible to use a user created state space model\n#'  (See code Example 5). This state space model could for example be\n#'  obtained from another R package for structural time series modeling.\n#'  Furthermore providing the state space representation of a arima model\n#'  from \\link[stats]{arima} is also possible. But it is important to note,\n#'  that user created state space models must meet the requirements specified\n#'  under \\link[stats]{KalmanLike}. This means the user supplied state space\n#'  model has to be in form of a list with at least components T, Z, h , V, a, P, Pn.\n#'  (more details under \\link[stats]{KalmanLike})\n#'\n#' @param smooth if \\code{TRUE} - \\code{\\link[stats]{KalmanSmooth}} is used for\n#' estimation, if \\code{FALSE} - \\code{\\link[stats]{KalmanRun}} is used.\n#' Since KalmanRun is often considered extrapolation KalmanSmooth is usually\n#' the better choice for imputation.\n#'\n#' @param nit Parameter from Kalman Filtering (see \\link[stats]{KalmanLike}).\n#' Usually no need to change from default.\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @param ... Additional parameters to be passed through to the functions that\n#' build the State Space Models (\\link[stats]{StructTS} or \\link[forecast]{auto.arima}).\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details The KalmanSmoother used in this function is \\code{\\link[stats]{KalmanSmooth}}.\n#' It operates either on a \\code{Basic Structural Model} obtained by\n#' \\code{\\link[stats]{StructTS}} or the state space representation of a ARMA model\n#' obtained by \\code{\\link[forecast]{auto.arima}}.\n#'\n#' For an detailed explanation of Kalman Filtering and Space Space Models the\n#' following literature is a good starting point:\n#' \\itemize{\n#'    \\item{\\cite{G. Welch, G. Bishop, An Introduction to the Kalman Filter. SIGGRAPH 2001 Course 8, 1995}}\n#'    \\item{\\cite{Harvey, Andrew C. Forecasting, structural time series models and the Kalman filter. Cambridge university press, 1990} }\n#'    \\item{\\cite{Grewal, Mohinder S. Kalman filtering. Springer Berlin Heidelberg, 2011}}\n#'    }\n#'\n#' @author Steffen Moritz\n#' @seealso \\code{\\link[imputeTS]{na_interpolation}},\n#'  \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Example 1: Perform imputation with KalmanSmoother and state space representation of arima model\n#' na_kalman(tsAirgap)\n#'\n#' # Example 2: Perform imputation with KalmanRun and state space representation of arima model\n#' na_kalman(tsAirgap, smooth = FALSE)\n#'\n#' # Example 3: Perform imputation with KalmanSmooth and StructTS model\n#' na_kalman(tsAirgap, model = \"StructTS\", smooth = TRUE)\n#'\n#' # Example 4: Perform imputation with KalmanSmooth and StructTS model with additional parameters\n#' na_kalman(tsAirgap, model = \"StructTS\", smooth = TRUE, type = \"trend\")\n#'\n#' # Example 5:  Perform imputation with KalmanSmooth and user created model\n#' usermodel <- arima(tsAirgap, order = c(1, 0, 1))$model\n#' na_kalman(tsAirgap, model = usermodel)\n#'\n#' # Example 6: Same as example 1, just written with pipe operator\n#' tsAirgap %>% na_kalman()\n#' @references Hyndman RJ and Khandakar Y (2008). \"Automatic time series forecasting: the forecast package for R\". Journal of Statistical Software, 26(3).\n#' @importFrom stats StructTS KalmanSmooth KalmanRun arima\n#' @importFrom forecast auto.arima\n#' @importFrom magrittr %>%\n#' @export\n\nna_kalman <- function(x, model = \"StructTS\", smooth = TRUE, nit = -1, maxgap = Inf, ...) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_kalman(data[, i], model, smooth, nit, maxgap, ...),\n        error = function(cond) {\n          warning(paste(\n            \"na_kalman: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 3) {\n      stop(\"At least 3 non-NA data points required in the time series to apply na_kalman.\")\n    }\n\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    # 1.6 Check if type of parameter smooth is correct\n    if (!is.logical(smooth)) {\n      stop(\"Parameter smooth must be of type logical ( TRUE / FALSE).\")\n    }\n\n    # 1.7 Transformation to numeric as 'int' can't be given to KalmanRun\n    data[1:length(data)] <- as.numeric(data)\n\n\n    # 1.8 Check for and mitigate all constant values in combination with StructTS\n    # See https://github.com/SteffenMoritz/imputeTS/issues/26\n\n    if (is.character(model) && model == \"StructTS\" && length(unique(as.vector(data))) == 2) {\n      return(na_interpolation(x))\n    }\n\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    # 2.1 Selection of state space model\n\n    # State space representation of a arima model\n    if (model[1] == \"auto.arima\") {\n      mod <- forecast::auto.arima(data, ...)$model\n    }\n    # State space model, default is BSM - basic structural model\n    else if (model[1] == \"StructTS\") {\n      # Fallback, in StructTS first value is not allowed to be NA, thus take first non-NA\n      if (is.na(data[1])) {\n        data[1] <- data[which.min(is.na(data))]\n      }\n      mod <- stats::StructTS(data, ...)$model0\n    }\n    # User supplied model e.g. created with arima() or other state space models from other packages\n    else {\n      mod <- model\n      if (length(mod) < 7) {\n        stop(\"Parameter model has either to be \\\"StructTS\\\"/\\\"auto.arima\\\" or a user supplied model in\n            form of a list with at least components T, Z, h , V, a, P, Pn specified.\")\n      }\n\n      if (is.null(mod$Z)) {\n        stop(\"Something is wrong with the user supplied model. Either choose \\\"auto.arima\\\" or \\\"StructTS\\\"\n             or supply a state space model with at least components T, Z, h , V, a, P, Pn as specified\n             under Details on help page for KalmanLike.\")\n      }\n    }\n\n\n    # 2.2 Selection if KalmanSmooth or KalmanRun\n\n    if (smooth == TRUE) {\n      kal <- stats::KalmanSmooth(data, mod, nit)\n      erg <- kal$smooth # for kalmanSmooth\n    }\n    else {\n      kal <- stats::KalmanRun(data, mod, nit)\n      erg <- kal$states # for kalmanrun\n    }\n\n    # Check if everything is right with the model\n    if (dim(erg)[2] != length(mod$Z)) {\n      stop(\"Error with number of components $Z.\")\n    }\n\n    # 2.3 Getting Results\n\n    # Out of all components in $states or$smooth only the ones\n    # which have 1 or -1 in $Z are in the model\n    # Therefore matrix multiplication is done\n    karima <- erg[missindx, , drop = FALSE] %*% as.matrix(mod$Z)\n\n    # Add imputations to the initial dataset\n    data[missindx] <- karima\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_locf.R",
    "content": "#' @title Missing Value Imputation by Last Observation Carried Forward\n#'\n#' @description Replaces each missing value with the most recent present value\n#'  prior to it (Last Observation Carried Forward- LOCF). Optionally this can\n#'  also be done starting from the back of the series (Next Observation Carried\n#'  Backward - NOCB).\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param option Algorithm to be used. Accepts the following input:\n#' \\itemize{\n#'    \\item{\"locf\" - for Last Observation Carried Forward} (default choice)\n#'    \\item{\"nocb\" - for Next Observation Carried Backward}\n#'    }\n#'\n#' @param na_remaining Method to be used for remaining NAs.\n#' \\itemize{\n#'    \\item{\"rev\" - to perform nocb / locf from the reverse direction} (default choice)\n#'    \\item{\"keep\" - to return the series with NAs}\n#'    \\item{\"rm\" - to remove remaining NAs}\n#'    \\item{\"mean\" - to replace remaining NAs by overall mean}\n#'    }\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details\n#'\n#' ## General Functionality\n#' Replaces each missing value with the most recent present value\n#' prior to it (Last Observation Carried Forward - LOCF). This can also be\n#' done in reverse direction, starting from the end of the series (then\n#' called Next Observation Carried Backward - NOCB).\n#'\n#'\n#' ## Handling for NAs at the beginning of the series\n#' In case one or more successive observations directly at the start of the\n#' time series are NA, there exists no 'last value' yet, that can be carried\n#' forward. Thus, no LOCF imputation can be performed for these NAs. As soon\n#' as the first non-NA value appears, LOCF can be performed as expected. The\n#' same applies to NOCB, but from the opposite direction.\n#'\n#' While this problem might appear seldom and will only affect a very small\n#' amount of values at the beginning, it is something to consider.\n#' The \\code{na_remaining} parameter helps to define, what should happen\n#' with these values at the start, that would remain NA after pure LOCF.\n#'\n#' Default setting is \\code{na_remaining = \"rev\"}, which performs\n#' nocb / locf from the other direction to fill these NAs. So a NA\n#' at the beginning will be filled with the next non-NA value appearing\n#' in the series.\n#'\n#' With \\code{na_remaining = \"keep\"} NAs at the beginning (that can not\n#' be imputed with pure LOCF) are just left as remaining NAs.\n#'\n#'  With \\code{na_remaining = \"rm\"} NAs at the beginning of the series are\n#'  completely removed. Thus, the time series is basically shortened.\n#'\n#'  Also available is \\code{na_remaining = \"mean\"}, which uses the overall\n#'  mean of the time series to replace these remaining NAs. (but beware,\n#'  mean is usually not a good imputation choice - even if it  only affects\n#'  the values at the beginning)\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Prerequisite: Create Time series with missing values\n#' x <- ts(c(NA, 3, 4, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Perform LOCF\n#' na_locf(x)\n#'\n#' # Example 2: Perform NOCF\n#' na_locf(x, option = \"nocb\")\n#'\n#' # Example 3: Perform LOCF and remove remaining NAs\n#' na_locf(x, na_remaining = \"rm\")\n#'\n#' # Example 4: Same as example 1, just written with pipe operator\n#' x %>% na_locf()\n#' @importFrom stats ts\n#' @importFrom magrittr %>%\n#' @export\n\nna_locf <- function(x, option = \"locf\", na_remaining = \"rev\", maxgap = Inf) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_locf(data[, i], option, na_remaining, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_locf: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (all(missindx)) {\n      stop(\"Input data has only NA values. At least 1 non-NA data point required in the time series to apply na_locf.\")\n    }\n\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    # 2.1 Perform locf or nocb\n\n    # Input as vector\n    data_vec <- as.vector(data)\n\n    # Last observation carried forward // f = 0\n    if (option == \"locf\") {\n      imputed <- locf(data_vec, FALSE)\n    }\n    # Next observation carried backward // f = 1\n    else if (option == \"nocb\") {\n      imputed <- locf(data_vec, TRUE)\n    }\n    # Wrong input\n    else {\n      stop(\"Wrong parameter 'option' given. Value must be either 'locf' or 'nocb'.\")\n    }\n\n    data[missindx] <- imputed[missindx]\n\n\n    # 2.2 Handle remaining NAs - na_remaining param\n\n    # no remaining NAs or keep NAs selected -> do nothing\n    if (!anyNA(data) || na_remaining == \"keep\") {\n      # do nothing\n    }\n    # Replace NAs through locf/nocb from the other direction\n    else if (na_remaining == \"rev\") {\n      if (option == \"locf\") {\n        data <- na_locf(data, option = \"nocb\")\n      }\n      else if (option == \"nocb\") {\n        data <- na_locf(data, option = \"locf\")\n      }\n    }\n    # Remove all NAs\n    else if (na_remaining == \"rm\") {\n      data <- na_remove(data)\n    }\n    # Replace NAs with overall mean\n    else if (na_remaining == \"mean\") {\n      data <- na_mean(data)\n    }\n    # Wrong Input\n    else {\n      stop(\"Wrong parameter 'na_remaining' given. Value must be either 'keep', 'rm', 'mean' or 'rev'.\")\n    }\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_ma.R",
    "content": "#' @title Missing Value Imputation by Weighted Moving Average\n#'\n#' @description Missing value replacement by weighted moving average.\n#' Uses semi-adaptive window size to ensure all NAs are replaced.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param weighting Weighting to be used. Accepts the following input:\n#' \\itemize{\n#'    \\item{\"simple\" - Simple Moving Average (SMA)}\n#'    \\item{\"linear\" - Linear Weighted Moving Average (LWMA)}\n#'    \\item{\"exponential\" - Exponential Weighted Moving Average (EWMA)} (default choice)\n#'    }\n#'\n#' @param k integer width of the moving average window. Expands to both sides\n#' of the center element e.g. k=2 means 4 observations (2 left, 2 right) are\n#' taken into account. If all observations in the current window are NA, the\n#' window size is automatically increased until there are at least 2 non-NA\n#' values present.\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details In this function missing values get replaced by moving average\n#' values. Moving Averages are also sometimes referred to as \"moving mean\",\n#' \"rolling mean\", \"rolling average\" or \"running average\".\n#'\n#' The mean in this implementation taken from an equal number of observations\n#' on either side of a central value. This means for an NA value at position\n#' \\code{i} of a time series, the observations i-1,i+1 and i+1, i+2 (assuming\n#' a window size of k=2) are used to calculate the mean.\n#'\n#' Since it can in case of long NA gaps also occur, that all values next to the\n#' central value are also NA, the algorithm has a semi-adaptive window size.\n#' Whenever there are less than 2 non-NA values in the complete window available,\n#' the window size is incrementally increased, till at least 2 non-NA values are\n#' there. In all other cases the algorithm sticks to the pre-set window size.\n#'\n#' There are options for using Simple Moving Average (SMA), Linear Weighted\n#' Moving Average (LWMA) and Exponential Weighted Moving Average (EWMA).\n#'\n#' SMA: all observations in the window are equally weighted for calculating the mean.\n#'\n#' LWMA: weights decrease in arithmetical progression. The observations\n#' directly next to a central value i, have weight 1/2, the observations\n#' one further away (i-2,i+2) have weight 1/3, the next (i-3,i+3) have\n#' weight 1/4, ...\n#'\n#' EWMA: uses weighting factors which decrease exponentially. The observations\n#' directly next to a central value i, have weight 1/2^1, the observations one\n#' further away (i-2,i+2) have weight 1/2^2, the next (i-3,i+3) have weight 1/2^3, ...\n#'\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#' \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Example 1: Perform imputation with simple moving average\n#' na_ma(tsAirgap, weighting = \"simple\")\n#'\n#' # Example 2: Perform imputation with exponential weighted moving average\n#' na_ma(tsAirgap)\n#'\n#' # Example 3: Perform imputation with exponential weighted moving average, window size 6\n#' na_ma(tsAirgap, k = 6)\n#'\n#' # Example 4: Same as example 1, just written with pipe operator\n#' tsAirgap %>% na_ma(weighting = \"simple\")\n#' @importFrom magrittr %>%\n#' @export\n\nna_ma <- function(x, k = 4, weighting = \"exponential\", maxgap = Inf) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_ma(data[, i], k, weighting, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_ma: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 2) {\n      stop(\"At least 2 non-NA data points required in the time series to apply na_ma.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    # 1.6 Check for wrong values of param k\n    if (k < 1) {\n      stop(\"Parameter k has to be larger than 0.\")\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    # Imputation is performed i C++ code na_ma.cpp\n    data <- ma(data, k, weighting)\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_mean.R",
    "content": "#' @title Missing Value Imputation by Mean Value\n#'\n#' @description Missing value replacement by mean values. Different means\n#' like median, mean, mode possible.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param option Algorithm to be used. Accepts the following input:\n#' \\itemize{\n#'    \\item{\"mean\" - take the mean for imputation (default choice)}\n#'    \\item{\"median\" - take the median for imputation}\n#'    \\item{\"mode\" - take the mode for imputation}\n#'    \\item{\"harmonic\" - take the harmonic mean}\n#'    \\item{\"geometric\" - take the geometric mean}\n#'    }\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details Missing values get replaced by overall mean values. The function\n#' calculates the mean, median, mode, harmonic or geometric mean over all the non-NA\n#' values and replaces all NAs with this value. Option 'mode' replaces NAs with\n#' the most frequent value in the time series. If two or more values occur equally frequent,\n#' the function imputes the lower value. Due to their calculation formula geometric and harmonic\n#' mean are not well defined for negative values or zero values in the input series.\n#'\n#' In general using the mean for imputation imputation is mostly a suboptimal choice and should\n#' be handled with great caution.\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Prerequisite: Create Time series with missing values\n#' x <- ts(c(2, 3, 4, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Perform imputation with the overall mean\n#' na_mean(x)\n#'\n#' # Example 2: Perform imputation with overall median\n#' na_mean(x, option = \"median\")\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' x %>% na_mean()\n#' @importFrom magrittr %>%\n#' @importFrom stats median ts\n#' @export\n#'\nna_mean <- function(x, option = \"mean\", maxgap = Inf) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_mean(data[, i], option, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_mean: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (all(missindx)) {\n      stop(\"Input data has only NA values. At least 1 non-NA data point required in the time series to apply na_mean.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    if (option == \"median\") {\n      # Use Median\n      median <- stats::median(data, na.rm = TRUE)\n      data[missindx] <- median\n    }\n    else if (option == \"mode\") {\n      # Calculate Mode\n      temp <- table(as.vector(data))\n      mode <- names(temp)[temp == max(temp)]\n      mode <- (as.numeric(mode))[1]\n      data[missindx] <- mode\n    }\n    else if (option == \"mean\") {\n      # Use arithmetic Mean\n      mean <- mean(data, na.rm = TRUE)\n      data[missindx] <- mean\n    }\n    else if (option == \"geometric\") {\n      # Use geometric Mean\n\n      # Check preconditions\n      if (any(data == 0 | data < 0, na.rm = T)) {\n        stop(\n          \"The input data contains 0 and/or negative values.\\n\",\n          \"The geometric and harmonic mean are not well defined for these cases.\\n\",\n          \"Please another option like e.g. option = 'mean' in this case.\"\n        )\n      }\n      mean <- exp(mean(log(data), na.rm = TRUE))\n      data[missindx] <- mean\n    }\n    else if (option == \"harmonic\") {\n      # Use harmonic Mean\n\n      # Check preconditions\n      if (any(data == 0 | data < 0, na.rm = T)) {\n        stop(\n          \"The input data contains 0 and/or negative values.\\n\",\n          \"The geometric and harmonic mean are not well defined for these cases.\\n\",\n          \"Please another option like e.g. option = 'mean' in this case.\"\n        )\n      }\n      mean <- 1 / mean(1 / data, na.rm = TRUE)\n      data[missindx] <- mean\n    }\n    else {\n      stop(\"Wrong 'option' parameter given, must be either: \\n'mean', 'mode', 'median', 'harmonic' or 'geometric'.\")\n    }\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_random.R",
    "content": "#' @title Missing Value Imputation by Random Sample\n#'\n#' @description Replaces each missing value by drawing a random sample\n#' between two given bounds.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param lower_bound Lower bound for the random samples.\n#' If nothing or NULL is set min(x) will be used.\n#'\n#' @param upper_bound Upper bound for the random samples.\n#' If nothing or NULL is set man(x) will be used.\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details Replaces each missing value by drawing a random sample between two\n#' given bounds. The default bounds are the minimum and the maximum value in\n#' the non-NAs from the time series. Function uses \\link{runif} function to get\n#' the random values.\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Prerequisite: Create Time series with missing values\n#' x <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Replace all NAs by random values that are between min and max of the input time series\n#' na_random(x)\n#'\n#' # Example 2: Replace all NAs by random values between 1 and 10\n#' na_random(x, lower_bound = 1, upper_bound = 10)\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' x %>% na_random()\n#' @importFrom stats runif ts\n#' @importFrom magrittr %>%\n#' @export\n\nna_random <- function(x, lower_bound = NULL, upper_bound = NULL, maxgap = Inf) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_random(data[, i], lower_bound, upper_bound, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_random: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 2 && !(!is.null(upper_bound) && !is.null(lower_bound))) {\n      stop(\"At least 2 non-NA data points required in the time series to apply na_random\n           with the default lower_bound and upper_bound settings.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n\n    # Combined with check if all NA present, since an all NA vector returns FALSE for is.numeric\n    if (!is.numeric(data) & !all(is.na(data))) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    # 1.6 Check and set values for param lower_bound and upper_bound\n\n    # If lower or upper bound is NULL, which is the function default usw min/max\n    if (is.null(lower_bound)) {\n      lower_bound <- min(data, na.rm = TRUE)\n    }\n    if (is.null(upper_bound)) {\n      upper_bound <- max(data, na.rm = TRUE)\n    }\n\n    if (!is.numeric(lower_bound)) {\n      stop(\"Error for parameter lower_bound: Has to be a numeric value or NULL.\")\n    }\n\n    if (!is.numeric(upper_bound)) {\n      stop(\"Error for parameter upper_bound: Has to be a numeric value or NULL.\")\n    }\n\n    # For user set upper and lower bounds check if they make sense\n    if (lower_bound >= upper_bound) {\n      stop(\"Error for parameter lower_bound: lower_bound must be smaller than upper_bound.\n\n           In case you are using the default settings for these two parameters\n           (which use the min and max of the input series as bounds for the random numbers)\n           appearance of this error message means all values of your time series have the same\n           unique value. In this case try to set the bounds manually.\")\n    }\n\n\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    data[missindx] <- stats::runif(length(data[missindx]),\n      min = lower_bound, max = upper_bound\n    )\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_remove.R",
    "content": "#' @title Remove Missing Values\n#'\n#' @description Removes all missing values from a time series.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @return Vector (\\code{\\link{vector}})\n#'\n#' @details Removes all missing values from a input time series. This shortens\n#' the time series by the number of missing values in the series. Should be\n#' handled with care, because this can affect the seasonality of the time\n#' series. Seasonal patterns might be destroyed. Independent from the input,\n#' this function only returns a vector. (the time information of a resulting\n#' time series object wouldn't be correct any more).\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Example 1: Remove all NAs\n#' # Create Time series with missing values\n#' x <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Remove all NAs\n#' na_remove(x)\n#'\n#' # Example 2: Remove all NAs in tsAirgap\n#' na_remove(tsAirgap)\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' x %>% na_remove()\n#' @importFrom stats ts\n#' @importFrom magrittr %>%\n#' @export\n\nna_remove <- function(x) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    stop(\"na_remove only works with univariate input\")\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (all(missindx)) {\n      stop(\"Input data has solely NA values.\")\n    }\n\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    temp <- numeric()\n    for (i in 1:length(data)) {\n      if (!is.na(data[i])) {\n        temp <- c(temp, data[i])\n      }\n    }\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # No Post Processing needed for na_remove\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Since all time information of a ts object would be incorrect\n    # after removing values only the vector is returned by the function\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(temp)\n  }\n}\n"
  },
  {
    "path": "R/na_replace.R",
    "content": "#' @title Replace Missing Values by a Defined Value\n#'\n#' @description Replaces all missing values with a given value.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#'\n#' @param fill Value used to replace the missing values\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}},\n#'  \\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Prerequisite: Create Time series with missing values\n#' x <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n#'\n#' # Example 1: Replace all NAs with 3.5\n#' na_replace(x, fill = 3.5)\n#'\n#' # Example 2: Replace all NAs with 0\n#' na_replace(x, fill = 0)\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' x %>% na_replace(fill = 3.5)\n#' @importFrom stats ts\n#' @importFrom magrittr %>%\n#' @export\n\nna_replace <- function(x, fill = 0, maxgap = Inf) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_replace(data[, i], fill, maxgap),\n        error = function(cond) {\n          warning(paste(\n            \"na_replace: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    # Not needed for na_replace, it works with all-NA vectors\n\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n\n    # Combined with check if all NA present, since an all NA vector returns FALSE for is.numeric\n    if (!is.numeric(data) & !all(is.na(data))) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    data[missindx] <- fill\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_seadec.R",
    "content": "#' @title Seasonally Decomposed Missing Value Imputation\n#'\n#' @description Removes the seasonal component from the time series,\n#' performs imputation on the deseasonalized series and afterwards adds\n#' the seasonal component again.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#' @param algorithm Algorithm to be used after decomposition.\n#' Accepts the following input:\n#' \\itemize{\n#'    \\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n#'    \\item{\"locf\" - Imputation by Last Observation Carried Forward}\n#'    \\item{\"mean\" - Imputation by Mean Value}\n#'    \\item{\"random\" - Imputation by Random Sample}\n#'    \\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n#'    \\item{\"ma\" - Imputation by Weighted Moving Average}\n#'    }\n#' @param find_frequency If TRUE the algorithm will try to estimate the frequency\n#' of the time-series automatically.\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @param ... Additional parameters for these algorithms that can be passed\n#' through. Look at \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n#' \\code{\\link[imputeTS]{na_mean}} for parameter options.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @details The algorithm first performs a Seasonal Decomposition of Time Series by Loess\n#' via \\code{\\link[stats]{stl}}. Decomposing the time series into seasonal, trend and irregular\n#' components. The seasonal component gets then removed (subtracted) from the original series.\n#' As a second step the selected imputation algorithm e.g. na_locf, na_ma, ...  is applied\n#' on the deseasonalized series. Thus, the algorithm can work without being affected by seasonal\n#' patterns. After filling the NA gaps, the seasonal component is added to the deseasonalized\n#' series again.\n#'\n#' Implementation details:\n#' A paper about the STL Decomposition procedure is linked in the references.\n#' Since the function only works with complete data, the initial NA data is temporarily filled\n#' via linear interpolation in order to perform the decomposition. These temporarily imputed\n#' values are replaced with NAs again after obtaining the decomposition for the non-NA\n#' observations. STL decomposition is run with robust = TRUE and s.window = 11. Additionally,\n#' applying STL decomposition needs a preset frequency. This can be passed by the frequency\n#' set in the input ts object or by setting 'find_frequency=TRUE' in order to find\n#' an appropriate frequency for the time series. The find_frequency parameter internally uses\n#' \\code{\\link[forecast]{findfrequency}}, which does a spectral analysis of the time series\n#' for identifying a suitable frequency. Using find_frequency will update the previously set\n#' frequency of a ts object to the newly found frequency. The default is 'find_frequency = FALSE',\n#' which gives a warning if no seasonality is set for the supplied time series object.\n#' If neither seasonality is set nor find_frequency is set to TRUE, the function goes on without\n#' decomposition and just applies the selected secondary algorithm to the original time series\n#' that still includes seasonality.\n#'\n#'\n#' @references R. B. Cleveland, W. S. Cleveland, J.E. McRae, and I.\n#' Terpenning (1990) STL: A Seasonal-Trend Decomposition Procedure\n#' Based on Loess. Journal of Official Statistics, 6, 3–73.\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seasplit}}\n#'\n#' @examples\n#' # Example 1: Perform seasonal imputation using algorithm = \"interpolation\"\n#' na_seadec(tsAirgap, algorithm = \"interpolation\")\n#'\n#' # Example 2: Perform seasonal imputation using algorithm = \"mean\"\n#' na_seadec(tsAirgap, algorithm = \"mean\")\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' tsAirgap %>% na_seadec(algorithm = \"interpolation\")\n#' @importFrom stats frequency stl ts\n#' @importFrom forecast findfrequency\n#' @importFrom magrittr %>%\n#' @export\n\nna_seadec <- function(x, algorithm = \"interpolation\", find_frequency = FALSE, maxgap = Inf, ...) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_seadec(data[, i], algorithm, find_frequency, maxgap, ...),\n        error = function(cond) {\n          warning(paste(\n            \"na_seadec: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 3) {\n      stop(\"At least 3 non-NA data points required in the time series to apply na_seadec.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x.\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric.\")\n    }\n\n    # 1.6 Checks and corrections for time series frequency\n\n    # Try to findFrequency\n    if (find_frequency == TRUE) {\n      t <- as.vector(data)\n      freq <- forecast::findfrequency(na_interpolation(t))\n      if (freq > 1) {\n        data <- ts(t, frequency = freq)\n      }\n      else if (freq == 1) {\n        warning(\"Option find_frequency = TRUE could not detect a seasonal pattern.\n        The algorithm will go on without seasonal decomposition.\n        You might consider manually setting a frequency by creating a time series with frequency information.\n        Here is an example for weekly data: new_ts <- ts(old_ts, frequency = 7)\")\n        data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n        return(data)\n      }\n    }\n\n    if (stats::frequency(data) == 1) {\n      warning(\"No seasonality information for dataset could be found, going on without decomposition.\n              Setting find_frequency=TRUE might be an option.\")\n      data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n      return(data)\n    }\n\n    if (length(data) < stats::frequency(data) * 2) {\n      warning(\"More than 2 complete periods needed to perform a seasonal decomposition The algorithm will go on without seasonal decomposition.\")\n      data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n      return(data)\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    # Interpolate NAs, to get complete series, because findFRequency and later on stl does not work with NAs\n    temp <- na_interpolation(data)\n\n    # temp (see above) is a interpolated version of data since stl does not work with NAs\n    stl <- stats::stl(temp, robust = TRUE, s.window = 11)\n    # just take trend component + irregular  (remove seasonality)\n    ts_no_seasonality <- stl$time.series[, 2] + stl$time.series[, 3]\n\n    # Fill in NAs again\n    ts_no_seasonality[missindx] <- NA\n\n    # Perform imputation on data without seasonality\n    ts_no_seasonalityimputed <- apply_base_algorithm(ts_no_seasonality, algorithm = algorithm, ...)\n\n    # add seasonality\n    ts_imputed <- ts_no_seasonalityimputed + stl$time.series[, 1]\n\n    # Merge interpolated values back into original time series\n    data[missindx] <- ts_imputed[missindx]\n\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/na_seasplit.R",
    "content": "#' @title Seasonally Splitted Missing Value Imputation\n#'\n#' @description Splits the times series into seasons and afterwards performs\n#' imputation separately for each of the resulting time series datasets\n#' (each containing the data for one specific season).\n#\n#' @param x Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object in which missing values shall be replaced\n#' @param algorithm Algorithm to be used after splits.\n#' Accepts the following input:\n#' \\itemize{\n#'    \\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n#'    \\item{\"locf\" - Imputation by Last Observation Carried Forward}\n#'    \\item{\"mean\" - Imputation by Mean Value}\n#'    \\item{\"random\" - Imputation by Random Sample}\n#'    \\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n#'    \\item{\"ma\" - Imputation by Weighted Moving Average}\n#'    }\n#'\n#' @param find_frequency If TRUE the algorithm will try to estimate the frequency\n#' of the time-series automatically.\n#'\n#' @param maxgap Maximum number of successive NAs to still perform imputation on.\n#'  Default setting is to replace all NAs without restrictions. With this\n#'  option set, consecutive NAs runs, that are longer than 'maxgap' will\n#'  be left NA. This option mostly makes sense if you want to\n#'  treat long runs of NA afterwards separately.\n#'\n#' @param ... Additional parameters for these algorithms that can be\n#' passed through. Look at \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n#' \\code{\\link[imputeTS]{na_mean}} for parameter options.\n#'\n#' @return Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\n#' object (dependent on given input at parameter x)\n#'\n#' @author Steffen Moritz\n#'\n#' @seealso  \\code{\\link[imputeTS]{na_interpolation}},\n#' \\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n#'  \\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n#'  \\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n#'  \\code{\\link[imputeTS]{na_seadec}}\n#'\n#' @examples\n#' # Example 1: Perform seasonal splitted imputation using algorithm = \"interpolation\"\n#' na_seasplit(tsAirgap, algorithm = \"interpolation\")\n#'\n#' # Example 2: Perform seasonal splitted imputation using algorithm = \"mean\"\n#' na_seasplit(tsAirgap, algorithm = \"mean\")\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' tsAirgap %>% na_seasplit(algorithm = \"interpolation\")\n#' @importFrom stats frequency ts\n#' @importFrom magrittr %>%\n#' @export\n#' @name na_seasplit\n\nna_seasplit <- function(x, algorithm = \"interpolation\", find_frequency = FALSE, maxgap = Inf, ...) {\n\n  # Variable 'data' is used for all transformations to the time series\n  # 'x' needs to stay unchanged to be able to return the same ts class in the end\n  data <- x\n\n\n  #----------------------------------------------------------\n  # Mulivariate Input\n  # The next 20 lines are just for checking and handling multivariate input.\n  #----------------------------------------------------------\n\n  # Check if the input is multivariate\n  if (!is.null(dim(data)[2]) && dim(data)[2] > 1) {\n    # Go through columns and impute them by calling this function with univariate input\n    for (i in 1:dim(data)[2]) {\n      if (!anyNA(data[, i])) {\n        next\n      }\n      # if imputing a column does not work - mostly because it is not numeric - the column is left unchanged\n      tryCatch(\n        data[, i] <- na_seasplit(data[, i], algorithm, find_frequency, maxgap, ...),\n        error = function(cond) {\n          warning(paste(\n            \"na_seasplit: No imputation performed for column\", i, \"of the input dataset.\n                Reason:\", cond[1]\n          ), call. = FALSE)\n        }\n      )\n    }\n    return(data)\n  }\n\n\n  #----------------------------------------------------------\n  # Univariate Input\n  # All relveant imputation / pre- postprocessing  code is within this part\n  #----------------------------------------------------------\n\n  else {\n    missindx <- is.na(data)\n\n    ##\n    ## 1. Input Check and Transformation\n    ##\n\n\n    # 1.1 Check if NAs are present\n    if (!anyNA(data)) {\n      return(x)\n    }\n\n    # 1.2 special handling data types\n    if (any(class(data) == \"tbl\")) {\n      data <- as.vector(as.data.frame(data)[, 1])\n    }\n\n    # 1.3 Check for algorithm specific minimum amount of non-NA values\n    if (sum(!missindx) < 3) {\n      stop(\"At least 3 non-NA data points required in the time series to apply na_seasplit.\")\n    }\n\n    # 1.4 Checks and corrections for wrong data dimension\n\n    # Check if input dimensionality is not as expected\n    if (!is.null(dim(data)[2]) && !dim(data)[2] == 1) {\n      stop(\"Wrong input type for parameter x\")\n    }\n\n    # Altering multivariate objects with 1 column (which are essentially\n    # univariate) to be dim = NULL\n    if (!is.null(dim(data)[2])) {\n      data <- data[, 1]\n    }\n\n    # 1.5 Check if input is numeric\n    if (!is.numeric(data)) {\n      stop(\"Input x is not numeric\")\n    }\n\n\n    # 1.6 Checks and corrections for time series frequency\n\n    # Try to findFrequency\n    if (find_frequency == TRUE) {\n      t <- as.vector(data)\n      freq <- forecast::findfrequency(na_interpolation(t))\n      if (freq > 1) {\n        data <- ts(t, frequency = freq)\n      }\n      else if (freq == 1) {\n        warning(\"Parameter find_frequency = TRUE could not detect a seasonal pattern.\n        The algorithm will go on without seasonal decomposition.\n        You might consider manually setting a frequency by creating a time series with frequency information.\n        Here is an example for weekly data: new_ts <- ts(old_ts, frequency = 7)\")\n        data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n        return(data)\n      }\n    }\n\n    if (stats::frequency(data) == 1) {\n      warning(\"No seasonality information for dataset could be found,\n                going on without decomposition.\n                Setting find_frequency=TRUE might be an option.\")\n      data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n      return(data)\n    }\n\n    if (length(data) < stats::frequency(data) * 2) {\n      warning(\"More than 2 complete periods needed to perform a seasonal split.\n               The algorithm will go on without seasonal split.\")\n      data <- apply_base_algorithm(data, algorithm = algorithm, ...)\n      return(data)\n    }\n\n    ##\n    ## End Input Check and Transformation\n    ##\n\n\n    ##\n    ## 2. Imputation Code\n    ##\n\n    for (i in 1:stats::frequency(data)) {\n\n      # get indices for one season\n      indices <- seq(from = i, to = length(data), by = stats::frequency(data))\n\n      # Create time series just with one season\n      ts_temp <- stats::ts(data[indices])\n\n      # Apply algorithm on this season\n      ts_temp <- apply_base_algorithm(ts_temp, algorithm = algorithm, ...)\n\n      # Write result back into original time series\n      data[indices] <- as.vector(ts_temp)\n    }\n\n    ##\n    ## End Imputation Code\n    ##\n\n\n    ##\n    ## 3. Post Processing\n    ##\n\n    # 3.1 Check for Maxgap option\n\n    # If maxgap = Inf then do nothing and when maxgap is lower than 0\n    if (is.finite(maxgap) && maxgap >= 0) {\n\n      # Get logical vector of the time series via is.na() and then get the\n      # run-length encoding of it. The run-length encoding describes how long\n      # the runs of FALSE and TRUE are\n      rlencoding <- rle(is.na(x))\n\n      # Runs smaller than maxgap (which shall still be imputed) are set FALSE\n      rlencoding$values[rlencoding$lengths <= maxgap] <- FALSE\n\n      # The original vector is being reconstructed by reverse.rls, only now the\n      # longer runs are replaced now in the logical vector derived from is.na()\n      # in the beginning all former NAs that are > maxgap are also FALSE\n      en <- inverse.rle(rlencoding)\n\n      # Set all positions in the imputed series with gaps > maxgap to NA\n      # (info from en vector)\n      data[en == TRUE] <- NA\n    }\n\n    ##\n    ## End Post Processing\n    ##\n\n\n    ##\n    ## 4. Final Output Formatting\n    ##\n\n    # Give back the object originally supplied to the function\n    # (necessary for multivariate input with only 1 column)\n    if (!is.null(dim(x)[2])) {\n      x[, 1] <- data\n      return(x)\n    }\n\n    ##\n    ## End Final Output Formatting\n    ##\n\n    return(data)\n  }\n}\n"
  },
  {
    "path": "R/statsNA.R",
    "content": "\n#' @title Print Statistics about Missing Values\n#'\n#' @description Print summary stats about the distribution of\n#' missing values in a univariate time series.\n#'\n#' @param x Numeric Vector (\\code{\\link{vector}}) or\n#' Time Series (\\code{\\link{ts}}) object containing NAs\n#'\n#' @param bins Split number for bin stats. Number of bins the time series gets\n#' divided into. For each bin information about amount/percentage of missing\n#' values is printed. Default value is 4 - what means stats about the\n#' 1st,2nd,3rd,4th quarter of the time series are shown.\n#'\n#' @param print_only Choose if the function Prints or Returns.\n#' For print_only = TRUE the function has no return value and just prints out\n#' missing value stats. If print_only is changed to FALSE, nothing is printed\n#' and the function returns a list.Print gives a little bit more information,\n#' since the returned list does not include \"Stats for Bins\"\n#' and \"overview NA series\"\n#'\n#' @return A \\code{\\link{list}} containing the stats. Beware: Function gives\n#' only a return value if print_only = FALSE.\n#'\n#' @details Prints the following information about the missing values in the time series:\n#' \\itemize{\n#'    \\item{\"Length of time series\" - Number of observations in the time series (including NAs)}\n#'    \\item{\"Number of Missing Values\" - Number of missing values in the time series}\n#'    \\item{\"Percentage of Missing Values\" - Percentage of missing values in the time series}\n#'    \\item{\"Number of Gaps\" - Number of NA gaps (consisting of one or more consecutive NAs) in the time series}\n#'    \\item{\"Average Gap Size\" - Average size of consecutive NAs for the NA gaps in the time series}\n#'    \\item{\"Stats for Bins\" - Number/percentage of missing values for the split into bins }\n#'    \\item{\"Longest NA gap\" - Longest series of consecutive missing values (NAs in a row) in the time series }\n#'    \\item{\"Most frequent gap size\" - Most frequent occurring series of missing values in the time series}\n#'    \\item{\"Gap size accounting for most NAs\" - The series of consecutive missing values that accounts for most missing values overall in the time series}\n#'    \\item{\"Overview NA series\" - Overview about how often each series of consecutive missing values occurs. Series occurring 0 times are skipped}\n#'    }\n#'    It is furthermore, important to note, that you are able to choose whether\n#'    the function returns a list or prints the information only.\n#'    (see description of parameter \"print_only\")\n#'\n#' @author Steffen Moritz\n#' @seealso \\code{\\link[imputeTS]{ggplot_na_distribution}},\n#' \\code{\\link[imputeTS]{ggplot_na_distribution2}}, \n#' \\code{\\link[imputeTS]{ggplot_na_gapsize}}\n#'\n#' @examples\n#' # Example 1: Print stats about the missing data in tsNH4\n#' statsNA(tsNH4)\n#'\n#' # Example 2: Return list with stats about the missing data in tsAirgap\n#' statsNA(tsAirgap, print_only = FALSE)\n#'\n#' # Example 3: Same as example 1, just written with pipe operator\n#' tsNH4 %>% statsNA()\n#' @importFrom magrittr %>%\n#' @export\n\n\nstatsNA <- function(x, bins = 4, print_only = TRUE) {\n  data <- x\n\n  ##\n  ## Input check\n  ##\n\n  if (!is.null(dim(data)) && dim(data)[2] != 1) {\n    stop(\"Input x is not univariate\")\n  }\n\n  if (!is.numeric(data)) {\n    stop(\"Input x is not numeric\")\n  }\n\n\n  ##\n  ## Analysis Code\n  ##\n\n  missindx <- is.na(data)\n\n  ## Count NAs\n  number_NAs <- length(data[missindx])\n\n  ## Calculate Percentage\n  pct_NAs <- number_NAs / length(data) * 100\n\n\n\n  ## NA in Bins // bins_df is result data frame\n\n  # Create DF to store information for each bin\n  bins_df <- data.frame(\n    start = numeric(bins), end = numeric(bins), num = numeric(bins),\n    num_NA = numeric(bins), num_nonNA = numeric(bins), pct_NA = numeric(bins)\n  )\n\n\n  length_bin <- ceiling(length(data) / bins)\n\n  temp <- 0\n  for (i in 1:bins) {\n    bins_df$start[i] <- temp + 1\n    temp <- temp + length_bin\n    bins_df$end[i] <- temp\n  }\n  bins_df$end[bins] <- length(data)\n\n\n  for (i in 1:bins) {\n    bins_df$num[i] <- bins_df$end[i] - bins_df$start[i] + 1\n    temp_data <- data[bins_df$start[i]:bins_df$end[i]]\n    bins_df$num_NA[i] <- length(temp_data[is.na(temp_data)])\n    bins_df$num_nonNA[i] <- bins_df$num[i] - bins_df$num_NA[i]\n    bins_df$pct_NA[i] <- bins_df$num_NA[i] / bins_df$num[i] * 100\n  }\n\n\n\n  ## Consecutive NAs // vec is result vector\n\n  vec <- rep(0, length(data))\n  run <- 0\n  for (i in 0:(length(data) - 1)) {\n    if (is.na(data[i + 1])) {\n      run <- run + 1\n      if (i == (length(data) - 1)) {\n        vec[run] <- vec[run] + 1\n      }\n    }\n    else {\n      vec[run] <- vec[run] + 1\n      run <- 0\n    }\n  }\n\n  # Most Common Consecutive NA\n  max <- 0\n  indx <- 0\n  for (i in 1:length(vec)) {\n    if (vec[i] >= max) {\n      max <- vec[i]\n      indx <- i\n    }\n  }\n  common_NA <- indx\n  common_NAnum <- max\n\n  # Longest Consecutive NA\n  longest_NA <- NA\n  for (i in length(vec):1) {\n    if (vec[i] > 0) {\n      longest_NA <- i\n      break\n    }\n  }\n\n  # Biggest Weight Consecutive NA\n  max <- 0\n  indx <- 0\n  for (i in 1:length(vec)) {\n    if (vec[i] * i >= max) {\n      max <- vec[i] * i\n      indx <- i\n    }\n  }\n  wcommon_NA <- indx\n  wcommon_NAnum <- max\n\n\n  # Average NA gapsize\n\n  number_gaps <- sum(vec)\n  if (number_NAs > 0) {\n    average_gapsize <- number_NAs / number_gaps\n  }\n  else {\n    average_gapsize <- 0\n  }\n\n\n\n  #### Print everything\n  if (print_only == TRUE) {\n\n    ## Print Number NA and Pct NA\n    print(\"Length of time series:\")\n    print(length(data))\n    print(\"-------------------------\")\n\n    print(\"Number of Missing Values:\")\n    print(number_NAs)\n    print(\"-------------------------\")\n\n    print(\"Percentage of Missing Values:\")\n    print(paste0(format(pct_NAs, digits = 3), \"%\"))\n    print(\"-------------------------\")\n\n    print(\"Number of Gaps:\")\n    print(number_gaps)\n    print(\"-------------------------\")\n\n    print(\"Average Gap Size:\")\n    print(average_gapsize)\n    print(\"-------------------------\")\n\n    # Exit if no NAs\n    if (number_NAs < 1) {\n      print(\"No NAs in the time series.\")\n      print(\"-------------------------\")\n      return(\"There are no NAs in the time series\")\n    }\n\n    ## Print bin stats\n    print(\"Stats for Bins\")\n    for (i in 1:length(bins_df$num)) {\n      print(paste0(\n        \"  Bin \", i, \" (\", bins_df$num[i], \" values from \", bins_df$start[i], \" to \",\n        bins_df$end[i], \") :      \", bins_df$num_NA[i],\n        \" NAs (\", format(bins_df$pct_NA[i], digits = 3), \"%)\"\n      ))\n    }\n    print(\"-------------------------\")\n\n    ## Print Consecutive NAs\n    print(\"Longest NA gap (series of consecutive NAs)\")\n    print(paste(longest_NA, \"in a row\"))\n    print(\"-------------------------\")\n    print(\"Most frequent gap size (series of consecutive NA series)\")\n    print(paste0(common_NA, \" NA in a row (occurring \", common_NAnum, \" times)\"))\n    print(\"-------------------------\")\n    print(\"Gap size accounting for most NAs\")\n    print(paste0(wcommon_NA, \" NA in a row (occurring \", wcommon_NAnum / wcommon_NA, \n                 \" times, making up for overall \", wcommon_NAnum, \" NAs)\"))\n    print(\"-------------------------\")\n\n    print(\"Overview NA series\")\n\n    for (i in 1:length(vec)) {\n      if (vec[i] > 0) {\n        print(paste0(\"  \", i, \" NA in a row: \", vec[i], \" times\"))\n      }\n    }\n  }\n\n  if (print_only == FALSE) {\n    output <- list(\n      length_series = length(data),\n      number_NAs = number_NAs,\n      number_na_gaps = number_gaps,\n      average_size_na_gaps = average_gapsize,\n      percentage_NAs = paste0(format(pct_NAs, digits = 3), \"%\"),\n      longest_na_gap = longest_NA,\n      most_frequent_na_gap = common_NA,\n      most_weighty_na_gap = wcommon_NA,\n      df_distribution_na_gaps = vec\n    )\n\n    return(output)\n  }\n}\n"
  },
  {
    "path": "R/tsAirgap.R",
    "content": "#' @title Time series of monthly airline passengers (with NAs)\n#'\n#' @description Monthly totals of international airline passengers, 1949 to 1960.\n#' This time series contains missing values. In the package included is also the \\code{\\link{tsAirgapComplete}} time series providing the true values for the\n#' missing values.\n#' \n#' @details The dataset originates from Box and Jenkins (see citation) and is a commonly used example in\n#' time series analysis literature.\n#' \n#' It characteristics (strong trend, strong seasonal behavior) make it also a great \n#' example for time series imputation.\n#' Thus the version with inserted NA gaps was created under the name tsAirgap.\n#'\n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. \n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsAirgap - The time series with NAs.\n#'\n#'   \\item tsAirgapComplete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsHeating}}, \\code{\\link[imputeTS]{tsNH4}}\n#' @name tsAirgap\n#' @usage tsAirgap\n#' \n#' \n#' @source \\cite{Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.}\n#' @format Time Series (\\code{\\link{ts}}) with 144 rows including 13 NAs.\nNULL"
  },
  {
    "path": "R/tsAirgapComplete.R",
    "content": "#' @title Time series of monthly airline passengers (complete)\n#'\n#' @description Monthly totals of international airline passengers, 1949 to 1960.\n#' This time series provides the truth for the missing values of the \\code{\\link{tsAirgap}} time series. Thus it is identical\n#' to the tsAirgap time series except that no value is missing.\n#' \n#' @details The dataset originates from Box and Jenkins (see citation) and is a commonly used example in\n#' time series analysis literature.\n#' \n#' It characteristics (strong trend, strong seasonal behavior) make it also a great \n#' example for time series imputation.\n#' Thus the version with inserted NA gaps was created under the name tsAirgap.\n#'\n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. \n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsAirgap - The time series with NAs.\n#'\n#'   \\item tsAirgapComplete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsHeating}}, \\code{\\link[imputeTS]{tsNH4}}\n#' @name tsAirgapComplete\n#' @usage tsAirgapComplete\n#' @source \\cite{Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.}\n#' @format Time Series (\\code{\\link{ts}}) with 144 rows.\nNULL"
  },
  {
    "path": "R/tsHeating.R",
    "content": "#' @title Time series of a heating systems supply temperature (with NAs)\n#'\n#' @description Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\n#' This time series contains missing values. In the package included is also the \\code{\\link{tsHeatingComplete}} time series providing the true values for the\n#' missing values.\n#' \n#' @details The time series originates from the GECCO Industrial Challenge 2015.\n#' This Challenge was about \"Recovering missing information in heating system operating data\".\n#' Goal was to impute missing values in heating system sensor data as accurate as possible.\n#' (\\doi{10.5281/zenodo.3884899})\n#'\n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. The NAs thereby were inserted according to patterns\n#' found in similar time series.\n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsHeating - The time series with NAs.\n#'\n#'   \\item tsHeatingComplete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsAirgap}}, \\code{\\link[imputeTS]{tsNH4}}\n#' @name tsHeating\n#' @usage tsHeating\n#' \n#' @source \\cite{Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt, \n#' Christopher, and Bartz-Beielstein, Thomas. (2015, May 1). \n#' GECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering \n#' missing information in heating system operating data' competition at the \n#' Genetic and Evolutionary Computation Conference 2015, Madrid, Spain. \n#' http://doi.org/10.5281/zenodo.3884899 }\n#' \n#' @format Time Series (\\code{\\link{ts}}) with 606837 rows including 57391 NAs.\nNULL"
  },
  {
    "path": "R/tsHeatingComplete.R",
    "content": "#' @title Time series of a heating systems supply temperature (complete)\n#'\n#' @description Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\n#' This time series provides the truth for the missing values of the \\code{\\link{tsHeating}} time series. Thus it is identical\n#' to the heating time series except that no value is missing.\n#' \n#' @details The time series originates from the GECCO Industrial Challenge 2015.\n#' This Challenge was about \"Recovering missing information in heating system operating data\".\n#' Goal was to impute missing values in heating system sensor data as accurate as possible.\n#' (\\doi{10.5281/zenodo.3884899})\n#'\n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. The NAs thereby were inserted according to patterns\n#' found in similar time series.\n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsHeating - The time series with NAs.\n#'\n#'   \\item tsHeatingComplete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsAirgap}}, \\code{\\link[imputeTS]{tsNH4}}\n#' @name tsHeatingComplete\n#' @usage tsHeatingComplete\n#' \n#' @source \\cite{Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt, \n#' Christopher, and Bartz-Beielstein, Thomas. (2015, May 1). \n#' GECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering \n#' missing information in heating system operating data' competition at the \n#' Genetic and Evolutionary Computation Conference 2015, Madrid, Spain. \n#' http://doi.org/10.5281/zenodo.3884899 }\n#' \n#' @format Time Series (\\code{\\link{ts}}) with 606837 rows.\nNULL"
  },
  {
    "path": "R/tsNH4.R",
    "content": "#' @title Time series of NH4 concentration in a wastewater system (with NAs)\n#' \n#' @description Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\n#' This time series contains missing values. In the package included is also the \\code{\\link{tsNH4Complete}} time series providing the true values for the\n#' missing values.\n#' \n#' @details The time series is derived from the dataset of the  GECCO Industrial Challenge 2014.\n#' \n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. The NAs thereby were inserted according to patterns\n#' found in similar time series.\n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsNH4 - The time series with NAs.\n#'\n#'   \\item tsNH4Complete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsAirgap}},\\code{\\link[imputeTS]{tsHeating}}\n#' @name tsNH4\n#' @usage tsNH4\n#' \n#' @source \\cite{Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\n#' Bartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16). \n#' GECCO Industrial Challenge 2014 Dataset: A water quality dataset for the \n#' 'Active protection against pollution of the surface water' competition at the \n#' Genetic and Evolutionary Computation Conference 2015, Vancouver, Canada. \n#' http://www.spotseven.de/gecco-challenge/gecco-challenge-2014}\n#' \n#' @format Time Series (\\code{\\link{ts}}) with 4552 rows including 883 NAs.\nNULL"
  },
  {
    "path": "R/tsNH4Complete.R",
    "content": "#' @title Time series of NH4 concentration in a wastewater system (complete)\n#' \n#' @description Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\n#' This time series provides the truth for the missing values of the \\code{\\link{tsNH4}} time series. Thus it is identical\n#' to the heating time series except that no value is missing.\n\n#' @details The time series is derived from the dataset of the  GECCO Industrial Challenge 2014.\n#' \n#' In order to use this series for comparing imputation algorithm results,\n#' there are two time series provided. One series without missing values, which can\n#' be used as ground truth. Another series with NAs, on which the imputation \n#' algorithms can be applied. The NAs thereby were inserted according to patterns\n#' found in similar time series.\n#' \n#' There are the two time series:\n#' \\itemize{\n#'   \\item tsNH4 - The time series with NAs.\n#'\n#'   \\item tsNH4Complete - Time series without NAs.\n#' }\n#' @docType data\n#' @keywords datasets\n#' @seealso \\code{\\link[imputeTS]{tsAirgap}},\\code{\\link[imputeTS]{tsHeating}}\n#' @name tsNH4Complete\n#' @usage tsNH4Complete\n#' \n#' @source \\cite{Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\n#' Bartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16). \n#' GECCO Industrial Challenge 2014 Dataset: A water quality dataset for the \n#' 'Active protection against pollution of the surface water' competition at the \n#' Genetic and Evolutionary Computation Conference 2015, Vancouver, Canada. \n#' http://www.spotseven.de/gecco-challenge/gecco-challenge-2014}#' \n#' \n#' @format Time Series (\\code{\\link{ts}}) with 4552 rows.\nNULL"
  },
  {
    "path": "README.md",
    "content": "  <!-- badges: start -->\n[![Project Status: Active The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![R-CMD-check](https://github.com/SteffenMoritz/imputeTS/workflows/R-CMD-check/badge.svg)](https://github.com/SteffenMoritz/imputeTS/actions)\n[![Codecov test coverage](https://codecov.io/gh/SteffenMoritz/imputeTS/branch/master/graph/badge.svg)](https://app.codecov.io/gh/SteffenMoritz/imputeTS?branch=master)\n[![CRAN Version](https://www.r-pkg.org/badges/version/imputeTS)](https://cran.r-project.org/package=imputeTS)\n[![CRAN Release](https://www.r-pkg.org/badges/last-release/imputeTS\n)](https://cran.r-project.org/package=imputeTS)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/imputeTS)](https://cran.r-project.org/package=imputeTS)\n  <!-- badges: end -->\n\n# imputeTS: Time Series Missing Value Imputation <img src=\"man/figures/imputeTS-logo.png\" align=\"right\" width=\"565\" height=\"382\" alt=\"imputeTS Logo\" />\n\nThe imputeTS package specializes on (univariate) time series imputation. \nIt offers several different imputation algorithm implementations. Beyond the imputation algorithms the package also provides plotting and printing functions of time series missing data statistics. Additionally three time series datasets for imputation experiments are included.\n\n## Installation\n\nThe imputeTS package can be found on [CRAN]. For installation execute in R:\n\n```\n install.packages(\"imputeTS\")\n```\n\nIf you want to install the latest version from GitHub (can be unstable) run:\n\n```\nlibrary(devtools)\ninstall_github(\"SteffenMoritz/imputeTS\")\n```\n\n## Usage\n\n* #### Imputation\n\n  To impute (fill all missing values) in a time series ***x***, run the following\n  command:\n  ```\n   na_interpolation(x)\n  ```\n  Output is the time series ***x*** with all NA's replaced by reasonable values.\n\n  > This is just one example for an imputation algorithm. \n  > In this case interpolation was the algorithm of choice for \n  > calculating the NA replacements. There are several other \n  > algorithms (see also under caption [Imputation Algorithms](#imputation-algorithms)). All \n  > imputation functions   are named alike starting with\n  > na_ followed by a algorithm label  e.g. na_mean, na_kalman, ...\n\n\n* #### Plotting\n\n  To plot missing data statistics for a time series ***x***, run the following\n  command:\n  \n  ```\n   ggplot_na_distribution(x)\n  ```\n  \n  &nbsp;\n\n  <p align=\"center\">\n  <img src=\"man/figures/ggplot_na_distribution.png\" width=\"600\" height=\"350\" alt=\"Example ggplot_na_distribution plot\" />\n </p>\n  \n  \n  > This is just one exemplary plot. Overall there are five different types \n  > of missing data plots (see also under caption [Missing Data Plots](#missing-data-plots)). \n  > There is an additional tutorial just about plots available - the [Gallery of Visualizations].\n\n\n* #### Printing\n\n  To print descriptive statistics about the missing data in a time series ***x***, run the\n  following command:\n  ```\n   statsNA(x)\n  ```\n\n  \n* #### Example Datasets\n\n  To load the *'heating'* time series (with missing values)  into  a variable ***y*** and the *'heating'* time series (without missing values) into a variable ***z***, run: \n  \n  ```\n   y <- tsHeating\n   z <- tsHeatingComplete\n  ```\n  \n  > There are three datasets provided with the package, the *'tsHeating'*, the \n  > *'tsAirgap'* and the *'tsNH4'* time series (see also under caption [Datasets](#datasets)). \n\n\n## Imputation Algorithms {#imputation-algorithms}\n\nHere is a table with available algorithms to choose from:\n\n|      Function        |           Description                                      | \n| :--------------------|:-----------------------------------------------------------|\n| na_interpolation     |Missing Value Imputation by Interpolation                   |\n| na_kalman            |Missing Value Imputation by Kalman Smoothing                |\n| na_locf              |Missing Value Imputation by Last Observation Carried Forward|\n| na_ma                |Missing Value Imputation by Weighted Moving Average         |\n| na_mean              |Missing Value Imputation by Mean Value                      | \n| na_random            |Missing Value Imputation by Random Sample                   | \n| na_remove            |Remove Missing Values                                       | \n| na_replace           |Replace Missing Values by a Defined Value                   | \n| na_seadec            |Seasonally Decomposed Missing Value Imputation              | \n| na_seasplit          |Seasonally Splitted Missing Value Imputation                | \n\n  > This is a rather broad overview. The functions itself mostly offer more\n  > than just one algorithm. For example na_interpolation can be set to linear\n  > or spline interpolation.\n\nMore detailed information about the algorithms and their options can be found in the [imputeTS reference manual].\n\n## Missing Data Plots {#missing-data-plots}\n\nHere is a table with available plots to choose from:\n\n|      Function           |           Description                                        | \n| :-----------------------|:-------------------------------------------------------------|\n| ggplot_na_distribution  |Visualize Distribution of Missing Values                      |\n| ggplot_na_distribution2 |Missing Values Summarized in Time Intervals                   |\n| ggplot_na_gapsize       |Visualize Distribution of NA Gapsizes                         |\n| ggplot_na_gapsize2      |Visualize Total NAs of Different NA Gapsizes                  |\n| ggplot_na_imputations   |Visualize Imputed Values                                      | \n\nMore detailed information about the plots can be found in the [imputeTS reference manual] and in the [Gallery of Visualizations].\n\n\n### Datasets {#datasets}\n\nThere are three datasets (each in two versions) available:\n\n|      Dataset     |             Description                                          | \n| :----------------|:-----------------------------------------------------------------|\n| tsAirgap         |Time series of monthly airline passengers (with NAs)              |\n| tsAirgapComplete |Time series of monthly airline passengers (complete)   |\n| tsHeating        |Time series of a heating systems supply temperature (with NAs)    |\n| tsHeatingComplete|Time series of a heating systems supply temperature (complete)    |\n| tsNH4            |Time series of NH4 concentration in a wastewater system (with NAs)|\n| tsNH4Complete    |Time series of NH4 concentration in a wastewater system (complete)| \n\n  > The tsAirgap, tsHeating and tsNH4 time series are with NAs. Their **complete** versions are\n  > without NAs. Except the missing values their versions are identical.\n  > The NAs for the time series were artifically inserted by simulating the missing\n  > data pattern observed in similar non-complete time series from the same domain.\n  > Having a complete and incomplete version of the same dataset is useful for\n  > conducting experiments of imputation functions.\n \n  More detailed information about the datasets can be found in the [imputeTS reference manual].\n\n## Reference\nYou can cite imputeTS the following: \n\n  > Moritz, Steffen, and Bartz-Beielstein, Thomas. \"imputeTS: Time Series Missing Value Imputation in R.\" R Journal 9.1 (2017). doi: 10.32614/RJ-2017-009.\n \n\n## Need Help?\nIf you have general programming problems or need help using the package please ask your question on [StackOverflow]. By doing so all users will be able to benefit in the future from your question.\n\n> Don't forget to mark your question with the [imputets] tag on StackOverflow to get me notified\n\n### Support\nIf you found a bug or have suggestions, feel free to get in contact via steffen.moritz10 at gmail.com.\n\n> All feedback is welcome\n\n\n\n### Version\n**3.4**\n\n### License\nGPL-3\n\n\n   [CRAN]: <https://cran.r-project.org/package=imputeTS>  \n   [imputeTS reference manual]: <https://cran.r-project.org/package=imputeTS>\n   [Citation]: <https://cran.r-project.org/web/packages/imputeTS/citation.html>\n   [StackOverflow]: <https://stackoverflow.com/tags/imputets/info> \n   [imputets]: <https://stackoverflow.com/questions/tagged/imputets>\n   [Gallery of Visualizations]: <https://steffenmoritz.github.io/imputeTS/articles/gallery_visualizations.html>\n \n"
  },
  {
    "path": "_pkgdown.yaml",
    "content": "title: imputeTS\nurl: https://SteffenMoritz.github.io/imputeTS\ntemplate:\n  params:\n    bootswatch: flatly\n\n\nauthors:\nSteffen Moritz:\n    href: https://github.com/SteffenMoritz\n"
  },
  {
    "path": "codecov.yml",
    "content": "comment: false\n\ncoverage:\n  status:\n    project:\n      default:\n        target: auto\n        threshold: 1%\n        informational: true\n    patch:\n      default:\n        target: auto\n        threshold: 1%\n        informational: true\n"
  },
  {
    "path": "docs/404.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>Page not found (404) • imputeTS</title>\n<!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"https://SteffenMoritz.github.io/imputeTS/favicon-48x48.png\">\n<link rel=\"icon\" type=\"”image/svg+xml”\" href=\"https://SteffenMoritz.github.io/imputeTS/favicon.svg\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"https://SteffenMoritz.github.io/imputeTS/apple-touch-icon.png\">\n<link rel=\"icon\" sizes=\"any\" href=\"https://SteffenMoritz.github.io/imputeTS/favicon.ico\">\n<link rel=\"manifest\" href=\"https://SteffenMoritz.github.io/imputeTS/site.webmanifest\">\n<!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\">\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"https://SteffenMoritz.github.io/imputeTS/bootstrap-toc.css\">\n<script src=\"https://SteffenMoritz.github.io/imputeTS/bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\">\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\">\n<!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"https://SteffenMoritz.github.io/imputeTS/pkgdown.css\" rel=\"stylesheet\">\n<script src=\"https://SteffenMoritz.github.io/imputeTS/pkgdown.js\"></script><meta property=\"og:title\" content=\"Page not found (404)\">\n<meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\">\n<!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n</head>\n<body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-title-body\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"https://SteffenMoritz.github.io/imputeTS/index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n<li>\n  <a href=\"https://SteffenMoritz.github.io/imputeTS/reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"https://SteffenMoritz.github.io/imputeTS/#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n<li>\n      <a href=\"https://SteffenMoritz.github.io/imputeTS/articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"https://SteffenMoritz.github.io/imputeTS/news/index.html\">Changelog</a>\n</li>\n      </ul>\n<ul class=\"nav navbar-nav navbar-right\">\n<li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul>\n</div>\n<!--/.nav-collapse -->\n  </div>\n<!--/.container -->\n</div>\n<!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"contents col-md-9\">\n    <div class=\"page-header\">\n      <h1>Page not found (404)</h1>\n    </div>\n\nContent not found. Please use links in the navbar.\n\n  </div>\n\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav>\n</div>\n\n</div>\n\n\n\n      <footer><div class=\"copyright\">\n  <p></p>\n<p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p>\n<p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer>\n</div>\n\n\n\n\n\n\n  </body>\n</html>\n"
  },
  {
    "path": "docs/articles/gallery_visualizations.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>Gallery: Times Series Missing Data Visualizations • imputeTS</title>\n<!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\">\n<link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\">\n<link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\">\n<link rel=\"manifest\" href=\"../site.webmanifest\">\n<!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\">\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\">\n<script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\">\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\">\n<!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\">\n<script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Gallery: Times Series Missing Data Visualizations\">\n<!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n</head>\n<body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-article\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n<li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n<li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul>\n<ul class=\"nav navbar-nav navbar-right\">\n<li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul>\n</div>\n<!--/.nav-collapse -->\n  </div>\n<!--/.container -->\n</div>\n<!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header toc-ignore\">\n      <h1 data-toc-skip>Gallery: Times Series Missing Data\nVisualizations</h1>\n                        <h4 data-toc-skip class=\"author\">Steffen\nMoritz</h4>\n            \n            <h4 data-toc-skip class=\"date\">2025-08-25</h4>\n      \n      <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/vignettes/gallery_visualizations.Rmd\" class=\"external-link\"><code>vignettes/gallery_visualizations.Rmd</code></a></small>\n      <div class=\"hidden name\"><code>gallery_visualizations.Rmd</code></div>\n\n    </div>\n\n    \n    \n<p>There are multiple different plots for (univarate) time series\nmissing data available in the imputeTS package. These can be grouped in\nthe following three categories:</p>\n<ul>\n<li>Getting an Overview (<code>ggplot_na_distribution</code>)</li>\n<li>Deeper insights and missing data patterns\n(<code>ggplot_na_distribution2</code>,\n<code>ggplot_na_gapsize</code>)</li>\n<li>Assessing/Exploring imputation results\n(<code>ggplot_na_imputations</code>)</li>\n</ul>\n<p><em>This vignette showcases all of the available visualizations in\nthe imputeTS package. More information on time series imputation and the\nimputeTS package in general can be found in this paper: <a href=\"https://journal.r-project.org/archive/2017/RJ-2017-009/index.html\" class=\"external-link\">imputeTS:\nTime Series Missing Value Imputation in R</a>.</em></p>\n<div class=\"section level2\">\n<h2 id=\"getting-a-first-overview-ggplot_na_distribution\">Getting a first overview (<code>ggplot_na_distribution</code>)<a class=\"anchor\" aria-label=\"anchor\" href=\"#getting-a-first-overview-ggplot_na_distribution\"></a>\n</h2>\n<p>The best starting point for getting an overview about the missing\ndata in your (univariate) time series is the\n<code><a href=\"../reference/ggplot_na_distribution.html\">ggplot_na_distribution()</a></code> plot. It gives a nice first\noverview where in the time series the missing values occur and how they\nare distributed. It also already gives a rough impression on how many\nmissing data are in different intervals of the time series.</p>\n<p>Usage is easy: just supply the (univariate) time series to the\nfunction call. Only the time series is needed as input - all additional\nparameters are only needed to alter the appearance of the plot.</p>\n<div class=\"sourceCode\" id=\"cb1\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"st\"><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">\"imputeTS\"</a></span><span class=\"op\">)</span></span>\n<span><span class=\"fu\"><a href=\"../reference/ggplot_na_distribution.html\">ggplot_na_distribution</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-distribution-example1-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n<p>It is important to note, that the input itself needs to be\nunivariate. For data types with multiple variables/columns only use the\ncolumn you want to plot as input parameter <code>x</code>. The x-axis\ntime information can be added with the <code>x_axis_labels</code>\nparameter - otherwise the consecutive index of observations in the\nseries is used as x-axis tick label.</p>\n<p>Thus for a data.frame <code>df</code> with multiple columns\n<code>df$date</code>, <code>df$value</code>,\n<code>df$another_value</code>, <code>df$yet_another_value</code> where\nwe want to plot <code>df$value</code> with Dates on the x-axis the\nrequired function call would look like this:</p>\n<div class=\"sourceCode\" id=\"cb2\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"fu\"><a href=\"../reference/ggplot_na_distribution.html\">ggplot_na_distribution</a></span><span class=\"op\">(</span>x <span class=\"op\">=</span> <span class=\"va\">df</span><span class=\"op\">$</span><span class=\"va\">value</span>, x_axis_labels <span class=\"op\">=</span> <span class=\"va\">df</span><span class=\"op\">$</span><span class=\"va\">date</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-distribution-example2-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n</div>\n<div class=\"section level2\">\n<h2 id=\"detailed-information-about-certain-intervals-ggplot_na_distribution2\">Detailed information about certain intervals\n(<code>ggplot_na_distribution2</code>)<a class=\"anchor\" aria-label=\"anchor\" href=\"#detailed-information-about-certain-intervals-ggplot_na_distribution2\"></a>\n</h2>\n<p>When a summary for certain time intervals (e. g. weeks) is needed,\nthe <code><a href=\"../reference/ggplot_na_distribution2.html\">ggplot_na_distribution2()</a></code> plot is useful. It shows the\nmissing data percentage for each interval as a bar. This kind of summary\nplot is also quite useful for very long time series, which would not fit\ninto the plot window as a lineplot.</p>\n<p>Like for <code><a href=\"../reference/ggplot_na_distribution.html\">ggplot_na_distribution()</a></code> only parameter\n<code>x</code> (the univariate time series) is mandatory for creating a\nplot with <code><a href=\"../reference/ggplot_na_distribution2.html\">ggplot_na_distribution2()</a></code>. With the parameter\n<code>interval_size</code> the size of the interval can be changed\n(default is a auto calculated interval size that gives a good overall\noverview). All other parameters are mostly needed for changing the\nappearance of the plot.</p>\n<div class=\"sourceCode\" id=\"cb3\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"fu\"><a href=\"../reference/ggplot_na_distribution2.html\">ggplot_na_distribution2</a></span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-distribution2-example1-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n<p>Alternatively the missing data count for the interval (instead of the\npercentages) can be shown. Below is an example with a custom interval\nsize of 144 and a custom color for the missing data bars. Since the\nexample data is recorded in 10 minute time steps, a interval_size of 144\nmeans that we are using daily intervals (6 measurements per hour, 24\nhours per day, 6*24 = 144).</p>\n<div class=\"sourceCode\" id=\"cb4\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"fu\"><a href=\"../reference/ggplot_na_distribution2.html\">ggplot_na_distribution2</a></span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, measure <span class=\"op\">=</span> <span class=\"st\">\"count\"</span>, interval_size <span class=\"op\">=</span> <span class=\"fl\">144</span>, color_missing <span class=\"op\">=</span> <span class=\"st\">\"gold3\"</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-distribution2-example2-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n</div>\n<div class=\"section level2\">\n<h2 id=\"insights-about-missing-data-patterns-ggplot_na_gapsize\">Insights about missing data patterns\n(<code>ggplot_na_gapsize</code>)<a class=\"anchor\" aria-label=\"anchor\" href=\"#insights-about-missing-data-patterns-ggplot_na_gapsize\"></a>\n</h2>\n<p>Often deeper insights about the missing data are quite useful. These\ninsights can give hints of possible causes of the missing data and an\nindication, which imputation algorithms might give good results. The\nplot gives an overview about how often different gapsizes (NAs in a row)\noccur in the time series.</p>\n<p>Only the parameter <code>x</code> (the univariate time series) is\nneeded as mandatory input. By default the plot shows only the 10 most\noften occurring gapsizes. Use parameter <code>limit</code> to increase\nthis number.</p>\n<div class=\"sourceCode\" id=\"cb5\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"va\"><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">imputeTS</a></span><span class=\"op\">)</span></span>\n<span><span class=\"fu\"><a href=\"../reference/ggplot_na_gapsize.html\">ggplot_na_gapsize</a></span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-gapsize-example1-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n<p>The plot shows both, the number of occurrence and the resulting NAs\nfor the respective gapsizes. Resulting NAs can be explained as the\nnumber of NAs a certain gapsize accounts for in total. For example a\ngapsize of 3 that occurs 5 times results in 15 NAs overall. The\nparameter <code>include_total</code> can be used to change this\nbehavior. Below is a example of the same plot with specific settings for\n<code>limit</code> and <code>include_total</code>.</p>\n<div class=\"sourceCode\" id=\"cb6\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"va\"><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">imputeTS</a></span><span class=\"op\">)</span></span>\n<span><span class=\"fu\"><a href=\"../reference/ggplot_na_gapsize.html\">ggplot_na_gapsize</a></span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, include_total <span class=\"op\">=</span> <span class=\"cn\">F</span>, limit <span class=\"op\">=</span> <span class=\"fl\">15</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-gapsize-example2-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n</div>\n<div class=\"section level2\">\n<h2 id=\"evaluate-imputation-results-ggplot_na_imputations\">Evaluate imputation results\n(<code>ggplot_na_imputations</code>)<a class=\"anchor\" aria-label=\"anchor\" href=\"#evaluate-imputation-results-ggplot_na_imputations\"></a>\n</h2>\n<p>After using imputation functions like <code><a href=\"../reference/na_kalman.html\">na_kalman()</a></code>,\n<code><a href=\"../reference/na_interpolation.html\">na_interpolation()</a></code>, <code><a href=\"../reference/na_seadec.html\">na_seadec()</a></code> there is often\nthe need to get a first impression on how good the algorithm performs.\nThe <code><a href=\"../reference/ggplot_na_imputations.html\">ggplot_na_imputations()</a></code> plot gives a good impression on\nhow well the imputed values fit into the original time series.</p>\n<p>Mandatory inputs for this function are these two parameters:\n<code>x_with_na</code> (the time series as it was before imputation) and\n<code>x_with_imputations</code> (the time series without NAs after\nimputation).</p>\n<div class=\"sourceCode\" id=\"cb7\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"va\"><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">imputeTS</a></span><span class=\"op\">)</span></span>\n<span><span class=\"va\">imp</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"../reference/na_interpolation.html\">na_interpolation</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span>\n<span><span class=\"fu\"><a href=\"../reference/ggplot_na_imputations.html\">ggplot_na_imputations</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, <span class=\"va\">imp</span><span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-imputations-example1-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n<p>In some cases (mostly when performing imputation experiments and\nbenchmarks) the NAs were only artificially introduced into the original\ntime series. Which means, there exists a ground truth for the NA values\n(the complete time series before introducing the NAs). In this case you\ncan additionally use the <code>x_with_truth</code> parameter to get a\nplot that displays both, the imputations and the ground truth.</p>\n<div class=\"sourceCode\" id=\"cb8\"><pre class=\"downlit sourceCode r\">\n<code class=\"sourceCode R\"><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"va\"><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">imputeTS</a></span><span class=\"op\">)</span></span>\n<span><span class=\"va\">imp</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"../reference/na_mean.html\">na_mean</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span>\n<span><span class=\"fu\"><a href=\"../reference/ggplot_na_imputations.html\">ggplot_na_imputations</a></span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>, x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp</span>, x_with_truth <span class=\"op\">=</span> <span class=\"va\">tsAirgapComplete</span> <span class=\"op\">)</span></span></code></pre></div>\n<p><img src=\"gallery_visualizations_files/figure-html/ggplot-na-imputations-example2-1.png\" width=\"600\" style=\"display: block; margin: auto;\"></p>\n</div>\n<div class=\"section level2\">\n<h2 id=\"support\">Support<a class=\"anchor\" aria-label=\"anchor\" href=\"#support\"></a>\n</h2>\n<p>If you found a bug or have suggestions, feel free to open an issue on\nGitHub or get in contact via steffen.moritz10 at gmail.com.</p>\n<blockquote>\n<p>All feedback is welcome</p>\n</blockquote>\n</div>\n  </div>\n\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n\n      </div>\n\n</div>\n\n\n\n      <footer><div class=\"copyright\">\n  <p></p>\n<p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p>\n<p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer>\n</div>\n\n\n\n\n\n\n  </body>\n</html>\n"
  },
  {
    "path": "docs/articles/gallery_visualizations_files/accessible-code-block-0.0.1/empty-anchor.js",
    "content": "// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) -->\n// v0.0.1\n// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020.\n\ndocument.addEventListener('DOMContentLoaded', function() {\n  const codeList = document.getElementsByClassName(\"sourceCode\");\n  for (var i = 0; i < codeList.length; i++) {\n    var linkList = codeList[i].getElementsByTagName('a');\n    for (var j = 0; j < linkList.length; j++) {\n      if (linkList[j].innerHTML === \"\") {\n        linkList[j].setAttribute('aria-hidden', 'true');\n      }\n    }\n  }\n});\n"
  },
  {
    "path": "docs/articles/gallery_visualizations_files/header-attrs-2.16/header-attrs.js",
    "content": "// Pandoc 2.9 adds attributes on both header and div. We remove the former (to\n// be compatible with the behavior of Pandoc < 2.8).\ndocument.addEventListener('DOMContentLoaded', function(e) {\n  var hs = document.querySelectorAll(\"div.section[class*='level'] > :first-child\");\n  var i, h, a;\n  for (i = 0; i < hs.length; i++) {\n    h = hs[i];\n    if (!/^h[1-6]$/i.test(h.tagName)) continue;  // it should be a header h1-h6\n    a = h.attributes;\n    while (a.length > 0) h.removeAttribute(a[0].name);\n  }\n});\n"
  },
  {
    "path": "docs/articles/gallery_visualizations_files/header-attrs-2.7/header-attrs.js",
    "content": "// Pandoc 2.9 adds attributes on both header and div. We remove the former (to\n// be compatible with the behavior of Pandoc < 2.8).\ndocument.addEventListener('DOMContentLoaded', function(e) {\n  var hs = document.querySelectorAll(\"div.section[class*='level'] > :first-child\");\n  var i, h, a;\n  for (i = 0; i < hs.length; i++) {\n    h = hs[i];\n    if (!/^h[1-6]$/i.test(h.tagName)) continue;  // it should be a header h1-h6\n    a = h.attributes;\n    while (a.length > 0) h.removeAttribute(a[0].name);\n  }\n});\n"
  },
  {
    "path": "docs/articles/index.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Articles • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Articles\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-article-index\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n      <h1>Articles</h1>\n    </div>\n\n    <div class=\"section \">\n      <h3>All vignettes</h3>\n      <p class=\"section-desc\"></p>\n\n      <dl><dt><a href=\"gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a></dt>\n        <dd>\n      </dd></dl></div>\n  </div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/authors.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Authors and Citation • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"favicon.ico\"><link rel=\"manifest\" href=\"site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"bootstrap-toc.css\"><script src=\"bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"pkgdown.css\" rel=\"stylesheet\"><script src=\"pkgdown.js\"></script><meta property=\"og:title\" content=\"Authors and Citation\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-citation-authors\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"contents col-md-9\">\n    <div class=\"section level2 authors-section\">\n      <div class=\"page-header\">\n        <h1>Authors and Citation</h1>\n      </div>\n\n\n      <ul class=\"list-unstyled\"><li>\n          <p><strong>Steffen Moritz</strong>. Author, maintainer, copyright holder. <a href=\"https://orcid.org/0000-0002-0085-1804\" target=\"orcid.widget\" aria-label=\"ORCID\" class=\"external-link\"><span class=\"fab fa-orcid orcid\" aria-hidden=\"true\"></span></a>\n          </p>\n        </li>\n        <li>\n          <p><strong>Sebastian Gatscha</strong>. Author.\n          </p>\n        </li>\n        <li>\n          <p><strong>Earo Wang</strong>. Contributor. <a href=\"https://orcid.org/0000-0001-6448-5260\" target=\"orcid.widget\" aria-label=\"ORCID\" class=\"external-link\"><span class=\"fab fa-orcid orcid\" aria-hidden=\"true\"></span></a>\n          </p>\n        </li>\n        <li>\n          <p><strong>Ron Hause</strong>. Contributor. <a href=\"https://orcid.org/0000-0002-5229-7366\" target=\"orcid.widget\" aria-label=\"ORCID\" class=\"external-link\"><span class=\"fab fa-orcid orcid\" aria-hidden=\"true\"></span></a>\n          </p>\n        </li>\n      </ul></div>\n    <div class=\"section level2 citation-section\">\n    <div>\n      <h1 id=\"citation\">Citation</h1>\n      <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/inst/CITATION\" class=\"external-link\"><code>inst/CITATION</code></a></small>\n    </div>\n    </div>\n\n\n    <p>Steffen Moritz, Thomas Bartz-Beielstein (2017).\n“imputeTS: Time Series Missing Value Imputation in R.”\n<em>The R Journal</em>, <b>9</b>(1), 207–218.\n<a href=\"https://doi.org/10.32614/RJ-2017-009\" class=\"external-link\">doi:10.32614/RJ-2017-009</a>.\n</p>\n    <pre>@Article{,\n  title = {{imputeTS: Time Series Missing Value Imputation in R}},\n  author = {{Steffen Moritz} and {Thomas Bartz-Beielstein}},\n  journal = {{The R Journal}},\n  volume = {9},\n  number = {1},\n  pages = {207--218},\n  year = {2017},\n  doi = {10.32614/RJ-2017-009},\n}</pre>\n\n  </div>\n\n</div>\n\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/bootstrap-toc.css",
    "content": "/*!\n * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)\n * Copyright 2015 Aidan Feldman\n * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */\n\n/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */\n\n/* All levels of nav */\nnav[data-toggle='toc'] .nav > li > a {\n  display: block;\n  padding: 4px 20px;\n  font-size: 13px;\n  font-weight: 500;\n  color: #767676;\n}\nnav[data-toggle='toc'] .nav > li > a:hover,\nnav[data-toggle='toc'] .nav > li > a:focus {\n  padding-left: 19px;\n  color: #563d7c;\n  text-decoration: none;\n  background-color: transparent;\n  border-left: 1px solid #563d7c;\n}\nnav[data-toggle='toc'] .nav > .active > a,\nnav[data-toggle='toc'] .nav > .active:hover > a,\nnav[data-toggle='toc'] .nav > .active:focus > a {\n  padding-left: 18px;\n  font-weight: bold;\n  color: #563d7c;\n  background-color: transparent;\n  border-left: 2px solid #563d7c;\n}\n\n/* Nav: second level (shown on .active) */\nnav[data-toggle='toc'] .nav .nav {\n  display: none; /* Hide by default, but at >768px, show it */\n  padding-bottom: 10px;\n}\nnav[data-toggle='toc'] .nav .nav > li > a {\n  padding-top: 1px;\n  padding-bottom: 1px;\n  padding-left: 30px;\n  font-size: 12px;\n  font-weight: normal;\n}\nnav[data-toggle='toc'] .nav .nav > li > a:hover,\nnav[data-toggle='toc'] .nav .nav > li > a:focus {\n  padding-left: 29px;\n}\nnav[data-toggle='toc'] .nav .nav > .active > a,\nnav[data-toggle='toc'] .nav .nav > .active:hover > a,\nnav[data-toggle='toc'] .nav .nav > .active:focus > a {\n  padding-left: 28px;\n  font-weight: 500;\n}\n\n/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */\nnav[data-toggle='toc'] .nav > .active > ul {\n  display: block;\n}\n"
  },
  {
    "path": "docs/bootstrap-toc.js",
    "content": "/*!\n * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/)\n * Copyright 2015 Aidan Feldman\n * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */\n(function() {\n  'use strict';\n\n  window.Toc = {\n    helpers: {\n      // return all matching elements in the set, or their descendants\n      findOrFilter: function($el, selector) {\n        // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/\n        // http://stackoverflow.com/a/12731439/358804\n        var $descendants = $el.find(selector);\n        return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])');\n      },\n\n      generateUniqueIdBase: function(el) {\n        var text = $(el).text();\n        var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-');\n        return anchor || el.tagName.toLowerCase();\n      },\n\n      generateUniqueId: function(el) {\n        var anchorBase = this.generateUniqueIdBase(el);\n        for (var i = 0; ; i++) {\n          var anchor = anchorBase;\n          if (i > 0) {\n            // add suffix\n            anchor += '-' + i;\n          }\n          // check if ID already exists\n          if (!document.getElementById(anchor)) {\n            return anchor;\n          }\n        }\n      },\n\n      generateAnchor: function(el) {\n        if (el.id) {\n          return el.id;\n        } else {\n          var anchor = this.generateUniqueId(el);\n          el.id = anchor;\n          return anchor;\n        }\n      },\n\n      createNavList: function() {\n        return $('<ul class=\"nav\"></ul>');\n      },\n\n      createChildNavList: function($parent) {\n        var $childList = this.createNavList();\n        $parent.append($childList);\n        return $childList;\n      },\n\n      generateNavEl: function(anchor, text) {\n        var $a = $('<a></a>');\n        $a.attr('href', '#' + anchor);\n        $a.text(text);\n        var $li = $('<li></li>');\n        $li.append($a);\n        return $li;\n      },\n\n      generateNavItem: function(headingEl) {\n        var anchor = this.generateAnchor(headingEl);\n        var $heading = $(headingEl);\n        var text = $heading.data('toc-text') || $heading.text();\n        return this.generateNavEl(anchor, text);\n      },\n\n      // Find the first heading level (`<h1>`, then `<h2>`, etc.) that has more than one element. Defaults to 1 (for `<h1>`).\n      getTopLevel: function($scope) {\n        for (var i = 1; i <= 6; i++) {\n          var $headings = this.findOrFilter($scope, 'h' + i);\n          if ($headings.length > 1) {\n            return i;\n          }\n        }\n\n        return 1;\n      },\n\n      // returns the elements for the top level, and the next below it\n      getHeadings: function($scope, topLevel) {\n        var topSelector = 'h' + topLevel;\n\n        var secondaryLevel = topLevel + 1;\n        var secondarySelector = 'h' + secondaryLevel;\n\n        return this.findOrFilter($scope, topSelector + ',' + secondarySelector);\n      },\n\n      getNavLevel: function(el) {\n        return parseInt(el.tagName.charAt(1), 10);\n      },\n\n      populateNav: function($topContext, topLevel, $headings) {\n        var $context = $topContext;\n        var $prevNav;\n\n        var helpers = this;\n        $headings.each(function(i, el) {\n          var $newNav = helpers.generateNavItem(el);\n          var navLevel = helpers.getNavLevel(el);\n\n          // determine the proper $context\n          if (navLevel === topLevel) {\n            // use top level\n            $context = $topContext;\n          } else if ($prevNav && $context === $topContext) {\n            // create a new level of the tree and switch to it\n            $context = helpers.createChildNavList($prevNav);\n          } // else use the current $context\n\n          $context.append($newNav);\n\n          $prevNav = $newNav;\n        });\n      },\n\n      parseOps: function(arg) {\n        var opts;\n        if (arg.jquery) {\n          opts = {\n            $nav: arg\n          };\n        } else {\n          opts = arg;\n        }\n        opts.$scope = opts.$scope || $(document.body);\n        return opts;\n      }\n    },\n\n    // accepts a jQuery object, or an options object\n    init: function(opts) {\n      opts = this.helpers.parseOps(opts);\n\n      // ensure that the data attribute is in place for styling\n      opts.$nav.attr('data-toggle', 'toc');\n\n      var $topContext = this.helpers.createChildNavList(opts.$nav);\n      var topLevel = this.helpers.getTopLevel(opts.$scope);\n      var $headings = this.helpers.getHeadings(opts.$scope, topLevel);\n      this.helpers.populateNav($topContext, topLevel, $headings);\n    }\n  };\n\n  $(function() {\n    $('nav[data-toggle=\"toc\"]').each(function(i, el) {\n      var $nav = $(el);\n      Toc.init($nav);\n    });\n  });\n})();\n"
  },
  {
    "path": "docs/docsearch.css",
    "content": "/* Docsearch -------------------------------------------------------------- */\n/*\n  Source: https://github.com/algolia/docsearch/\n  License: MIT\n*/\n\n.algolia-autocomplete {\n  display: block;\n  -webkit-box-flex: 1;\n  -ms-flex: 1;\n  flex: 1\n}\n\n.algolia-autocomplete .ds-dropdown-menu {\n  width: 100%;\n  min-width: none;\n  max-width: none;\n  padding: .75rem 0;\n  background-color: #fff;\n  background-clip: padding-box;\n  border: 1px solid rgba(0, 0, 0, .1);\n  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175);\n}\n\n@media (min-width:768px) {\n  .algolia-autocomplete .ds-dropdown-menu {\n      width: 175%\n  }\n}\n\n.algolia-autocomplete .ds-dropdown-menu::before {\n  display: none\n}\n\n.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] {\n  padding: 0;\n  background-color: rgb(255,255,255);\n  border: 0;\n  max-height: 80vh;\n}\n\n.algolia-autocomplete .ds-dropdown-menu .ds-suggestions {\n  margin-top: 0\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion {\n  padding: 0;\n  overflow: visible\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--category-header {\n  padding: .125rem 1rem;\n  margin-top: 0;\n  font-size: 1.3em;\n  font-weight: 500;\n  color: #00008B;\n  border-bottom: 0\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--wrapper {\n    float: none;\n    padding-top: 0\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column {\n  float: none;\n  width: auto;\n  padding: 0;\n  text-align: left\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--content {\n  float: none;\n  width: auto;\n  padding: 0\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--content::before {\n  display: none\n}\n\n.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header {\n  padding-top: .75rem;\n  margin-top: .75rem;\n  border-top: 1px solid rgba(0, 0, 0, .1)\n}\n\n.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column {\n  display: block;\n  padding: .1rem 1rem;\n  margin-bottom: 0.1;\n  font-size: 1.0em;\n  font-weight: 400\n  /* display: none */\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--title {\n  display: block;\n  padding: .25rem 1rem;\n  margin-bottom: 0;\n  font-size: 0.9em;\n  font-weight: 400\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--text {\n  padding: 0 1rem .5rem;\n  margin-top: -.25rem;\n  font-size: 0.8em;\n  font-weight: 400;\n  line-height: 1.25\n}\n\n.algolia-autocomplete .algolia-docsearch-footer {\n  width: 110px;\n  height: 20px;\n  z-index: 3;\n  margin-top: 10.66667px;\n  float: right;\n  font-size: 0;\n  line-height: 0;\n}\n\n.algolia-autocomplete .algolia-docsearch-footer--logo {\n  background-image: url(\"data:image/svg+xml;utf8,<svg viewBox='0 0 130 18' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient x1='-36.868%' y1='134.936%' x2='129.432%' y2='-27.7%' id='a'><stop stop-color='%2300AEFF' offset='0%'/><stop stop-color='%233369E7' offset='100%'/></linearGradient></defs><g fill='none' fill-rule='evenodd'><path d='M59.399.022h13.299a2.372 2.372 0 0 1 2.377 2.364V15.62a2.372 2.372 0 0 1-2.377 2.364H59.399a2.372 2.372 0 0 1-2.377-2.364V2.381A2.368 2.368 0 0 1 59.399.022z' fill='url(%23a)'/><path d='M66.257 4.56c-2.815 0-5.1 2.272-5.1 5.078 0 2.806 2.284 5.072 5.1 5.072 2.815 0 5.1-2.272 5.1-5.078 0-2.806-2.279-5.072-5.1-5.072zm0 8.652c-1.983 0-3.593-1.602-3.593-3.574 0-1.972 1.61-3.574 3.593-3.574 1.983 0 3.593 1.602 3.593 3.574a3.582 3.582 0 0 1-3.593 3.574zm0-6.418v2.664c0 .076.082.131.153.093l2.377-1.226c.055-.027.071-.093.044-.147a2.96 2.96 0 0 0-2.465-1.487c-.055 0-.11.044-.11.104l.001-.001zm-3.33-1.956l-.312-.311a.783.783 0 0 0-1.106 0l-.372.37a.773.773 0 0 0 0 1.101l.307.305c.049.049.121.038.164-.011.181-.245.378-.479.597-.697.225-.223.455-.42.707-.599.055-.033.06-.109.016-.158h-.001zm5.001-.806v-.616a.781.781 0 0 0-.783-.779h-1.824a.78.78 0 0 0-.783.779v.632c0 .071.066.12.137.104a5.736 5.736 0 0 1 1.588-.223c.52 0 1.035.071 1.534.207a.106.106 0 0 0 .131-.104z' fill='%23FFF'/><path d='M102.162 13.762c0 1.455-.372 2.517-1.123 3.193-.75.676-1.895 1.013-3.44 1.013-.564 0-1.736-.109-2.673-.316l.345-1.689c.783.163 1.819.207 2.361.207.86 0 1.473-.174 1.84-.523.367-.349.548-.866.548-1.553v-.349a6.374 6.374 0 0 1-.838.316 4.151 4.151 0 0 1-1.194.158 4.515 4.515 0 0 1-1.616-.278 3.385 3.385 0 0 1-1.254-.817 3.744 3.744 0 0 1-.811-1.351c-.192-.539-.29-1.504-.29-2.212 0-.665.104-1.498.307-2.054a3.925 3.925 0 0 1 .904-1.433 4.124 4.124 0 0 1 1.441-.926 5.31 5.31 0 0 1 1.945-.365c.696 0 1.337.087 1.961.191a15.86 15.86 0 0 1 1.588.332v8.456h-.001zm-5.954-4.206c0 .893.197 1.885.592 2.299.394.414.904.621 1.528.621.34 0 .663-.049.964-.142a2.75 2.75 0 0 0 .734-.332v-5.29a8.531 8.531 0 0 0-1.413-.18c-.778-.022-1.369.294-1.786.801-.411.507-.619 1.395-.619 2.223zm16.12 0c0 .719-.104 1.264-.318 1.858a4.389 4.389 0 0 1-.904 1.52c-.389.42-.854.746-1.402.975-.548.229-1.391.36-1.813.36-.422-.005-1.26-.125-1.802-.36a4.088 4.088 0 0 1-1.397-.975 4.486 4.486 0 0 1-.909-1.52 5.037 5.037 0 0 1-.329-1.858c0-.719.099-1.411.318-1.999.219-.588.526-1.09.92-1.509.394-.42.865-.741 1.402-.97a4.547 4.547 0 0 1 1.786-.338 4.69 4.69 0 0 1 1.791.338c.548.229 1.019.55 1.402.97.389.42.69.921.909 1.509.23.588.345 1.28.345 1.999h.001zm-2.191.005c0-.921-.203-1.689-.597-2.223-.394-.539-.948-.806-1.654-.806-.707 0-1.26.267-1.654.806-.394.539-.586 1.302-.586 2.223 0 .932.197 1.558.592 2.098.394.545.948.812 1.654.812.707 0 1.26-.272 1.654-.812.394-.545.592-1.166.592-2.098h-.001zm6.962 4.707c-3.511.016-3.511-2.822-3.511-3.274L113.583.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001zm3.774 0h-2.153V5.072l2.153-.338v9.534zm-1.079-10.542c.718 0 1.304-.578 1.304-1.291 0-.714-.581-1.291-1.304-1.291-.723 0-1.304.578-1.304 1.291 0 .714.586 1.291 1.304 1.291zm6.431 1.013c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.285.311.488.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.263.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a9.335 9.335 0 0 1 1.66-.142l-.001-.001zm.181 7.731c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.323.196.75.289 1.293.289h.001zM84.109 4.794c.707 0 1.304.087 1.786.262.482.174.871.42 1.156.73.29.316.487.735.608 1.182.126.447.186.937.186 1.476v5.481a25.24 25.24 0 0 1-1.495.251c-.668.098-1.419.147-2.251.147a6.829 6.829 0 0 1-1.517-.158 3.213 3.213 0 0 1-1.178-.507 2.455 2.455 0 0 1-.761-.904c-.181-.37-.274-.893-.274-1.438 0-.523.104-.855.307-1.215.208-.36.487-.654.838-.883a3.609 3.609 0 0 1 1.227-.49 7.073 7.073 0 0 1 2.202-.103c.257.027.537.076.833.147v-.349c0-.245-.027-.479-.088-.697a1.486 1.486 0 0 0-.307-.583c-.148-.169-.34-.3-.581-.392a2.536 2.536 0 0 0-.915-.163c-.493 0-.942.06-1.353.131-.411.071-.75.153-1.008.245l-.257-1.749c.268-.093.668-.185 1.183-.278a8.89 8.89 0 0 1 1.66-.142l-.001-.001zm.186 7.736c.657 0 1.145-.038 1.484-.104v-2.168a5.097 5.097 0 0 0-1.978-.104c-.241.033-.46.098-.652.191a1.167 1.167 0 0 0-.466.392c-.121.169-.175.267-.175.523 0 .501.175.79.493.981.318.191.75.289 1.293.289h.001zm8.682 1.738c-3.511.016-3.511-2.822-3.511-3.274L89.461.926l2.142-.338v10.003c0 .256 0 1.88 1.375 1.885v1.792h-.001z' fill='%23182359'/><path d='M5.027 11.025c0 .698-.252 1.246-.757 1.644-.505.397-1.201.596-2.089.596-.888 0-1.615-.138-2.181-.414v-1.214c.358.168.739.301 1.141.397.403.097.778.145 1.125.145.508 0 .884-.097 1.125-.29a.945.945 0 0 0 .363-.779.978.978 0 0 0-.333-.747c-.222-.204-.68-.446-1.375-.725-.716-.29-1.221-.621-1.515-.994-.294-.372-.44-.82-.44-1.343 0-.655.233-1.171.698-1.547.466-.376 1.09-.564 1.875-.564.752 0 1.5.165 2.245.494l-.408 1.047c-.698-.294-1.321-.44-1.869-.44-.415 0-.73.09-.945.271a.89.89 0 0 0-.322.717c0 .204.043.379.129.524.086.145.227.282.424.411.197.129.551.299 1.063.51.577.24.999.464 1.268.671.269.208.466.442.591.704.125.261.188.569.188.924l-.001.002zm3.98 2.24c-.924 0-1.646-.269-2.167-.808-.521-.539-.782-1.281-.782-2.226 0-.97.242-1.733.725-2.288.483-.555 1.148-.833 1.993-.833.784 0 1.404.238 1.858.714.455.476.682 1.132.682 1.966v.682H7.357c.018.577.174 1.02.467 1.329.294.31.707.465 1.241.465.351 0 .678-.033.98-.099a5.1 5.1 0 0 0 .975-.33v1.026a3.865 3.865 0 0 1-.935.312 5.723 5.723 0 0 1-1.08.091l.002-.001zm-.231-5.199c-.401 0-.722.127-.964.381s-.386.625-.432 1.112h2.696c-.007-.491-.125-.862-.354-1.115-.229-.252-.544-.379-.945-.379l-.001.001zm7.692 5.092l-.252-.827h-.043c-.286.362-.575.608-.865.739-.29.131-.662.196-1.117.196-.584 0-1.039-.158-1.367-.473-.328-.315-.491-.761-.491-1.337 0-.612.227-1.074.682-1.386.455-.312 1.148-.482 2.079-.51l1.026-.032v-.317c0-.38-.089-.663-.266-.851-.177-.188-.452-.282-.824-.282-.304 0-.596.045-.876.134a6.68 6.68 0 0 0-.806.317l-.408-.902a4.414 4.414 0 0 1 1.058-.384 4.856 4.856 0 0 1 1.085-.132c.756 0 1.326.165 1.711.494.385.329.577.847.577 1.552v4.002h-.902l-.001-.001zm-1.88-.859c.458 0 .826-.128 1.104-.384.278-.256.416-.615.416-1.077v-.516l-.763.032c-.594.021-1.027.121-1.297.298s-.406.448-.406.814c0 .265.079.47.236.615.158.145.394.218.709.218h.001zm7.557-5.189c.254 0 .464.018.628.054l-.124 1.176a2.383 2.383 0 0 0-.559-.064c-.505 0-.914.165-1.227.494-.313.329-.47.757-.47 1.284v3.105h-1.262V7.218h.988l.167 1.047h.064c.197-.354.454-.636.771-.843a1.83 1.83 0 0 1 1.023-.312h.001zm4.125 6.155c-.899 0-1.582-.262-2.049-.787-.467-.525-.701-1.277-.701-2.259 0-.999.244-1.767.733-2.304.489-.537 1.195-.806 2.119-.806.627 0 1.191.116 1.692.349l-.381 1.015c-.534-.208-.974-.312-1.321-.312-1.028 0-1.542.682-1.542 2.046 0 .666.128 1.166.384 1.501.256.335.631.502 1.125.502a3.23 3.23 0 0 0 1.595-.419v1.101a2.53 2.53 0 0 1-.722.285 4.356 4.356 0 0 1-.932.086v.002zm8.277-.107h-1.268V9.506c0-.458-.092-.8-.277-1.026-.184-.226-.477-.338-.878-.338-.53 0-.919.158-1.168.475-.249.317-.373.848-.373 1.593v2.949h-1.262V4.801h1.262v2.122c0 .34-.021.704-.064 1.09h.081a1.76 1.76 0 0 1 .717-.666c.306-.158.663-.236 1.072-.236 1.439 0 2.159.725 2.159 2.175v3.873l-.001-.001zm7.649-6.048c.741 0 1.319.269 1.732.806.414.537.62 1.291.62 2.261 0 .974-.209 1.732-.628 2.275-.419.542-1.001.814-1.746.814-.752 0-1.336-.27-1.751-.811h-.086l-.231.704h-.945V4.801h1.262v1.987l-.021.655-.032.553h.054c.401-.591.992-.886 1.772-.886zm-.328 1.031c-.508 0-.875.149-1.098.448-.224.299-.339.799-.346 1.501v.086c0 .723.115 1.247.344 1.571.229.324.603.486 1.123.486.448 0 .787-.177 1.018-.532.231-.354.346-.867.346-1.536 0-1.35-.462-2.025-1.386-2.025l-.001.001zm3.244-.924h1.375l1.209 3.368c.183.48.304.931.365 1.354h.043c.032-.197.091-.436.177-.717.086-.281.541-1.616 1.364-4.004h1.364l-2.541 6.73c-.462 1.235-1.232 1.853-2.31 1.853-.279 0-.551-.03-.816-.091v-.999c.19.043.406.064.65.064.609 0 1.037-.353 1.284-1.058l.22-.559-2.385-5.941h.001z' fill='%231D3657'/></g></svg>\");\n  background-repeat: no-repeat;\n  background-position: 50%;\n  background-size: 100%;\n  overflow: hidden;\n  text-indent: -9000px;\n  width: 100%;\n  height: 100%;\n  display: block;\n  transform: translate(-8px);\n}\n\n.algolia-autocomplete .algolia-docsearch-suggestion--highlight {\n  color: #FF8C00;\n  background: rgba(232, 189, 54, 0.1)\n}\n\n\n.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight {\n  box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5)\n}\n\n.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content {\n  background-color: rgba(192, 192, 192, .15)\n}\n"
  },
  {
    "path": "docs/docsearch.js",
    "content": "$(function() {\n\n  // register a handler to move the focus to the search bar\n  // upon pressing shift + \"/\" (i.e. \"?\")\n  $(document).on('keydown', function(e) {\n    if (e.shiftKey && e.keyCode == 191) {\n      e.preventDefault();\n      $(\"#search-input\").focus();\n    }\n  });\n\n  $(document).ready(function() {\n    // do keyword highlighting\n    /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */\n    var mark = function() {\n\n      var referrer = document.URL ;\n      var paramKey = \"q\" ;\n\n      if (referrer.indexOf(\"?\") !== -1) {\n        var qs = referrer.substr(referrer.indexOf('?') + 1);\n        var qs_noanchor = qs.split('#')[0];\n        var qsa = qs_noanchor.split('&');\n        var keyword = \"\";\n\n        for (var i = 0; i < qsa.length; i++) {\n          var currentParam = qsa[i].split('=');\n\n          if (currentParam.length !== 2) {\n            continue;\n          }\n\n          if (currentParam[0] == paramKey) {\n            keyword = decodeURIComponent(currentParam[1].replace(/\\+/g, \"%20\"));\n          }\n        }\n\n        if (keyword !== \"\") {\n          $(\".contents\").unmark({\n            done: function() {\n              $(\".contents\").mark(keyword);\n            }\n          });\n        }\n      }\n    };\n\n    mark();\n  });\n});\n\n/* Search term highlighting ------------------------------*/\n\nfunction matchedWords(hit) {\n  var words = [];\n\n  var hierarchy = hit._highlightResult.hierarchy;\n  // loop to fetch from lvl0, lvl1, etc.\n  for (var idx in hierarchy) {\n    words = words.concat(hierarchy[idx].matchedWords);\n  }\n\n  var content = hit._highlightResult.content;\n  if (content) {\n    words = words.concat(content.matchedWords);\n  }\n\n  // return unique words\n  var words_uniq = [...new Set(words)];\n  return words_uniq;\n}\n\nfunction updateHitURL(hit) {\n\n  var words = matchedWords(hit);\n  var url = \"\";\n\n  if (hit.anchor) {\n    url = hit.url_without_anchor + '?q=' + escape(words.join(\" \")) + '#' + hit.anchor;\n  } else {\n    url = hit.url + '?q=' + escape(words.join(\" \"));\n  }\n\n  return url;\n}\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>Time Series Missing Value Imputation • imputeTS</title>\n<!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"favicon-48x48.png\">\n<link rel=\"icon\" type=\"”image/svg+xml”\" href=\"favicon.svg\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"apple-touch-icon.png\">\n<link rel=\"icon\" sizes=\"any\" href=\"favicon.ico\">\n<link rel=\"manifest\" href=\"site.webmanifest\">\n<!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\">\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"bootstrap-toc.css\">\n<script src=\"bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\">\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\">\n<!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"pkgdown.css\" rel=\"stylesheet\">\n<script src=\"pkgdown.js\"></script><meta property=\"og:title\" content=\"Time Series Missing Value Imputation\">\n<meta property=\"og:description\" content=\"Imputation (replacement) of missing values in univariate time series. Offers several imputation functions and missing data plots. Available imputation algorithms include: Mean, LOCF, Interpolation, Moving Average, Seasonal Decomposition, Kalman Smoothing on Structural Time Series models, Kalman Smoothing on ARIMA models. Published in Moritz and Bartz-Beielstein (2017) &lt;doi:10.32614/RJ-2017-009&gt;.\">\n<meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\">\n<!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n</head>\n<body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-home\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n<li>\n  <a href=\"reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n<li>\n      <a href=\"articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"news/index.html\">Changelog</a>\n</li>\n      </ul>\n<ul class=\"nav navbar-nav navbar-right\">\n<li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul>\n</div>\n<!--/.nav-collapse -->\n  </div>\n<!--/.container -->\n</div>\n<!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"contents col-md-9\">\n\n<p><!-- badges: start --> <a href=\"https://www.repostatus.org/#active\" class=\"external-link\"><img src=\"https://www.repostatus.org/badges/latest/active.svg\" alt=\"Project Status: Active The project has reached a stable, usable state and is being actively developed.\"></a> <a href=\"https://github.com/SteffenMoritz/imputeTS/actions\" class=\"external-link\"><img src=\"https://github.com/SteffenMoritz/imputeTS/workflows/R-CMD-check/badge.svg\" alt=\"R-CMD-check\"></a> <a href=\"https://app.codecov.io/gh/SteffenMoritz/imputeTS?branch=master\" class=\"external-link\"><img src=\"https://codecov.io/gh/SteffenMoritz/imputeTS/branch/master/graph/badge.svg\" alt=\"Codecov test coverage\"></a> <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\"><img src=\"https://www.r-pkg.org/badges/version/imputeTS\" alt=\"CRAN Version\"></a> <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\"><img src=\"https://www.r-pkg.org/badges/last-release/imputeTS\" alt=\"CRAN Release\"></a> <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\"><img src=\"https://cranlogs.r-pkg.org/badges/imputeTS\" alt=\"CRAN Downloads\"></a> <!-- badges: end --></p>\n<div class=\"section level1\">\n<div class=\"page-header\"><h1 id=\"imputets-time-series-missing-value-imputation-\">imputeTS: Time Series Missing Value Imputation <img src=\"reference/figures/imputeTS-logo.png\" align=\"right\" width=\"565\" height=\"382\" alt=\"imputeTS Logo\"><a class=\"anchor\" aria-label=\"anchor\" href=\"#imputets-time-series-missing-value-imputation-\"></a>\n</h1></div>\n<p>The imputeTS package specializes on (univariate) time series imputation. It offers several different imputation algorithm implementations. Beyond the imputation algorithms the package also provides plotting and printing functions of time series missing data statistics. Additionally three time series datasets for imputation experiments are included.</p>\n<div class=\"section level2\">\n<h2 id=\"installation\">Installation<a class=\"anchor\" aria-label=\"anchor\" href=\"#installation\"></a>\n</h2>\n<p>The imputeTS package can be found on <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\">CRAN</a>. For installation execute in R:</p>\n<pre><code><span> <span class=\"fu\"><a href=\"https://rdrr.io/r/utils/install.packages.html\" class=\"external-link\">install.packages</a></span><span class=\"op\">(</span><span class=\"st\">\"imputeTS\"</span><span class=\"op\">)</span></span></code></pre>\n<p>If you want to install the latest version from GitHub (can be unstable) run:</p>\n<pre><code><span><span class=\"kw\"><a href=\"https://rdrr.io/r/base/library.html\" class=\"external-link\">library</a></span><span class=\"op\">(</span><span class=\"va\"><a href=\"https://devtools.r-lib.org/\" class=\"external-link\">devtools</a></span><span class=\"op\">)</span></span>\n<span><span class=\"fu\">install_github</span><span class=\"op\">(</span><span class=\"st\">\"SteffenMoritz/imputeTS\"</span><span class=\"op\">)</span></span></code></pre>\n</div>\n<div class=\"section level2\">\n<h2 id=\"usage\">Usage<a class=\"anchor\" aria-label=\"anchor\" href=\"#usage\"></a>\n</h2>\n<ul>\n<li>\n<h4 id=\"imputation\">Imputation</h4>\n<p>To impute (fill all missing values) in a time series <strong><em>x</em></strong>, run the following command:</p>\n<pre><code><span> <span class=\"fu\"><a href=\"reference/na_interpolation.html\">na_interpolation</a></span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></code></pre>\n<p>Output is the time series <strong><em>x</em></strong> with all NA’s replaced by reasonable values.</p>\n<blockquote>\n<p>This is just one example for an imputation algorithm. In this case interpolation was the algorithm of choice for calculating the NA replacements. There are several other algorithms (see also under caption <a href=\"#imputation-algorithms\">Imputation Algorithms</a>). All imputation functions are named alike starting with na_ followed by a algorithm label e.g. na_mean, na_kalman, …</p>\n</blockquote>\n</li>\n<li>\n<h4 id=\"plotting\">Plotting</h4>\n<p>To plot missing data statistics for a time series <strong><em>x</em></strong>, run the following command:</p>\n<pre><code><span> <span class=\"fu\"><a href=\"reference/ggplot_na_distribution.html\">ggplot_na_distribution</a></span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></code></pre>\n<p> </p>\n<p align=\"center\">\n</p>\n<p><img src=\"reference/figures/ggplot_na_distribution.png\" width=\"600\" height=\"350\" alt=\"Example ggplot_na_distribution plot\"></p>\n\n<blockquote>\n<p>This is also just one example for a plot. Overall there are five different types of missing data plots (see also under caption <a href=\"#missing-data-plots\">Missing Data Plots</a>). There is also an additional tutorial just about plots - the <a href=\"https://cran.r-project.org/web/packages/imputeTS/vignettes/gallery_visualizations.html\" class=\"external-link\">Gallery of Visualizations</a>.</p>\n</blockquote>\n</li>\n<li>\n<h4 id=\"printing\">Printing</h4>\n<p>To print statistics about the missing data in a time series <strong><em>x</em></strong>, run the following command:</p>\n<pre><code><span> <span class=\"fu\"><a href=\"reference/statsNA.html\">statsNA</a></span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></code></pre>\n</li>\n<li>\n<h3 id=\"example-datasets\">Example Datasets</h3>\n<p>To load the <em>‘heating’</em> time series (with missing values) into a variable <strong><em>y</em></strong> and the <em>‘heating’</em> time series (without missing values) into a variable <strong><em>z</em></strong>, run:</p>\n<pre><code><span> <span class=\"va\">y</span> <span class=\"op\">&lt;-</span> <span class=\"va\">tsHeating</span></span>\n<span> <span class=\"va\">z</span> <span class=\"op\">&lt;-</span> <span class=\"va\">tsHeatingComplete</span></span></code></pre>\n<blockquote>\n<p>There are three datasets provided with the package, the <em>‘tsHeating’</em>, the <em>‘tsAirgap’</em> and the <em>‘tsNH4’</em> time series (see also under caption <a href=\"#datasets\">Datasets</a>).</p>\n</blockquote>\n</li>\n</ul>\n</div>\n<div class=\"section level2\">\n<h2 id=\"imputation-algorithms\">Imputation Algorithms<a class=\"anchor\" aria-label=\"anchor\" href=\"#imputation-algorithms\"></a>\n</h2>\n<p>Here is a table with available algorithms to choose from:</p>\n<table class=\"table\">\n<colgroup>\n<col width=\"25%\">\n<col width=\"74%\">\n</colgroup>\n<thead><tr>\n<th align=\"left\">Function</th>\n<th align=\"left\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td align=\"left\">na_interpolation</td>\n<td align=\"left\">Missing Value Imputation by Interpolation</td>\n</tr>\n<tr>\n<td align=\"left\">na_kalman</td>\n<td align=\"left\">Missing Value Imputation by Kalman Smoothing</td>\n</tr>\n<tr>\n<td align=\"left\">na_locf</td>\n<td align=\"left\">Missing Value Imputation by Last Observation Carried Forward</td>\n</tr>\n<tr>\n<td align=\"left\">na_ma</td>\n<td align=\"left\">Missing Value Imputation by Weighted Moving Average</td>\n</tr>\n<tr>\n<td align=\"left\">na_mean</td>\n<td align=\"left\">Missing Value Imputation by Mean Value</td>\n</tr>\n<tr>\n<td align=\"left\">na_random</td>\n<td align=\"left\">Missing Value Imputation by Random Sample</td>\n</tr>\n<tr>\n<td align=\"left\">na_remove</td>\n<td align=\"left\">Remove Missing Values</td>\n</tr>\n<tr>\n<td align=\"left\">na_replace</td>\n<td align=\"left\">Replace Missing Values by a Defined Value</td>\n</tr>\n<tr>\n<td align=\"left\">na_seadec</td>\n<td align=\"left\">Seasonally Decomposed Missing Value Imputation</td>\n</tr>\n<tr>\n<td align=\"left\">na_seasplit</td>\n<td align=\"left\">Seasonally Splitted Missing Value Imputation</td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p>This is a rather broad overview. The functions itself mostly offer more than just one algorithm. For example na_interpolation can be set to linear or spline interpolation.</p>\n</blockquote>\n<p>More detailed information about the algorithms and their options can be found in the <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\">imputeTS reference manual</a>.</p>\n</div>\n<div class=\"section level2\">\n<h2 id=\"missing-data-plots\">Missing Data Plots<a class=\"anchor\" aria-label=\"anchor\" href=\"#missing-data-plots\"></a>\n</h2>\n<p>Here is a table with available plots to choose from:</p>\n<table class=\"table\">\n<colgroup>\n<col width=\"27%\">\n<col width=\"72%\">\n</colgroup>\n<thead><tr>\n<th align=\"left\">Function</th>\n<th align=\"left\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td align=\"left\">ggplot_na_distribution</td>\n<td align=\"left\">Visualize Distribution of Missing Values</td>\n</tr>\n<tr>\n<td align=\"left\">ggplot_na_distribution2</td>\n<td align=\"left\">Missing Values Summarized in Time Intervals</td>\n</tr>\n<tr>\n<td align=\"left\">ggplot_na_gapsize</td>\n<td align=\"left\">Visualize Distribution of NA Gapsizes</td>\n</tr>\n<tr>\n<td align=\"left\">ggplot_na_gapsize2</td>\n<td align=\"left\">Visualize Total NAs of Different NA Gapsizes</td>\n</tr>\n<tr>\n<td align=\"left\">ggplot_na_imputations</td>\n<td align=\"left\">Visualize Imputed Values</td>\n</tr>\n</tbody>\n</table>\n<p>More detailed information about the plots can be found in the <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\">imputeTS reference manual</a> and in the <a href=\"https://cran.r-project.org/web/packages/imputeTS/vignettes/gallery_visualizations.html\" class=\"external-link\">Gallery of Visualizations</a>.</p>\n<div class=\"section level3\">\n<h3 id=\"datasets\">Datasets<a class=\"anchor\" aria-label=\"anchor\" href=\"#datasets\"></a>\n</h3>\n<p>There are three datasets (each in two versions) available:</p>\n<table class=\"table\">\n<colgroup>\n<col width=\"20%\">\n<col width=\"79%\">\n</colgroup>\n<thead><tr>\n<th align=\"left\">Dataset</th>\n<th align=\"left\">Description</th>\n</tr></thead>\n<tbody>\n<tr>\n<td align=\"left\">tsAirgap</td>\n<td align=\"left\">Time series of monthly airline passengers (with NAs)</td>\n</tr>\n<tr>\n<td align=\"left\">tsAirgapComplete</td>\n<td align=\"left\">Time series of monthly airline passengers (complete)</td>\n</tr>\n<tr>\n<td align=\"left\">tsHeating</td>\n<td align=\"left\">Time series of a heating systems supply temperature (with NAs)</td>\n</tr>\n<tr>\n<td align=\"left\">tsHeatingComplete</td>\n<td align=\"left\">Time series of a heating systems supply temperature (complete)</td>\n</tr>\n<tr>\n<td align=\"left\">tsNH4</td>\n<td align=\"left\">Time series of NH4 concentration in a wastewater system (with NAs)</td>\n</tr>\n<tr>\n<td align=\"left\">tsNH4Complete</td>\n<td align=\"left\">Time series of NH4 concentration in a wastewater system (complete)</td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p>The tsAirgap, tsHeating and tsNH4 time series are with NAs. Their <strong>complete</strong> versions are without NAs. Except the missing values their versions are identical. The NAs for the time series were artifically inserted by simulating the missing data pattern observed in similar non-complete time series from the same domain. Having a complete and incomplete version of the same dataset is useful for conducting experiments of imputation functions.</p>\n</blockquote>\n<p>More detailed information about the datasets can be found in the <a href=\"https://cran.r-project.org/package=imputeTS\" class=\"external-link\">imputeTS reference manual</a>.</p>\n</div>\n</div>\n<div class=\"section level2\">\n<h2 id=\"reference\">Reference<a class=\"anchor\" aria-label=\"anchor\" href=\"#reference\"></a>\n</h2>\n<p>You can cite imputeTS the following:</p>\n<blockquote>\n<p>Moritz, Steffen, and Bartz-Beielstein, Thomas. “imputeTS: Time Series Missing Value Imputation in R.” R Journal 9.1 (2017). doi: 10.32614/RJ-2017-009.</p>\n</blockquote>\n</div>\n<div class=\"section level2\">\n<h2 id=\"need-help\">Need Help?<a class=\"anchor\" aria-label=\"anchor\" href=\"#need-help\"></a>\n</h2>\n<p>If you have general programming problems or need help using the package please ask your question on <a href=\"https://stackoverflow.com/tags/imputets/info\" class=\"external-link\">StackOverflow</a>. By doing so all users will be able to benefit in the future from your question.</p>\n<blockquote>\n<p>Don’t forget to mark your question with the <a href=\"https://stackoverflow.com/questions/tagged/imputets\" class=\"external-link\">imputets</a> tag on StackOverflow to get me notified</p>\n</blockquote>\n<div class=\"section level3\">\n<h3 id=\"support\">Support<a class=\"anchor\" aria-label=\"anchor\" href=\"#support\"></a>\n</h3>\n<p>If you found a bug or have suggestions, feel free to get in contact via steffen.moritz10 at gmail.com.</p>\n<blockquote>\n<p>All feedback is welcome</p>\n</blockquote>\n</div>\n<div class=\"section level3\">\n<h3 id=\"version\">Version<a class=\"anchor\" aria-label=\"anchor\" href=\"#version\"></a>\n</h3>\n<p><strong>3.4</strong></p>\n</div>\n<div class=\"section level3\">\n<h3 id=\"license\">License<a class=\"anchor\" aria-label=\"anchor\" href=\"#license\"></a>\n</h3>\n<p>GPL-3</p>\n</div>\n</div>\n</div>\n\n  </div>\n\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <div class=\"links\">\n<h2 data-toc-skip>Links</h2>\n<ul class=\"list-unstyled\">\n<li><a href=\"https://cloud.r-project.org/package=imputeTS\" class=\"external-link\">View on CRAN</a></li>\n<li><a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">Browse source code</a></li>\n<li><a href=\"https://github.com/SteffenMoritz/imputeTS/issues\" class=\"external-link\">Report a bug</a></li>\n</ul>\n</div>\n\n<div class=\"license\">\n<h2 data-toc-skip>License</h2>\n<ul class=\"list-unstyled\">\n<li><a href=\"https://www.r-project.org/Licenses/GPL-3\" class=\"external-link\">GPL-3</a></li>\n</ul>\n</div>\n\n\n<div class=\"citation\">\n<h2 data-toc-skip>Citation</h2>\n<ul class=\"list-unstyled\">\n<li><a href=\"authors.html#citation\">Citing imputeTS</a></li>\n</ul>\n</div>\n\n<div class=\"developers\">\n<h2 data-toc-skip>Developers</h2>\n<ul class=\"list-unstyled\">\n<li>Steffen Moritz <br><small class=\"roles\"> Author, maintainer, copyright holder </small> <a href=\"https://orcid.org/0000-0002-0085-1804\" target=\"orcid.widget\" aria-label=\"ORCID\" class=\"external-link\"><span class=\"fab fa-orcid orcid\" aria-hidden=\"true\"></span></a>  </li>\n<li>Sebastian Gatscha <br><small class=\"roles\"> Author </small>   </li>\n<li><a href=\"authors.html\">More about authors...</a></li>\n</ul>\n</div>\n\n\n\n  </div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p>\n<p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p>\n<p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer>\n</div>\n\n\n\n\n\n\n  </body>\n</html>\n"
  },
  {
    "path": "docs/news/index.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Changelog • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Changelog\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-news\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n      <h1 data-toc-skip>Changelog <small></small></h1>\n      <small>Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/NEWS.md\" class=\"external-link\"><code>NEWS.md</code></a></small>\n    </div>\n\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"3.4\" id=\"changes-in-version-34\">Changes in Version 3.4<a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-34\"></a></h2>\n<ul><li><p>Added ggplot_na_gapsize2 plot (and unit tests). Nice way to illustrate how different NA gapsizes (consecutive NAs in a row) amount for NA totals.</p></li>\n<li><p>Fix of the CITATION file to comply with newer CRAN rules</p></li>\n<li><p>Update of ggplot_na_imputations() to avoid using now depreciated ggplot2 options</p></li>\n<li><p>Update of unit tests for all plotting functions (ggplot_na_…). Now using is_ggplot() to check for correct output. This was necessary because of a major ggplot2 update (switch to s7 classes).</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"3.3\" id=\"changes-in-version-33\">Changes in Version 3.3<small>2022-09-09</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-33\"></a></h2>\n<p>Thanks to Sabrina Krys, Kevin Villalobos, Tracy Shen, hezhichao1991, englianhu for bug / issue reporting. Thanks to RicardaP for fixing documentation error. Thanks to Ronald Hause for the commit to optimize parameter pass trough from approx to na_interpolation.</p>\n<ul><li><p>Renamed ggplot_na_intervals to ggplot_na_distribution2</p></li>\n<li><p>Updates to ggplot_na_gapsize: Space between the bars adjusted for better optics. Added parameters for directly choosing the bar border color and alpha value for filling of the bars.</p></li>\n<li><p>Improved notification message for na_seadec/na_seasplit when find_frequency couldn’t find a seasonal pattern.</p></li>\n<li><p>Corrected error in na_kalman documentation - auto.arima was wrongly described as default parameter choice, while in reality it is StructTS (reported by RicardaP)</p></li>\n<li><p>Changes for the error handling. (<strong>These changes got reverted and did not make it into the CRAN release</strong>). For some specific cases the input checks performed by imputeTS stop pipe workflows in their entirety. E.g. a problem when group_by leads to all NA subsets - which fail the input check and then stop the whole pipe workflow. To prevent this, stop() is only called, when the user supplied imputeTS algorithm parameter options are wrong or misspelled. Unsupported input data will only give a warning() (and do not perform any action on the data). Thus, there is no call to stop(), that cancels the whole pipe workflow. (issue reported by Sabrina Krys). This works fine, but after closer consideration we figured people fail to notice warnings way too often and thus it is more user friendly to clearly stop with an error for these issues. After all, the users data analysis clearly profits from taking a closer look in these specific cases. If you are anyhow interested in the version without the reverted changes, it can be installed from github with the following command: devtools::install_github(“<a href=\"https://github.com/SteffenMoritz/imputeTS/commit/aaf759216b4091e36dee6e8e3a10185ff8f4647b\" class=\"external-link uri\">https://github.com/SteffenMoritz/imputeTS/commit/aaf759216b4091e36dee6e8e3a10185ff8f4647b</a>”)</p></li>\n<li><p>Improved error messages (especially for multivariate inputs) and unit tests for the warnings and errors.</p></li>\n<li><p>Corrected typo in ‘Input data needs at least x non-NA data points’ error message</p></li>\n<li><p>Better parameter pass trough from approx to na_interpolation- Added capability to alter rule for linear extrapolation outside the interval [min(x), max(x)] (commit by Ronald Hause)</p></li>\n<li><p>Improved na_interpolation documentation (more information about possible parameter pass through from underlying spline, approx,stinterp functions)</p></li>\n<li><p>Additional unit tests</p></li>\n<li><p>Moved to Github Actions instead of TravisCI / AppVeyor.</p></li>\n<li><p>Bugfix for “Error in optim(init[mask], getLike, method =”L-BFGS-B”, lower = rep(0, : L-BFGS-B needs finite values of ‘fn’.”, which comes for completely constant input to na_kalman e.g. 4,4,4,NA,4,4. (reported by Kevin Villalobos, Tracy Shen, hezhichao1991, englianhu)</p></li>\n<li><p>Improved na_seadec documentation (algorithm details)</p></li>\n<li><p>Changed R Version requirement in Description to R (&gt;= 3.6) since imported packages like ggtext and also some testthat tests were already requiring newer versions than the old R (≥ 3.0.1) requirement of imputeTS</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"3.2\" id=\"changes-in-version-32\">Changes in Version 3.2<small>2021-01-16</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-32\"></a></h2>\n<p>Thanks to Mark J. Lamias for bug / issue reporting. Thanks to Cyrus Mohammadian for bug reporting. Thanks to Miroslaw Janik for issue reporting.</p>\n<ul><li><p>Fix to remove CRAN note - removed not used utils from DESCRIPTION imports</p></li>\n<li><p>Minor fix to ggplot_na_distribution (bars end now at max(timeseries)*1.05)</p></li>\n<li><p>Typo corrections in statsNA</p></li>\n<li><p>Specified ggplot2 (&gt;= 3.3.0) in imports, to prevent errors with older ggplot2 versions (reported by Cyrus Mohammadian)</p></li>\n<li><p>Updated na_locf documentation to make behavior of na_remaining parameter more clear (issue reported by Mark J. Lamias)</p></li>\n<li><p>ggplot_na_intervals, has now percentages with % sign (e.g. 10%) on y-scale instead of just numbers (e.g. 0,1) (suggestion from Miroslaw Janik)</p></li>\n<li><p>Added some figures and the Cheat Sheet .pptx to .Rbuildignore to avoid CRAN warning about<br>\npackage size. These files and figures were not needed for the CRAN version.</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"3.1\" id=\"changes-in-version-31\">Changes in Version 3.1<small>2020-08-04</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-31\"></a></h2>\n<p>Thanks to Johannes Menzel for bug reporting, Thanks to Jan (jmablans) for bug reporting. Thanks to Earo Wang for speedup of plotNA.gapsize. Special Thanks to Sebastian Gatscha for plotting functions, new na_mean options, new unit tests.</p>\n<ul><li><p>Plotting functions are all in ggplot now (way better looking). Additionally they got renamed accordingly ggplot_na_distribution, ggplot_na_intervals, ggplot_na_gapsize, ggplot_na_imputations.</p></li>\n<li><p>Speedup for plotNA_gapsize calculation (now renamed ggplot_na_gapsize) (thx to Earo Wang)</p></li>\n<li><p>Added harmonic and geometric mean as option for na_mean</p></li>\n<li><p>Removed bug in na_replace - it can now be used with all NA vectors since it requires no minimum of non-NA values (reported by Jan - jmablans)</p></li>\n<li><p>Improved na.random input check (usable with all NA input now if upper and lower bound parameters are explicitly set to numeric values)</p></li>\n<li><p>Additional unit tests for the plotting functions</p></li>\n<li><p>Additional unit tests for the all imputation functions (testing all NA input)</p></li>\n<li><p>Update for testthat unit tests</p></li>\n<li><p>Fixed a mistake in README.md (reported by Johannes Menzel)</p></li>\n<li><p>Added to statsNA: Number of Gaps, Average Gap Size + reformatting of code + compatibility with other ts objects</p></li>\n<li><p>Documentation improvements through newer roxygen version (Markup now possible in documentation)</p></li>\n<li><p>updated Readme + Vignette to new function names</p></li>\n<li><p>Added the imputeTS Cheat Sheet as Vignette</p></li>\n<li><p>Added new vignette Gallery Missing Data Visualizations</p></li>\n<li><p>Added revdep</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"3.0\" id=\"changes-in-version-30\">Changes in Version 3.0<small>2019-07-01</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-30\"></a></h2>\n<p>Thanks to Jim Maas, shreydesai, Breza, CameronNemo for reporting bugs. Thanks to Sebastian Gatscha providing the (way faster) C++ na.ma() implementation.</p>\n<ul><li><p>tibble and tstibble compatibility</p></li>\n<li><p>Reworked internal code documentation</p></li>\n<li><p>na.ma speed up via C++</p></li>\n<li><p>Changed vignette builder to R.rsp</p></li>\n<li><p>Used R package styler package to optimize source code readability</p></li>\n<li><p>Made some changes to better follow tidyverse style guide</p></li>\n<li><p>Replaced na. with na_ e.g. na.mean with na_mean usw.This fits better to modern code style guidelines. The old function names will still work for a while, but give a warning.</p></li>\n<li><p>Added findFrequency option to na.seadec and na.seasplit</p></li>\n<li><p>Added maxgap option</p></li>\n<li><p>Fixed bug for na.seadec - also imputed known values in some special cases (reported by CameronNemo)</p></li>\n<li><p>Added doi: 10.32614/RJ-2017-009 to describtion, references, readme and citation file</p></li>\n<li><p>Added StackExchange link to Readme</p></li>\n<li><p>Moved stinepack from imports to suggested</p></li>\n<li><p>Internal reorganization of imports - now always using pkg::function and importFrom pkg x1 x2 x3instead of just import pkg</p></li>\n<li><p>Fixed bug in na.ma when using xts time series with NA at the end</p></li>\n<li><p>Fixed error message in na.interpolation if wrong parameter is given<br>\nstop(“Wrong parameter ‘option’ given. Value must be either ‘linear’, ‘spline’ or ‘stine’.”) (reported by Breza)</p></li>\n<li><p>Fixed spelling mistakes in na.seadec and na.seasplit (reported by shreydesai)</p></li>\n<li><p>Fixed bug with na.random() output (reported by Jim Maas)</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.7\" id=\"changes-in-version-27\">Changes in Version 2.7<small>2018-06-20</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-27\"></a></h2>\n<ul><li><p>Updated Description: Orcid Id added, packages required for unit test add as “Suggested”</p></li>\n<li><p>Small correction in README.md, small update to citation file</p></li>\n<li><p>Replaced NEWS with NEWS.md for better formatting</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.6\" id=\"changes-in-version-26\">Changes in Version 2.6<small>2018-03-20</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-26\"></a></h2>\n<ul><li><p>Updated citation file</p></li>\n<li><p>Minor changes to vignette</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.5\" id=\"changes-in-version-25\">Changes in Version 2.5<small>2017-06-13</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-25\"></a></h2>\n<ul><li>Adjusted unit test to a update of forecast package</li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.4\" id=\"changes-in-version-24\">Changes in Version 2.4<small>2017-06-05</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-24\"></a></h2>\n<ul><li><p>Small speed improvments for na.kalman</p></li>\n<li><p>Improved input check for all functions</p></li>\n<li><p>Bugfix for unit tests</p></li>\n<li><p>Changes to unit test (because of zoo update)</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.3\" id=\"changes-in-version-23\">Changes in Version 2.3<small>2017-05-21</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-23\"></a></h2>\n<ul><li><p>Bugfix for na.kalman with integer input</p></li>\n<li><p>Readme Update</p></li>\n<li><p>Improved error messages for na.seasplit and na.seadec</p></li>\n<li><p>Minor vignette changes</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.2\" id=\"changes-in-version-22\">Changes in Version 2.2<small>2017-04-23</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-22\"></a></h2>\n<ul><li>Bugfix for na.locf (also concerned na.kalman)</li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.1\" id=\"changes-in-version-21\">Changes in Version 2.1<small>2017-04-18</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-21\"></a></h2>\n<ul><li><p>Fixed for problems with Solaris/Sparc</p></li>\n<li><p>Fixes for problems with vignette on osx</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"2.0\" id=\"changes-in-version-20\">Changes in Version 2.0<small>2017-04-08</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-20\"></a></h2>\n<ul><li><p>Bugfix for plots without missing data</p></li>\n<li><p>Increased performance for na.locf</p></li>\n<li><p>Minor bugfixes for specific data.frame inputs</p></li>\n<li><p>Minor bugfixes for specific xts object inputs</p></li>\n<li><p>Improved Code Documentation</p></li>\n<li><p>Added new software tests</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"1.9\" id=\"changes-in-version-19\">Changes in Version 1.9<small>2017-03-09</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-19\"></a></h2>\n<ul><li>Added Vignette</li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"1.8\" id=\"changes-in-version-18\">Changes in Version 1.8<small>2017-01-25</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-18\"></a></h2>\n<ul><li><p>Computation time improvments for na.locf (up to 10000 times faster)</p></li>\n<li><p>Computation time improvments for na.interpolation (up to 10000 times faster)</p></li>\n<li><p>Computation time improvments for na.kalman (only slightly faster, under 10%)</p></li>\n<li><p>Fixed unnecessary warning message with some na.kalman options</p></li>\n<li><p>Adjusted default parameters for plotNA.distributionBar (using nclass.Sturges for breaks parameter)</p></li>\n<li><p>Fixed issue with too sensitive input checking</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"1.7\" id=\"changes-in-version-17\">Changes in Version 1.7<small>2016-10-13</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-17\"></a></h2>\n<ul><li><p>Enabled usage of multivariate input (data.frame, mts, matrix,…) for all imputation functions except na.remove. This means users do not have to loop through all columns by themselfes anymore if they want to use the package with multivariate data. The imputation itself is still performend in univariate manner (column after column).</p></li>\n<li><p>Improved compatibility with different advanced time series objects like zoo and xts. Using the imputation functions with these time series objects should be possible now. These series will not be explicitly named as possible input in the user documentation. Absence of errors can not be guaranteed. However, there are no known issues yet.</p></li>\n<li><p>Added several things for unit tests with pkg ‘testthat’</p></li>\n<li><p>Added unit tests for every function</p></li>\n<li><p>Adjusted error messages</p></li>\n<li><p>Internal Coding style improvement: replaced all T with TRUE and all F with FALSE</p></li>\n<li><p>Adjustment tsHeating / tsHeatingComplete datasets (set 1440 as frequency parameter)</p></li>\n<li><p>Adjustment tsNH4 / tsNH4Complete datasets (set 144 as frequency parameter)</p></li>\n<li><p>Fixes for grammar, spelling and citations in the whole documentation</p></li>\n<li><p>Revised examples in the documentation for all functions</p></li>\n<li><p>Restricted output of na.remove to vector only (issue with incorrect time information otherwise)</p></li>\n<li><p>Added better x-axes labels for plotNA.distribution</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"1.6\" id=\"changes-in-version-16\">Changes in Version 1.6<small>2016-06-03</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-16\"></a></h2>\n<ul><li><p>Added github links to description file</p></li>\n<li><p>Added citation file</p></li>\n<li><p>Updated Readme (badges for travis ci and cran status)</p></li>\n<li><p>Fix in documentation for na.interpolation (due to outdated descriptions)</p></li>\n<li><p>Fix in documentation plotNA.distribution / plotNA.distributionBar (due to interchanged descriptions)</p></li>\n<li><p>Added references to used packages in na.kalman and na.interpolation documentation</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"1.5\" id=\"changes-in-version-15\">Changes in Version 1.5<small>2016-04-28</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-15\"></a></h2>\n<ul><li><p>Allows now also numeric vectors as input</p></li>\n<li><p>Removed na.identifier parameter for all functions (too error prone, better handled individually by the user)</p></li>\n<li><p>Minor changes in na.interpolation with option = “stine”</p></li>\n<li><p>Added na.ma imputation function</p></li>\n<li><p>Replaced “data” in all function parameters with the more common “x”</p></li>\n<li><p>Improvement of all code examples</p></li>\n<li><p>Renamed heating/heatingComplete dataset to tsHeating/tsHeatingComplete</p></li>\n<li><p>Renamed nh4/nh4Complete dataset to tsNH4/tsNH4Complete</p></li>\n<li><p>Added tsAirgap / tsAirgapComplete datasets</p></li>\n<li><p>Improved imputeTS-package documentation</p></li>\n<li><p>Added na.kalman imputation function</p></li>\n<li><p>Added README.md function</p></li>\n<li><p>Added statsNA function</p></li>\n<li><p>Added plotNA.gapsize function</p></li>\n<li><p>Renamed vis.imputations to plotNA.imputations</p></li>\n<li><p>Renamed vis.barMissing to plotNA.distributionBar</p></li>\n<li><p>Renamed vis.missing to plotNA.distribution</p></li>\n<li><p>Fixed issues with parameter pass through and legend for all plotting functions</p></li>\n<li><p>Improved dataset documentation</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"0.4\" id=\"changes-in-version-04\">Changes in Version 0.4<small>2015-12-04</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-04\"></a></h2>\n<ul><li><p>Update of vis.differences (better looking plot now)</p></li>\n<li><p>Added vis.missing to visualize the distribution of missing data in a time series</p></li>\n<li><p>Added vis.barMissing, which is especially suited to visualize missing data in very huge time series</p></li>\n<li><p>Update na.interpolate (added Stineman interpolation and enabled … parameter for all interpolation algorithms to pass through parameters to the underlying functions)</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"0.3\" id=\"changes-in-version-03\">Changes in Version 0.3<small>2015-11-05</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-03\"></a></h2>\n<ul><li><p>Added two datasets of sensor data</p></li>\n<li><p>vis.differences for plotting differences between real and imputed values</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"0.2\" id=\"changes-in-version-02\">Changes in Version 0.2<a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-02\"></a></h2>\n<ul><li><p>Removed internal functions from visible package documentation</p></li>\n<li><p>Added additional algorithms: na.seasplit and na.seadec</p></li>\n<li><p>internal function for algorithm selection</p></li>\n</ul></div>\n    <div class=\"section level2\">\n<h2 class=\"page-header\" data-toc-text=\"0.1\" id=\"changes-in-version-01\">Changes in Version 0.1<small>2015-07-22</small><a class=\"anchor\" aria-label=\"anchor\" href=\"#changes-in-version-01\"></a></h2>\n<ul><li><p>Created initial version of imputeTS package for univariate time series imputation</p></li>\n<li><p>added the simple imputation functions: na.locf, na.mean, na.random, na.interpolation, na.replace</p></li>\n<li><p>added na.remove function for removing all NAs from a time series</p></li>\n</ul></div>\n  </div>\n\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/pkgdown.css",
    "content": "/* Sticky footer */\n\n/**\n * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/\n * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css\n *\n * .Site -> body > .container\n * .Site-content -> body > .container .row\n * .footer -> footer\n *\n * Key idea seems to be to ensure that .container and __all its parents__\n * have height set to 100%\n *\n */\n\nhtml, body {\n  height: 100%;\n}\n\nbody {\n  position: relative;\n}\n\nbody > .container {\n  display: flex;\n  height: 100%;\n  flex-direction: column;\n}\n\nbody > .container .row {\n  flex: 1 0 auto;\n}\n\nfooter {\n  margin-top: 45px;\n  padding: 35px 0 36px;\n  border-top: 1px solid #e5e5e5;\n  color: #666;\n  display: flex;\n  flex-shrink: 0;\n}\nfooter p {\n  margin-bottom: 0;\n}\nfooter div {\n  flex: 1;\n}\nfooter .pkgdown {\n  text-align: right;\n}\nfooter p {\n  margin-bottom: 0;\n}\n\nimg.icon {\n  float: right;\n}\n\n/* Ensure in-page images don't run outside their container */\n.contents img {\n  max-width: 100%;\n  height: auto;\n}\n\n/* Fix bug in bootstrap (only seen in firefox) */\nsummary {\n  display: list-item;\n}\n\n/* Typographic tweaking ---------------------------------*/\n\n.contents .page-header {\n  margin-top: calc(-60px + 1em);\n}\n\ndd {\n  margin-left: 3em;\n}\n\n/* Section anchors ---------------------------------*/\n\na.anchor {\n  display: none;\n  margin-left: 5px;\n  width: 20px;\n  height: 20px;\n\n  background-image: url(./link.svg);\n  background-repeat: no-repeat;\n  background-size: 20px 20px;\n  background-position: center center;\n}\n\nh1:hover .anchor,\nh2:hover .anchor,\nh3:hover .anchor,\nh4:hover .anchor,\nh5:hover .anchor,\nh6:hover .anchor {\n  display: inline-block;\n}\n\n/* Fixes for fixed navbar --------------------------*/\n\n.contents h1, .contents h2, .contents h3, .contents h4 {\n  padding-top: 60px;\n  margin-top: -40px;\n}\n\n/* Navbar submenu --------------------------*/\n\n.dropdown-submenu {\n  position: relative;\n}\n\n.dropdown-submenu>.dropdown-menu {\n  top: 0;\n  left: 100%;\n  margin-top: -6px;\n  margin-left: -1px;\n  border-radius: 0 6px 6px 6px;\n}\n\n.dropdown-submenu:hover>.dropdown-menu {\n  display: block;\n}\n\n.dropdown-submenu>a:after {\n  display: block;\n  content: \" \";\n  float: right;\n  width: 0;\n  height: 0;\n  border-color: transparent;\n  border-style: solid;\n  border-width: 5px 0 5px 5px;\n  border-left-color: #cccccc;\n  margin-top: 5px;\n  margin-right: -10px;\n}\n\n.dropdown-submenu:hover>a:after {\n  border-left-color: #ffffff;\n}\n\n.dropdown-submenu.pull-left {\n  float: none;\n}\n\n.dropdown-submenu.pull-left>.dropdown-menu {\n  left: -100%;\n  margin-left: 10px;\n  border-radius: 6px 0 6px 6px;\n}\n\n/* Sidebar --------------------------*/\n\n#pkgdown-sidebar {\n  margin-top: 30px;\n  position: -webkit-sticky;\n  position: sticky;\n  top: 70px;\n}\n\n#pkgdown-sidebar h2 {\n  font-size: 1.5em;\n  margin-top: 1em;\n}\n\n#pkgdown-sidebar h2:first-child {\n  margin-top: 0;\n}\n\n#pkgdown-sidebar .list-unstyled li {\n  margin-bottom: 0.5em;\n}\n\n/* bootstrap-toc tweaks ------------------------------------------------------*/\n\n/* All levels of nav */\n\nnav[data-toggle='toc'] .nav > li > a {\n  padding: 4px 20px 4px 6px;\n  font-size: 1.5rem;\n  font-weight: 400;\n  color: inherit;\n}\n\nnav[data-toggle='toc'] .nav > li > a:hover,\nnav[data-toggle='toc'] .nav > li > a:focus {\n  padding-left: 5px;\n  color: inherit;\n  border-left: 1px solid #878787;\n}\n\nnav[data-toggle='toc'] .nav > .active > a,\nnav[data-toggle='toc'] .nav > .active:hover > a,\nnav[data-toggle='toc'] .nav > .active:focus > a {\n  padding-left: 5px;\n  font-size: 1.5rem;\n  font-weight: 400;\n  color: inherit;\n  border-left: 2px solid #878787;\n}\n\n/* Nav: second level (shown on .active) */\n\nnav[data-toggle='toc'] .nav .nav {\n  display: none; /* Hide by default, but at >768px, show it */\n  padding-bottom: 10px;\n}\n\nnav[data-toggle='toc'] .nav .nav > li > a {\n  padding-left: 16px;\n  font-size: 1.35rem;\n}\n\nnav[data-toggle='toc'] .nav .nav > li > a:hover,\nnav[data-toggle='toc'] .nav .nav > li > a:focus {\n  padding-left: 15px;\n}\n\nnav[data-toggle='toc'] .nav .nav > .active > a,\nnav[data-toggle='toc'] .nav .nav > .active:hover > a,\nnav[data-toggle='toc'] .nav .nav > .active:focus > a {\n  padding-left: 15px;\n  font-weight: 500;\n  font-size: 1.35rem;\n}\n\n/* orcid ------------------------------------------------------------------- */\n\n.orcid {\n  font-size: 16px;\n  color: #A6CE39;\n  /* margins are required by official ORCID trademark and display guidelines */\n  margin-left:4px;\n  margin-right:4px;\n  vertical-align: middle;\n}\n\n/* Reference index & topics ----------------------------------------------- */\n\n.ref-index th {font-weight: normal;}\n\n.ref-index td {vertical-align: top; min-width: 100px}\n.ref-index .icon {width: 40px;}\n.ref-index .alias {width: 40%;}\n.ref-index-icons .alias {width: calc(40% - 40px);}\n.ref-index .title {width: 60%;}\n\n.ref-arguments th {text-align: right; padding-right: 10px;}\n.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px}\n.ref-arguments .name {width: 20%;}\n.ref-arguments .desc {width: 80%;}\n\n/* Nice scrolling for wide elements --------------------------------------- */\n\ntable {\n  display: block;\n  overflow: auto;\n}\n\n/* Syntax highlighting ---------------------------------------------------- */\n\npre, code, pre code {\n  background-color: #f8f8f8;\n  color: #333;\n}\npre, pre code {\n  white-space: pre-wrap;\n  word-break: break-all;\n  overflow-wrap: break-word;\n}\n\npre {\n  border: 1px solid #eee;\n}\n\npre .img, pre .r-plt {\n  margin: 5px 0;\n}\n\npre .img img, pre .r-plt img {\n  background-color: #fff;\n}\n\ncode a, pre a {\n  color: #375f84;\n}\n\na.sourceLine:hover {\n  text-decoration: none;\n}\n\n.fl      {color: #1514b5;}\n.fu      {color: #000000;} /* function */\n.ch,.st  {color: #036a07;} /* string */\n.kw      {color: #264D66;} /* keyword */\n.co      {color: #888888;} /* comment */\n\n.error   {font-weight: bolder;}\n.warning {font-weight: bolder;}\n\n/* Clipboard --------------------------*/\n\n.hasCopyButton {\n  position: relative;\n}\n\n.btn-copy-ex {\n  position: absolute;\n  right: 0;\n  top: 0;\n  visibility: hidden;\n}\n\n.hasCopyButton:hover button.btn-copy-ex {\n  visibility: visible;\n}\n\n/* headroom.js ------------------------ */\n\n.headroom {\n  will-change: transform;\n  transition: transform 200ms linear;\n}\n.headroom--pinned {\n  transform: translateY(0%);\n}\n.headroom--unpinned {\n  transform: translateY(-100%);\n}\n\n/* mark.js ----------------------------*/\n\nmark {\n  background-color: rgba(255, 255, 51, 0.5);\n  border-bottom: 2px solid rgba(255, 153, 51, 0.3);\n  padding: 1px;\n}\n\n/* vertical spacing after htmlwidgets */\n.html-widget {\n  margin-bottom: 10px;\n}\n\n/* fontawesome ------------------------ */\n\n.fab {\n    font-family: \"Font Awesome 5 Brands\" !important;\n}\n\n/* don't display links in code chunks when printing */\n/* source: https://stackoverflow.com/a/10781533 */\n@media print {\n  code a:link:after, code a:visited:after {\n    content: \"\";\n  }\n}\n\n/* Section anchors ---------------------------------\n   Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71\n*/\n\ndiv.csl-bib-body { }\ndiv.csl-entry {\n  clear: both;\n}\n.hanging-indent div.csl-entry {\n  margin-left:2em;\n  text-indent:-2em;\n}\ndiv.csl-left-margin {\n  min-width:2em;\n  float:left;\n}\ndiv.csl-right-inline {\n  margin-left:2em;\n  padding-left:1em;\n}\ndiv.csl-indent {\n  margin-left: 2em;\n}\n"
  },
  {
    "path": "docs/pkgdown.js",
    "content": "/* http://gregfranko.com/blog/jquery-best-practices/ */\n(function($) {\n  $(function() {\n\n    $('.navbar-fixed-top').headroom();\n\n    $('body').css('padding-top', $('.navbar').height() + 10);\n    $(window).resize(function(){\n      $('body').css('padding-top', $('.navbar').height() + 10);\n    });\n\n    $('[data-toggle=\"tooltip\"]').tooltip();\n\n    var cur_path = paths(location.pathname);\n    var links = $(\"#navbar ul li a\");\n    var max_length = -1;\n    var pos = -1;\n    for (var i = 0; i < links.length; i++) {\n      if (links[i].getAttribute(\"href\") === \"#\")\n        continue;\n      // Ignore external links\n      if (links[i].host !== location.host)\n        continue;\n\n      var nav_path = paths(links[i].pathname);\n\n      var length = prefix_length(nav_path, cur_path);\n      if (length > max_length) {\n        max_length = length;\n        pos = i;\n      }\n    }\n\n    // Add class to parent <li>, and enclosing <li> if in dropdown\n    if (pos >= 0) {\n      var menu_anchor = $(links[pos]);\n      menu_anchor.parent().addClass(\"active\");\n      menu_anchor.closest(\"li.dropdown\").addClass(\"active\");\n    }\n  });\n\n  function paths(pathname) {\n    var pieces = pathname.split(\"/\");\n    pieces.shift(); // always starts with /\n\n    var end = pieces[pieces.length - 1];\n    if (end === \"index.html\" || end === \"\")\n      pieces.pop();\n    return(pieces);\n  }\n\n  // Returns -1 if not found\n  function prefix_length(needle, haystack) {\n    if (needle.length > haystack.length)\n      return(-1);\n\n    // Special case for length-0 haystack, since for loop won't run\n    if (haystack.length === 0) {\n      return(needle.length === 0 ? 0 : -1);\n    }\n\n    for (var i = 0; i < haystack.length; i++) {\n      if (needle[i] != haystack[i])\n        return(i);\n    }\n\n    return(haystack.length);\n  }\n\n  /* Clipboard --------------------------*/\n\n  function changeTooltipMessage(element, msg) {\n    var tooltipOriginalTitle=element.getAttribute('data-original-title');\n    element.setAttribute('data-original-title', msg);\n    $(element).tooltip('show');\n    element.setAttribute('data-original-title', tooltipOriginalTitle);\n  }\n\n  if(ClipboardJS.isSupported()) {\n    $(document).ready(function() {\n      var copyButton = \"<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copy to clipboard' aria-label='Copy to clipboard' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>\";\n\n      $(\"div.sourceCode\").addClass(\"hasCopyButton\");\n\n      // Insert copy buttons:\n      $(copyButton).prependTo(\".hasCopyButton\");\n\n      // Initialize tooltips:\n      $('.btn-copy-ex').tooltip({container: 'body'});\n\n      // Initialize clipboard:\n      var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {\n        text: function(trigger) {\n          return trigger.parentNode.textContent.replace(/\\n#>[^\\n]*/g, \"\");\n        }\n      });\n\n      clipboardBtnCopies.on('success', function(e) {\n        changeTooltipMessage(e.trigger, 'Copied!');\n        e.clearSelection();\n      });\n\n      clipboardBtnCopies.on('error', function() {\n        changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');\n      });\n    });\n  }\n})(window.jQuery || window.$)\n"
  },
  {
    "path": "docs/pkgdown.yml",
    "content": "pandoc: '3.4'\npkgdown: 2.1.3\npkgdown_sha: ~\narticles:\n  gallery_visualizations: gallery_visualizations.html\nlast_built: 2025-08-24T22:33Z\nurls:\n  reference: https://SteffenMoritz.github.io/imputeTS/reference\n  article: https://SteffenMoritz.github.io/imputeTS/articles\n"
  },
  {
    "path": "docs/reference/ggplot_na_distribution.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Line Plot to Visualize the Distribution of Missing Values — ggplot_na_distribution • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Line Plot to Visualize the Distribution of Missing Values — ggplot_na_distribution\"><meta property=\"og:description\" content=\"Visualize the distribution of missing values within a time series.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Line Plot to Visualize the Distribution of Missing Values</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/ggplot_na_distribution.R\" class=\"external-link\"><code>R/ggplot_na_distribution.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_distribution.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the distribution of missing values within a time series.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  x_axis_labels <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  color_points <span class=\"op\">=</span> <span class=\"st\">\"steelblue\"</span>,</span>\n<span>  color_lines <span class=\"op\">=</span> <span class=\"st\">\"steelblue2\"</span>,</span>\n<span>  color_missing <span class=\"op\">=</span> <span class=\"st\">\"indianred\"</span>,</span>\n<span>  color_missing_border <span class=\"op\">=</span> <span class=\"st\">\"indianred\"</span>,</span>\n<span>  alpha_missing <span class=\"op\">=</span> <span class=\"fl\">0.5</span>,</span>\n<span>  title <span class=\"op\">=</span> <span class=\"st\">\"Distribution of Missing Values\"</span>,</span>\n<span>  subtitle <span class=\"op\">=</span> <span class=\"st\">\"Time Series with highlighted missing regions\"</span>,</span>\n<span>  xlab <span class=\"op\">=</span> <span class=\"st\">\"Time\"</span>,</span>\n<span>  ylab <span class=\"op\">=</span> <span class=\"st\">\"Value\"</span>,</span>\n<span>  shape_points <span class=\"op\">=</span> <span class=\"fl\">20</span>,</span>\n<span>  size_points <span class=\"op\">=</span> <span class=\"fl\">2.5</span>,</span>\n<span>  theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a></span><span class=\"op\">(</span><span class=\"op\">)</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series\n(<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.</p></dd>\n\n\n<dt id=\"arg-x-axis-labels\">x_axis_labels<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x-axis-labels\"></a></dt>\n<dd><p>For adding specific x-axis labels. Takes a vector of\n<code><a href=\"https://rdrr.io/r/base/Dates.html\" class=\"external-link\">Date</a></code> or <code><a href=\"https://rdrr.io/r/base/DateTimeClasses.html\" class=\"external-link\">POSIXct</a></code> objects\nas an input (needs the same length as x) . The Default (NULL) uses the\nobservation numbers as  x-axis tick labels.</p></dd>\n\n\n<dt id=\"arg-color-points\">color_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-points\"></a></dt>\n<dd><p>Color for the Symbols/Points.</p></dd>\n\n\n<dt id=\"arg-color-lines\">color_lines<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-lines\"></a></dt>\n<dd><p>Color for the Lines.</p></dd>\n\n\n<dt id=\"arg-color-missing\">color_missing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-missing\"></a></dt>\n<dd><p>Color used for highlighting the time spans with NA values.</p></dd>\n\n\n<dt id=\"arg-color-missing-border\">color_missing_border<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-missing-border\"></a></dt>\n<dd><p>Color used as border for time spans with NA values.</p></dd>\n\n\n<dt id=\"arg-alpha-missing\">alpha_missing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-alpha-missing\"></a></dt>\n<dd><p>Alpha (transparency) value used for color_missing.</p></dd>\n\n\n<dt id=\"arg-title\">title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-title\"></a></dt>\n<dd><p>Title of the Plot (NULL for deactivating title).</p></dd>\n\n\n<dt id=\"arg-subtitle\">subtitle<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-subtitle\"></a></dt>\n<dd><p>Subtitle of the Plot (NULL for deactivating subtitle).</p></dd>\n\n\n<dt id=\"arg-xlab\">xlab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-xlab\"></a></dt>\n<dd><p>Label for x-Axis.</p></dd>\n\n\n<dt id=\"arg-ylab\">ylab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ylab\"></a></dt>\n<dd><p>Label for y-Axis.</p></dd>\n\n\n<dt id=\"arg-shape-points\">shape_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-shape-points\"></a></dt>\n<dd><p>Symbol to use for the Observations/Points. See\nhttps://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.</p></dd>\n\n\n<dt id=\"arg-size-points\">size_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-size-points\"></a></dt>\n<dd><p>Size of Symbols/Points.</p></dd>\n\n\n<dt id=\"arg-theme\">theme<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-theme\"></a></dt>\n<dd><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a>)</code></p></dd>\n\n</dl></div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>This function visualizes the distribution of missing values within\na time series. If a value is NA, the background is colored differently.\nThis gives a good overview of where most missing values occur.</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n<p>For very long time series it might happen, that the plot gets too crowded\nand overplotting issues occur. In this case the\n<code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code> plotting function can provide\na more condensed overview.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>,\n<code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code>,\n<code><a href=\"ggplot_na_gapsize2.html\">ggplot_na_gapsize2</a></code>,\n<code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz, Sebastian Gatscha</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Visualize the missing values in x</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\">stats</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">1</span><span class=\"op\">:</span><span class=\"fl\">11</span>, <span class=\"fl\">4</span><span class=\"op\">:</span><span class=\"fl\">9</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">11</span><span class=\"op\">:</span><span class=\"fl\">15</span>, <span class=\"fl\">7</span><span class=\"op\">:</span><span class=\"fl\">15</span>, <span class=\"fl\">15</span><span class=\"op\">:</span><span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">2</span><span class=\"op\">:</span><span class=\"fl\">5</span>, <span class=\"fl\">3</span><span class=\"op\">:</span><span class=\"fl\">7</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-1.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Visualize the missing values in tsAirgap time series</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-2.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">1</span><span class=\"op\">:</span><span class=\"fl\">11</span>, <span class=\"fl\">4</span><span class=\"op\">:</span><span class=\"fl\">9</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">11</span><span class=\"op\">:</span><span class=\"fl\">15</span>, <span class=\"fl\">7</span><span class=\"op\">:</span><span class=\"fl\">15</span>, <span class=\"fl\">15</span><span class=\"op\">:</span><span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">2</span><span class=\"op\">:</span><span class=\"fl\">5</span>, <span class=\"fl\">3</span><span class=\"op\">:</span><span class=\"fl\">7</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-3.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Visualize NAs in tsAirgap - different color for points</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_distribution function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, color_points <span class=\"op\">=</span> <span class=\"st\">\"grey\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-4.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Visualize NAs in tsAirgap - different theme</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_distribution function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_classic</a></span><span class=\"op\">(</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-5.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Visualize NAs in tsAirgap - title, subtitle in center</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.subtitle <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-6.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 7: Visualize NAs in tsAirgap - title in center, no subtitle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, subtitle <span class=\"op\">=</span> <span class=\"cn\">NULL</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-7.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 8: Visualize NAs in tsAirgap - x-axis texts with angle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, color_points <span class=\"op\">=</span> <span class=\"st\">\"grey\"</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>axis.text.x <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>angle <span class=\"op\">=</span> <span class=\"fl\">60</span>, hjust <span class=\"op\">=</span> <span class=\"fl\">1</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution-8.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span>  </span></span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_distribution2.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Stacked Bar Plot to Visualize Missing Values per Time Interval — ggplot_na_distribution2 • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Stacked Bar Plot to Visualize Missing Values per Time Interval — ggplot_na_distribution2\"><meta property=\"og:description\" content=\"Visualization of missing values in barplot form.\nEspecially useful when looking at specific intervals and for\ntime series with a lot of observations.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Stacked Bar Plot to Visualize Missing Values per Time Interval</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/ggplot_na_distribution2.R\" class=\"external-link\"><code>R/ggplot_na_distribution2.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_distribution2.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualization of missing values in barplot form.\nEspecially useful when looking at specific intervals and for\ntime series with a lot of observations.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  number_intervals <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  interval_size <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  measure <span class=\"op\">=</span> <span class=\"st\">\"percent\"</span>,</span>\n<span>  color_missing <span class=\"op\">=</span> <span class=\"st\">\"indianred2\"</span>,</span>\n<span>  color_existing <span class=\"op\">=</span> <span class=\"st\">\"steelblue\"</span>,</span>\n<span>  alpha_missing <span class=\"op\">=</span> <span class=\"fl\">0.8</span>,</span>\n<span>  alpha_existing <span class=\"op\">=</span> <span class=\"fl\">0.3</span>,</span>\n<span>  title <span class=\"op\">=</span> <span class=\"st\">\"Missing Values per Interval\"</span>,</span>\n<span>  subtitle <span class=\"op\">=</span> <span class=\"st\">\"Amount of NA and non-NA for successive intervals\"</span>,</span>\n<span>  xlab <span class=\"op\">=</span> <span class=\"st\">\"Time Lapse (Interval Size: XX)\"</span>,</span>\n<span>  ylab <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  color_border <span class=\"op\">=</span> <span class=\"st\">\"white\"</span>,</span>\n<span>  theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a></span><span class=\"op\">(</span><span class=\"op\">)</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series\n(<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.</p></dd>\n\n\n<dt id=\"arg-number-intervals\">number_intervals<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-number-intervals\"></a></dt>\n<dd><p>Defines the number of bins to be created. Default\nnumber of intervals (denoted by NULL) is calculated by <code><a href=\"https://rdrr.io/r/grDevices/nclass.html\" class=\"external-link\">nclass.Sturges</a></code>\nusing Sturges' formula. If the interval_size parameter is set to a value\ndifferent to NULL this parameter is ignored.</p></dd>\n\n\n<dt id=\"arg-interval-size\">interval_size<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-interval-size\"></a></dt>\n<dd><p>Defines how many observations should be in one bin/interval.\nThe required number of overall bins is afterwards calculated automatically.\nIf used this parameter overwrites the number_intervals parameter.\nFor a very long time series be sure to make the interval_size not extremely\nsmall, otherwise because of  overplotting issues nothing can be seen until\nyou also increase the plot width.</p></dd>\n\n\n<dt id=\"arg-measure\">measure<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-measure\"></a></dt>\n<dd><p>Whether the NA / non-NA ratio should be given as\npercent or absolute numbers.</p>\n<ul><li><p>\"percent\" - for percentages</p></li>\n<li><p>\"count\" - for absolute numbers of NAs</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-color-missing\">color_missing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-missing\"></a></dt>\n<dd><p>Color for the amount of missing values.</p></dd>\n\n\n<dt id=\"arg-color-existing\">color_existing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-existing\"></a></dt>\n<dd><p>Color for the amount of existing values.</p></dd>\n\n\n<dt id=\"arg-alpha-missing\">alpha_missing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-alpha-missing\"></a></dt>\n<dd><p>Alpha (transparency) value for the missing values.</p></dd>\n\n\n<dt id=\"arg-alpha-existing\">alpha_existing<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-alpha-existing\"></a></dt>\n<dd><p>Alpha (transparency) value for the existing values.</p></dd>\n\n\n<dt id=\"arg-title\">title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-title\"></a></dt>\n<dd><p>Title of the Plot (NULL for deactivating title).</p></dd>\n\n\n<dt id=\"arg-subtitle\">subtitle<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-subtitle\"></a></dt>\n<dd><p>Subtitle of the Plot (NULL for deactivating subtitle).</p></dd>\n\n\n<dt id=\"arg-xlab\">xlab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-xlab\"></a></dt>\n<dd><p>Label for x-Axis. Automatically set to the current interval size, if\nno custom text is chosen.</p></dd>\n\n\n<dt id=\"arg-ylab\">ylab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ylab\"></a></dt>\n<dd><p>Label for y-Axis. As default (NULL), the axis is automatically set\nto either 'Percent' or 'Count' dependent on the settings of parameter <code>measure</code>.</p></dd>\n\n\n<dt id=\"arg-color-border\">color_border<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-border\"></a></dt>\n<dd><p>Color for the small borders between the intervals/bins.\nDefault is 'white'.</p></dd>\n\n\n<dt id=\"arg-theme\">theme<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-theme\"></a></dt>\n<dd><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a>)</code></p></dd>\n\n</dl></div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>This function visualizes the distribution of missing values within\na time series. In comparison to the <code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>\nfunction this is not done by plotting each observation of the time series\nseparately. Instead observations for time intervals are represented as\nintervals/bins of multiple values. For these intervals information about\nthe amount of missing values are shown. This has the advantage, that also\nfor large time series a plot which is easy to overview can be created.</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>,\n<code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code>,\n<code><a href=\"ggplot_na_gapsize2.html\">ggplot_na_gapsize2</a></code>,\n<code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz, Sebastian Gatscha</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Visualize the missing values in tsNH4 time series as percentages</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-1.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Visualize the missing values in tsNH4 time series as counts </span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, measure <span class=\"op\">=</span> <span class=\"st\">\"count\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-2.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Visualize the missing values in tsHeating time series</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsHeating</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-3.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsNH4</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-4.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Visualize NAs in tsNH4 - exactly 8 intervals</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, number_intervals <span class=\"op\">=</span> <span class=\"fl\">8</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-5.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Visualize NAs in tsNH4 - 300 observations per interval</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, interval_size <span class=\"op\">=</span> <span class=\"fl\">300</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-6.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 7: Visualize NAs in tsAirgap - different color for NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_distribution2 function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, color_missing <span class=\"op\">=</span> <span class=\"st\">\"pink\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-7.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 8: Visualize NAs in tsNH4 - different theme</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_distribution2 function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_classic</a></span><span class=\"op\">(</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-8.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 9: Visualize NAs in tsAirgap - title, subtitle in center</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.subtitle <span class=\"op\">=</span> <span class=\"fu\">ggtext</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://wilkelab.org/ggtext/reference/element_markdown.html\" class=\"external-link\">element_markdown</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-9.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 10: Visualize NAs in tsAirgap - title in center, no subtitle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, subtitle <span class=\"op\">=</span> <span class=\"cn\">NULL</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-10.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 11: Visualize NAs in tsAirgap - x-axis texts with angle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_distribution2</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, color_missing <span class=\"op\">=</span> <span class=\"st\">\"grey\"</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>axis.text.x <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>angle <span class=\"op\">=</span> <span class=\"fl\">60</span>, hjust <span class=\"op\">=</span> <span class=\"fl\">1</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_distribution2-11.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span>  </span></span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_gapsize.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Bar Plot to Visualize Occurrences of Different NA Gap Sizes — ggplot_na_gapsize • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Bar Plot to Visualize Occurrences of Different NA Gap Sizes — ggplot_na_gapsize\"><meta property=\"og:description\" content=\"Visualize the Number of Occurrences for existing NA Gap Sizes\n(NAs in a row) in a Time Series\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Bar Plot to Visualize Occurrences of Different NA Gap Sizes</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/ggplot_na_gapsize.R\" class=\"external-link\"><code>R/ggplot_na_gapsize.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_gapsize.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the Number of Occurrences for existing NA Gap Sizes\n(NAs in a row) in a Time Series</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  limit <span class=\"op\">=</span> <span class=\"fl\">10</span>,</span>\n<span>  include_total <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>,</span>\n<span>  ranked_by <span class=\"op\">=</span> <span class=\"st\">\"occurrence\"</span>,</span>\n<span>  color_occurrence <span class=\"op\">=</span> <span class=\"st\">\"indianred\"</span>,</span>\n<span>  color_total <span class=\"op\">=</span> <span class=\"st\">\"steelblue\"</span>,</span>\n<span>  color_border <span class=\"op\">=</span> <span class=\"st\">\"black\"</span>,</span>\n<span>  alpha_bars <span class=\"op\">=</span> <span class=\"fl\">1</span>,</span>\n<span>  title <span class=\"op\">=</span> <span class=\"st\">\"Occurrence of gap sizes\"</span>,</span>\n<span>  subtitle <span class=\"op\">=</span> <span class=\"st\">\"Gap sizes (NAs in a row) ordered by most common\"</span>,</span>\n<span>  xlab <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  ylab <span class=\"op\">=</span> <span class=\"st\">\"Number occurrence\"</span>,</span>\n<span>  legend <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>,</span>\n<span>  orientation <span class=\"op\">=</span> <span class=\"st\">\"horizontal\"</span>,</span>\n<span>  label_occurrence <span class=\"op\">=</span> <span class=\"st\">\"Number occurrence gapsize\"</span>,</span>\n<span>  label_total <span class=\"op\">=</span> <span class=\"st\">\"Resulting NAs for gapsize\"</span>,</span>\n<span>  theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a></span><span class=\"op\">(</span><span class=\"op\">)</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series\n(<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.</p></dd>\n\n\n<dt id=\"arg-limit\">limit<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-limit\"></a></dt>\n<dd><p>Specifies how many of the most common gap sizes are shown in\nthe plot.Default is 10. So only the 10 most often occurring gapsizes will\nbe shown. If more or all present gap sizes should be displayed, the limit needs\nto be increased. Since this might add a lot of additional data, having\nparameter  <code>orientation</code> set to 'horizontal' avoids overlaps in the axis\nlabels.</p></dd>\n\n\n<dt id=\"arg-include-total\">include_total<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-include-total\"></a></dt>\n<dd><p>When set to TRUE the total NA count for a gapsize is\nincluded in the plot (total = number occurrence x gap size).\nE.g. if a gapsize of 3 occurs 10 times, this means this gap size makes\nup for 30 NAs in total. This can be a good indicator of the\noverall impact of a gapsize.</p></dd>\n\n\n<dt id=\"arg-ranked-by\">ranked_by<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ranked-by\"></a></dt>\n<dd><p>Should the results be sorted according to the number of\noccurrence or total resulting NAs for a gapsize. Total resulting NAs\nare calculated by (total = number occurrence x gap size).</p><ul><li><p>\"occurrence\" - Sorting by 'number of occurrence' of a gap size</p></li>\n<li><p>\"total\" - Sorting by 'total resulting NAs' of a gap size</p></li>\n</ul><p>The default setting is \"occurrence\".</p></dd>\n\n\n<dt id=\"arg-color-occurrence\">color_occurrence<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-occurrence\"></a></dt>\n<dd><p>Defines the Color for the Bars of\n'number of occurrence'.</p></dd>\n\n\n<dt id=\"arg-color-total\">color_total<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-total\"></a></dt>\n<dd><p>Defines the color for the bars of\n'total resulting NAs'.</p></dd>\n\n\n<dt id=\"arg-color-border\">color_border<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-border\"></a></dt>\n<dd><p>Defines the color for the border of the bars.</p></dd>\n\n\n<dt id=\"arg-alpha-bars\">alpha_bars<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-alpha-bars\"></a></dt>\n<dd><p>Alpha (transparency) value used for filling the bars.</p></dd>\n\n\n<dt id=\"arg-title\">title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-title\"></a></dt>\n<dd><p>Title of the Plot.</p></dd>\n\n\n<dt id=\"arg-subtitle\">subtitle<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-subtitle\"></a></dt>\n<dd><p>Subtitle of the Plot.</p></dd>\n\n\n<dt id=\"arg-xlab\">xlab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-xlab\"></a></dt>\n<dd><p>Label for x-Axis.</p></dd>\n\n\n<dt id=\"arg-ylab\">ylab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ylab\"></a></dt>\n<dd><p>Label for y-Axis.</p></dd>\n\n\n<dt id=\"arg-legend\">legend<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend\"></a></dt>\n<dd><p>If TRUE a legend is added at the bottom.</p></dd>\n\n\n<dt id=\"arg-orientation\">orientation<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-orientation\"></a></dt>\n<dd><p>Can be either 'vertical' or 'horizontal'. Defines\nif the bars are plotted vertically or horizontally. For large amounts\nof different gap sizes horizontal illustration is favorable (also see\nparameter <code>limit</code>).</p></dd>\n\n\n<dt id=\"arg-label-occurrence\">label_occurrence<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-label-occurrence\"></a></dt>\n<dd><p>Defines the label assigned to 'number of occurrence'\nin the legend.</p></dd>\n\n\n<dt id=\"arg-label-total\">label_total<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-label-total\"></a></dt>\n<dd><p>Defines the label assigned to 'total resulting NAs'\nin the legend.</p></dd>\n\n\n<dt id=\"arg-theme\">theme<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-theme\"></a></dt>\n<dd><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a>)</code></p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>The output is a <code><a href=\"https://ggplot2.tidyverse.org/reference/ggplot2-package.html\" class=\"external-link\">ggplot2</a></code> object that can be\nfurther adjusted by using the ggplot syntax</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>This plotting function can be used to visualize the length of\nthe NA gaps (NAs in a row) in a time series. It shows a ranking of which\ngap sizes occur most often. This ranking can be ordered by the number\noccurrence of the gap sizes or by total resulting NAs for this gap size\n(occurrence * gap length). A NA-gap of 3 occurring 10 times means 30 total\nresulting NAs.</p>\n<p>A resulting plot can for example be described like this:\na 2 NA-gap (2 NAs in a row) occurred  27 times,\na 9 NA-gap (9 NAs in a row) occurred  11 times,\na 27 NA-gap (27 NAs in a row) occurred  1 times, ...</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series with NAs that shall be visualized). All other parameters\nare solely for altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric, the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_gapsize2.html\">ggplot_na_gapsize2</a></code>,\n<code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>,\n<code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>,\n<code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz, Sebastian Gatscha</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Visualize the top gap sizes in tsNH4 (top 10 by default)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-1.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Visualize the top gap sizes in tsAirgap - horizontal bars</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, orientation <span class=\"op\">=</span> <span class=\"st\">\"vertical\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-2.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsNH4</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-3.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Visualize the top 20 gap sizes in tsNH4</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, limit <span class=\"op\">=</span> <span class=\"fl\">20</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-4.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Visualize top gap sizes in tsNH4 without showing total NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, limit <span class=\"op\">=</span> <span class=\"fl\">20</span>, include_total <span class=\"op\">=</span> <span class=\"cn\">FALSE</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-5.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Visualize top gap sizes in tsNH4 but ordered by total NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># (total = occurrence * gap length)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, limit <span class=\"op\">=</span> <span class=\"fl\">20</span>, ranked_by <span class=\"op\">=</span> <span class=\"st\">\"total\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-6.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 7: Visualize top gap sizes in tsNH4 - different theme</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_gapsize function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_classic</a></span><span class=\"op\">(</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-7.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 8: Visualize top gap sizes in tsNH4 - title, subtitle in center</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.subtitle <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-8.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 9: Visualize top gap sizes in tsNH4 - title in center, no subtitle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, subtitle <span class=\"op\">=</span> <span class=\"cn\">NULL</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-9.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 10: Top gap sizes in tsNH4 - legend on the right and color change</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, color_total <span class=\"op\">=</span> <span class=\"st\">\"grey\"</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>legend.position <span class=\"op\">=</span> <span class=\"st\">\"right\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize-10.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_gapsize2.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Bubble Plot to Visualize Total NA Count of NA gap sizes — ggplot_na_gapsize2 • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Bubble Plot to Visualize Total NA Count of NA gap sizes — ggplot_na_gapsize2\"><meta property=\"og:description\" content=\"Visualize the total NA count (gap size * occurrence) for\nthe existing gaps sizes (NAs in a row).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Bubble Plot to Visualize Total NA Count of NA gap sizes</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/ggplot_na_gapsize2.R\" class=\"external-link\"><code>R/ggplot_na_gapsize2.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_gapsize2.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the total NA count (gap size * occurrence) for\nthe existing gaps sizes (NAs in a row).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  colors_bubbles <span class=\"op\">=</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"st\">\"#FCFBFF\"</span>, <span class=\"st\">\"#EFEEFA\"</span>, <span class=\"st\">\"#DDDAEF\"</span>, <span class=\"st\">\"#C8C3E2\"</span>, <span class=\"st\">\"#B1AAD4\"</span>, <span class=\"st\">\"#9A8FC4\"</span>,</span>\n<span>    <span class=\"st\">\"#8273B5\"</span>, <span class=\"st\">\"#6B56A7\"</span>, <span class=\"st\">\"#553695\"</span>, <span class=\"st\">\"#3D1778\"</span><span class=\"op\">)</span>,</span>\n<span>  color_border <span class=\"op\">=</span> <span class=\"st\">\"black\"</span>,</span>\n<span>  alpha_bubbles <span class=\"op\">=</span> <span class=\"fl\">0.4</span>,</span>\n<span>  labels_bubbles <span class=\"op\">=</span> <span class=\"st\">\"none\"</span>,</span>\n<span>  size_bubbles <span class=\"op\">=</span> <span class=\"fl\">25</span>,</span>\n<span>  min_totals <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  min_occurrence <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  min_gapsize <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  max_gapsize <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  title <span class=\"op\">=</span> <span class=\"st\">\"Gap Size Analysis\"</span>,</span>\n<span>  subtitle <span class=\"op\">=</span> <span class=\"st\">\"Total NA counts for different gapsizes\"</span>,</span>\n<span>  xlab <span class=\"op\">=</span> <span class=\"st\">\"Gapsize\"</span>,</span>\n<span>  ylab <span class=\"op\">=</span> <span class=\"st\">\"Number occurrence\"</span>,</span>\n<span>  legend <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>,</span>\n<span>  legend_breaks <span class=\"op\">=</span> <span class=\"fl\">4</span>,</span>\n<span>  legend_title <span class=\"op\">=</span> <span class=\"st\">\"Total NAs\"</span>,</span>\n<span>  legend_position <span class=\"op\">=</span> <span class=\"st\">\"right\"</span>,</span>\n<span>  legend_point_sizes <span class=\"op\">=</span> <span class=\"st\">\"default\"</span>,</span>\n<span>  theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a></span><span class=\"op\">(</span><span class=\"op\">)</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series\n(<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object containing NAs. This is the only\nmandatory parameter - all other parameters are only needed for adjusting\nthe plot appearance.</p></dd>\n\n\n<dt id=\"arg-colors-bubbles\">colors_bubbles<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-colors-bubbles\"></a></dt>\n<dd><p>Choose a color gradient that encodes lower to\nhigher total NA counts.\nColor codes can be given as vector. Using color palettes from  colorspace,\ngrDevices, RColorBrewer or other packages is useful here.\nE.g. grDevices::heat.colors(10) would be a possible input.</p></dd>\n\n\n<dt id=\"arg-color-border\">color_border<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-border\"></a></dt>\n<dd><p>Color for the border of the bubbles.</p></dd>\n\n\n<dt id=\"arg-alpha-bubbles\">alpha_bubbles<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-alpha-bubbles\"></a></dt>\n<dd><p>Alpha (transparency) value used for filling the bubbles.</p></dd>\n\n\n<dt id=\"arg-labels-bubbles\">labels_bubbles<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-labels-bubbles\"></a></dt>\n<dd><p>Should labels be added to the individual bubbles inside\nthe plot.\nFor many datasets there will be overplotting issues once labels are added.\nIn these cases using the min_gapsize, min_totals or min_occurrence options\nmight be useful to only display the most relevant gap sizes.</p>\n<p>You can choose between these labels to be added:</p><ul><li><p>\"none\" - No label gets added to the bubbles\n(default choice)</p></li>\n<li><p>\"gap\" - Adds a label displaying the gap size belonging to the\nrespective bubble</p></li>\n<li><p>\"total\" - Adds a label displaying the total NA count for the\nrespective bubble</p></li>\n<li><p>\"gap-occurrence\" - Adds a label displaying the respective\ngap size and number of its occurrence</p></li>\n</ul><p>The default setting is \"none\".</p></dd>\n\n\n<dt id=\"arg-size-bubbles\">size_bubbles<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-size-bubbles\"></a></dt>\n<dd><p>Allows to scale the size of the bubbles.\nSome experimenting with this parameter might be needed to get\na good visualization for your specific dataset.</p></dd>\n\n\n<dt id=\"arg-min-totals\">min_totals<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-min-totals\"></a></dt>\n<dd><p>Only print bubbles for gap sizes that account\nfor at least min_totals NAs in the time series.</p></dd>\n\n\n<dt id=\"arg-min-occurrence\">min_occurrence<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-min-occurrence\"></a></dt>\n<dd><p>Only print bubbles for gap sizes that occur at least\nmin_occurrence times in the time series.</p></dd>\n\n\n<dt id=\"arg-min-gapsize\">min_gapsize<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-min-gapsize\"></a></dt>\n<dd><p>Only show gap sizes larger than min_gapsize. Together with\nmax_gapsize enables zooming into in certain regions of interest.</p></dd>\n\n\n<dt id=\"arg-max-gapsize\">max_gapsize<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-max-gapsize\"></a></dt>\n<dd><p>Only show gapsizes smaller than max_gapsize. Together with\nmin_gapsize enables zooming into in certain regions of interest.</p></dd>\n\n\n<dt id=\"arg-title\">title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-title\"></a></dt>\n<dd><p>Title of the Plot.</p></dd>\n\n\n<dt id=\"arg-subtitle\">subtitle<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-subtitle\"></a></dt>\n<dd><p>Subtitle of the Plot.</p></dd>\n\n\n<dt id=\"arg-xlab\">xlab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-xlab\"></a></dt>\n<dd><p>Label for x-Axis.</p></dd>\n\n\n<dt id=\"arg-ylab\">ylab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ylab\"></a></dt>\n<dd><p>Label for y-Axis.</p></dd>\n\n\n<dt id=\"arg-legend\">legend<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend\"></a></dt>\n<dd><p>If TRUE a legend is added on the right side</p></dd>\n\n\n<dt id=\"arg-legend-breaks\">legend_breaks<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend-breaks\"></a></dt>\n<dd><p>Number of displayed breaks / labels in the legend.\nNeeds an integer giving the desired number of breaks as input. Breakpoints are\ninternally calculated by R's pretty() function, which can also lead to\nvalues slightly smaller or larger than the desired number.</p></dd>\n\n\n<dt id=\"arg-legend-title\">legend_title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend-title\"></a></dt>\n<dd><p>Defines the title of the legend.</p></dd>\n\n\n<dt id=\"arg-legend-position\">legend_position<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend-position\"></a></dt>\n<dd><p>Defines position of the legend. Choose either\n'bottom', right', 'left' or 'top'.</p></dd>\n\n\n<dt id=\"arg-legend-point-sizes\">legend_point_sizes<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend-point-sizes\"></a></dt>\n<dd><p>Defines the size of the symbols representing the total\nNA bubbles in the legend.</p>\n<p>You can choose between \"default\", \"actual\" or a custom vector of sizes.</p>\n<ul><li><p>\"default\" - Scales the points in the legend to symbolically\nresemble the size differences (default choice)</p></li>\n<li><p>\"actual\" - Scales the points in the legend according\nto their actual size in the plot</p></li>\n</ul><p>Since these two options are not be always sufficient, a custom vector of\nsizes can be used as input. This would look like this: c(4,5,6,7). Be\naware, that the length of this vector must match the number of breakpoints\n(can be adjusted with legend_breaks).</p></dd>\n\n\n<dt id=\"arg-theme\">theme<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-theme\"></a></dt>\n<dd><p>Set a theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a>)</code></p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>The output is a <code><a href=\"https://ggplot2.tidyverse.org/reference/ggplot2-package.html\" class=\"external-link\">ggplot2</a></code> object that can be\nfurther adjusted by using the ggplot syntax</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>This function visualizes total NA counts by individual gap size\n(consecutive NAs) in a time series. The bubble plot makes it easy to see\nwhich gap sizes account for most of the NAs in the series. The size and\ncolor of the bubbles represent the total number of NAs a given gap size\naccounts for.</p>\n<p>Total NAs for a gap size are calculated as follows:\ntotal NAs = occurrence * gap length</p>\n<p>For example, interpret a bubble for gap size 2 as follows:\na 2-NA gap (two NAs in a row) occurred 27 times in the time series and thus\naccounts for 54 total NAs.</p>\n<p>On the x-axis, the different gap sizes are plotted in increasing order.\nThe y-axis shows the occurrence count of these gap sizes in the time series.</p>\n<p>The plot is useful for investigating possible root causes of the missing\ndata. It can indicate whether the missing data are random or whether there\nare patterns of interest.</p>\n<p>Depending on the input time series, there might be too much information in\nthe plot, leading to overplotting. In these cases, use the parameters\n<code>min_totals</code>, <code>min_occurrence</code>, and <code>min_gapsize</code> to display\nonly the information of interest.</p>\n<p>The only required parameter is <code>x</code> (the univariate time series with NAs\nto visualize). All other parameters alter the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric, the function also accepts\n<code>data.frame</code>, <code>tibble</code>, <code>tsibble</code>, <code>zoo</code>, or <code>xts</code>\ninput.</p>\n<p>The plot can be adjusted via function parameters. For more complex\nadjustments, you can modify the result using ggplot2 syntax, since the\nfunction returns a ggplot2 object. See the Examples for typical adjustments.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>,\n<code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>,\n<code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code>,\n<code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Visualize total NA counts in tsNH4</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-1.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Visualize total NA counts in tsNH4, different color gradient</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, colors_bubbles <span class=\"op\">=</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/base/rev.html\" class=\"external-link\">rev</a></span><span class=\"op\">(</span><span class=\"fu\">grDevices</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://rdrr.io/r/grDevices/palettes.html\" class=\"external-link\">heat.colors</a></span><span class=\"op\">(</span><span class=\"fl\">10</span><span class=\"op\">)</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-2.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsNH4</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-3.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Visualize total NA counts in tsHeating</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Limited to gap sizes that account for a total of &gt; 600 NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsHeating</span>, min_totals <span class=\"op\">=</span> <span class=\"fl\">600</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-4.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Visualize total NA counts in tsNH4 - no legend</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, legend <span class=\"op\">=</span> <span class=\"cn\">FALSE</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-5.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Visualize total NA counts in tsAirgap - increased bubble size</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, size_bubbles <span class=\"op\">=</span> <span class=\"fl\">35</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-6.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 7: Visualize total NA counts in tsNH4</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_gapsize2 function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_classic</a></span><span class=\"op\">(</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-7.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 8: Visualize total NA counts in tsNH4 - title, subtitle in center</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.subtitle <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-8.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 9: Visualize total NA counts in tsNH4 - title in center, no subtitle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, subtitle <span class=\"op\">=</span> <span class=\"cn\">NULL</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-9.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 10: Total NA counts in tsNH4 - legend on the bottom and color change</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_gapsize2</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span>, colors_bubbles <span class=\"op\">=</span> <span class=\"fu\">grDevices</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://rdrr.io/r/grDevices/palettes.html\" class=\"external-link\">heat.colors</a></span><span class=\"op\">(</span><span class=\"fl\">10</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>legend.position <span class=\"op\">=</span> <span class=\"st\">\"bottom\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_gapsize2-10.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_imputations.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Line Plot to Visualize Imputed Values — ggplot_na_imputations • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Line Plot to Visualize Imputed Values — ggplot_na_imputations\"><meta property=\"og:description\" content=\"Visualize the imputed values in a time series.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Line Plot to Visualize Imputed Values</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/ggplot_na_imputations.R\" class=\"external-link\"><code>R/ggplot_na_imputations.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_imputations.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the imputed values in a time series.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x_with_na</span>,</span>\n<span>  <span class=\"va\">x_with_imputations</span>,</span>\n<span>  x_with_truth <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  x_axis_labels <span class=\"op\">=</span> <span class=\"cn\">NULL</span>,</span>\n<span>  title <span class=\"op\">=</span> <span class=\"st\">\"Imputed Values\"</span>,</span>\n<span>  subtitle <span class=\"op\">=</span> <span class=\"st\">\"Visualization of missing value replacements\"</span>,</span>\n<span>  xlab <span class=\"op\">=</span> <span class=\"st\">\"Time\"</span>,</span>\n<span>  ylab <span class=\"op\">=</span> <span class=\"st\">\"Value\"</span>,</span>\n<span>  color_points <span class=\"op\">=</span> <span class=\"st\">\"steelblue\"</span>,</span>\n<span>  color_imputations <span class=\"op\">=</span> <span class=\"st\">\"indianred\"</span>,</span>\n<span>  color_truth <span class=\"op\">=</span> <span class=\"st\">\"seagreen3\"</span>,</span>\n<span>  color_lines <span class=\"op\">=</span> <span class=\"st\">\"lightslategray\"</span>,</span>\n<span>  shape_points <span class=\"op\">=</span> <span class=\"fl\">16</span>,</span>\n<span>  shape_imputations <span class=\"op\">=</span> <span class=\"fl\">18</span>,</span>\n<span>  shape_truth <span class=\"op\">=</span> <span class=\"fl\">16</span>,</span>\n<span>  size_points <span class=\"op\">=</span> <span class=\"fl\">1.5</span>,</span>\n<span>  size_imputations <span class=\"op\">=</span> <span class=\"fl\">2.5</span>,</span>\n<span>  size_truth <span class=\"op\">=</span> <span class=\"fl\">1.5</span>,</span>\n<span>  width_lines <span class=\"op\">=</span> <span class=\"fl\">0.5</span>,</span>\n<span>  linetype <span class=\"op\">=</span> <span class=\"st\">\"solid\"</span>,</span>\n<span>  connect_na <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>,</span>\n<span>  legend <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>,</span>\n<span>  legend_size <span class=\"op\">=</span> <span class=\"fl\">5</span>,</span>\n<span>  label_known <span class=\"op\">=</span> <span class=\"st\">\"known values\"</span>,</span>\n<span>  label_imputations <span class=\"op\">=</span> <span class=\"st\">\"imputed values\"</span>,</span>\n<span>  label_truth <span class=\"op\">=</span> <span class=\"st\">\"ground truth\"</span>,</span>\n<span>  theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a></span><span class=\"op\">(</span><span class=\"op\">)</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x-with-na\">x_with_na<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x-with-na\"></a></dt>\n<dd><p>Numeric Vector or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object\nwith NAs before imputation. This parameter and x_with_imputation shave to\nbe set. The rest of the parameters are mostly needed for adjusting the plot\nappearance.</p></dd>\n\n\n<dt id=\"arg-x-with-imputations\">x_with_imputations<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x-with-imputations\"></a></dt>\n<dd><p>Numeric Vector or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject with NAs replaced by imputed values. This parameter and\nx_with_imputation shave to be set.The rest of the parameters are mostly\nneeded for adjusting the plot appearance.</p></dd>\n\n\n<dt id=\"arg-x-with-truth\">x_with_truth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x-with-truth\"></a></dt>\n<dd><p>Numeric Vector or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object\nwith the real values (optional parameter). If the ground truth is known\n(e.g. in experiments where the missing values were artificially added)\nit can be displayed in the plot with this parameter.\nDefault is NULL (ground truth not known).</p></dd>\n\n\n<dt id=\"arg-x-axis-labels\">x_axis_labels<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x-axis-labels\"></a></dt>\n<dd><p>For adding specific x-axis labels. Takes a vector of\n<code><a href=\"https://rdrr.io/r/base/Dates.html\" class=\"external-link\">Date</a></code> or <code><a href=\"https://rdrr.io/r/base/DateTimeClasses.html\" class=\"external-link\">POSIXct</a></code> objects as an input\n(needs the same length as x_with_na).\nThe Default (NULL) uses the observation numbers as x-axis tick labels.</p></dd>\n\n\n<dt id=\"arg-title\">title<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-title\"></a></dt>\n<dd><p>Title of the Plot.</p></dd>\n\n\n<dt id=\"arg-subtitle\">subtitle<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-subtitle\"></a></dt>\n<dd><p>Subtitle of the Plot.</p></dd>\n\n\n<dt id=\"arg-xlab\">xlab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-xlab\"></a></dt>\n<dd><p>Label for x-Axis.</p></dd>\n\n\n<dt id=\"arg-ylab\">ylab<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-ylab\"></a></dt>\n<dd><p>Label for y-Axis.</p></dd>\n\n\n<dt id=\"arg-color-points\">color_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-points\"></a></dt>\n<dd><p>Color for the Symbols/Points of the non-NA Observations.</p></dd>\n\n\n<dt id=\"arg-color-imputations\">color_imputations<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-imputations\"></a></dt>\n<dd><p>Color for the Symbols/Points of the Imputed Values.</p></dd>\n\n\n<dt id=\"arg-color-truth\">color_truth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-truth\"></a></dt>\n<dd><p>Color for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).</p></dd>\n\n\n<dt id=\"arg-color-lines\">color_lines<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-color-lines\"></a></dt>\n<dd><p>Color for the Lines connecting the Observations/Points.</p></dd>\n\n\n<dt id=\"arg-shape-points\">shape_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-shape-points\"></a></dt>\n<dd><p>Shape for the Symbols/Points of the non-NA observations.\nSee https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.</p></dd>\n\n\n<dt id=\"arg-shape-imputations\">shape_imputations<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-shape-imputations\"></a></dt>\n<dd><p>Shape for the Symbols/Points of the imputed values.\nSee https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.</p></dd>\n\n\n<dt id=\"arg-shape-truth\">shape_truth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-shape-truth\"></a></dt>\n<dd><p>Shape for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).</p></dd>\n\n\n<dt id=\"arg-size-points\">size_points<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-size-points\"></a></dt>\n<dd><p>Size for the Symbols/Points of the non-NA Observations.</p></dd>\n\n\n<dt id=\"arg-size-imputations\">size_imputations<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-size-imputations\"></a></dt>\n<dd><p>Size for the Symbols/Points of the Imputed Values.</p></dd>\n\n\n<dt id=\"arg-size-truth\">size_truth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-size-truth\"></a></dt>\n<dd><p>Size for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).</p></dd>\n\n\n<dt id=\"arg-width-lines\">width_lines<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-width-lines\"></a></dt>\n<dd><p>Width for the Lines connecting the Observations/Points.</p></dd>\n\n\n<dt id=\"arg-linetype\">linetype<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-linetype\"></a></dt>\n<dd><p>Linetype for the Lines connecting the Observations/Points.</p></dd>\n\n\n<dt id=\"arg-connect-na\">connect_na<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-connect-na\"></a></dt>\n<dd><p>If TRUE the Imputations are connected\nto the non-NA observations in the plot. Otherwise there are no\nconnecting lines between symbols in NA areas.</p></dd>\n\n\n<dt id=\"arg-legend\">legend<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend\"></a></dt>\n<dd><p>If TRUE a Legend is added at the bottom.</p></dd>\n\n\n<dt id=\"arg-legend-size\">legend_size<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-legend-size\"></a></dt>\n<dd><p>Size of the Symbols used in the Legend.</p></dd>\n\n\n<dt id=\"arg-label-known\">label_known<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-label-known\"></a></dt>\n<dd><p>Legend label for the non-NA Observations.</p></dd>\n\n\n<dt id=\"arg-label-imputations\">label_imputations<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-label-imputations\"></a></dt>\n<dd><p>Legend label for the Imputed Values.</p></dd>\n\n\n<dt id=\"arg-label-truth\">label_truth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-label-truth\"></a></dt>\n<dd><p>Legend label for the Ground Truth of the NA values.</p></dd>\n\n\n<dt id=\"arg-theme\">theme<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-theme\"></a></dt>\n<dd><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_linedraw</a>)</code></p></dd>\n\n</dl></div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>This plot can be used, to visualize imputed values for a time\nseries. Imputed values (filled NA gaps) are shown in a different color\nthan the other values. If real values (ground truth) for the NA gaps are known,\nthey can be optionally added in a different color.</p>\n<p>The only really needed parameters for this function are x_with_na\n(the time series with NAs before imputation) and x_with_imputations\n(the time series without NAs after imputation). All other parameters\nare msotly for altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>,\n<code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>,\n<code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz, Sebastian Gatscha</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Visualize imputation by na_mean</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_mean</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_mean.html\">na_mean</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, <span class=\"va\">imp_mean</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-1.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Visualize imputation by na_locf and added ground truth </span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_locf</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_locf.html\">na_locf</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>, </span></span>\n<span class=\"r-in\"><span>                      x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_locf</span>,</span></span>\n<span class=\"r-in\"><span>                      x_with_truth <span class=\"op\">=</span> <span class=\"va\">tsAirgapComplete</span></span></span>\n<span class=\"r-in\"><span>                      <span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-2.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Visualize imputation by na_kalman</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_kalman</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_kalman.html\">na_kalman</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>, x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_kalman</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-3.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsAirgap</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\"><a href=\"na_mean.html\">na_mean</a></span><span class=\"op\">(</span><span class=\"op\">)</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span></span></span>\n<span class=\"r-in\"><span>  <span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-4.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span>  </span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Visualize imputation by na_seadec - different color for imputed points</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_imputations function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_seadec</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_seadec.html\">na_seadec</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>, </span></span>\n<span class=\"r-in\"><span>                      x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_seadec</span>,</span></span>\n<span class=\"r-in\"><span>                      color_imputations <span class=\"op\">=</span> <span class=\"st\">\"gold\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-5.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Visualize imputation - different theme, point size imputations</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot_na_imputations function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_seadec</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_seadec.html\">na_seadec</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>, </span></span>\n<span class=\"r-in\"><span>                      x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_seadec</span>,</span></span>\n<span class=\"r-in\"><span>                      theme <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/ggtheme.html\" class=\"external-link\">theme_classic</a></span><span class=\"op\">(</span><span class=\"op\">)</span>,</span></span>\n<span class=\"r-in\"><span>                      size_imputations <span class=\"op\">=</span> <span class=\"fl\">5</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-6.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span>                 </span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 7: Visualize imputation - title, subtitle in center</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_seadec</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_seadec.html\">na_seadec</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>,  x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_seadec</span><span class=\"op\">)</span> <span class=\"op\">+</span> </span></span>\n<span class=\"r-in\"><span>    <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>    <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.subtitle <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span>   </span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-7.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 8: Visualize imputation - title in center, no subtitle</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Plot adjustments via ggplot2 syntax and function parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">imp_mean</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"na_mean.html\">na_mean</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">ggplot_na_imputations</span><span class=\"op\">(</span>x_with_na <span class=\"op\">=</span> <span class=\"va\">tsAirgap</span>,  </span></span>\n<span class=\"r-in\"><span>                      x_with_imputations <span class=\"op\">=</span> <span class=\"va\">imp_mean</span>,</span></span>\n<span class=\"r-in\"><span>                      subtitle <span class=\"op\">=</span> <span class=\"cn\">NULL</span><span class=\"op\">)</span> <span class=\"op\">+</span></span></span>\n<span class=\"r-in\"><span>     <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/theme.html\" class=\"external-link\">theme</a></span><span class=\"op\">(</span>plot.title <span class=\"op\">=</span> <span class=\"fu\">ggplot2</span><span class=\"fu\">::</span><span class=\"fu\"><a href=\"https://ggplot2.tidyverse.org/reference/element.html\" class=\"external-link\">element_text</a></span><span class=\"op\">(</span>hjust <span class=\"op\">=</span> <span class=\"fl\">0.5</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-plt img\"><img src=\"ggplot_na_imputations-8.png\" alt=\"\" width=\"700\" height=\"433\"></span>\n<span class=\"r-in\"><span>  </span></span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_intervals.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Discontinued - Use ggplot_na_distribution2 instead. — ggplot_na_intervals • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Discontinued - Use ggplot_na_distribution2 instead. — ggplot_na_intervals\"><meta property=\"og:description\" content=\"plotNA.distributionBar was replaced by ggplot_na_distribution2.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Discontinued - Use <code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_intervals.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>plotNA.distributionBar was replaced by <code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">ggplot_na_intervals</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_level.html",
    "content": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n  <meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n<title>Dotplot of Value Distribution directly before/after NAs — ggplot_na_level • imputeTS</title>\n\n<!-- favicons -->\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"../favicon-16x16.png\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"../favicon-32x32.png\">\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"../apple-touch-icon.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"120x120\" href=\"../apple-touch-icon-120x120.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"76x76\" href=\"../apple-touch-icon-76x76.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"60x60\" href=\"../apple-touch-icon-60x60.png\" />\n\n<!-- jquery -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js\" integrity=\"sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=\" crossorigin=\"anonymous\"></script>\n<!-- Bootstrap -->\n<link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\" />\n\n\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script>\n\n<!-- bootstrap-toc -->\n<link rel=\"stylesheet\" href=\"../bootstrap-toc.css\">\n<script src=\"../bootstrap-toc.js\"></script>\n\n<!-- Font Awesome icons -->\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\" />\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\" />\n\n<!-- clipboard.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script>\n\n<!-- headroom.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script>\n\n<!-- pkgdown -->\n<link href=\"../pkgdown.css\" rel=\"stylesheet\">\n<script src=\"../pkgdown.js\"></script>\n\n\n\n\n<meta property=\"og:title\" content=\"Dotplot of Value Distribution directly before/after NAs — ggplot_na_level\" />\n<meta property=\"og:description\" content=\"Visualize the distribution of values directly\nbefore/after NAs via a dotplot.\nUseful to determine if missing values appear more often when a certain\nthreshold level is reached.\" />\n<meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\" />\n\n\n\n\n<!-- mathjax -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script>\n\n<!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n\n\n\n  </head>\n\n  <body data-spy=\"scroll\" data-target=\"#toc\">\n    <div class=\"container template-reference-topic\">\n      <header>\n      <div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Released version\">3.3</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n        <li>\n  <a href=\"../index.html\">\n    <span class=\"fas fa-home fa-lg\"></span>\n     \n  </a>\n</li>\n<li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n     \n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n    <li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul>\n      <ul class=\"nav navbar-nav navbar-right\">\n        <li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\">\n    <span class=\"fab fa-github fa-lg\"></span>\n     \n  </a>\n</li>\n      </ul>\n      \n    </div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n      \n\n      </header>\n\n<div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Dotplot of Value Distribution directly before/after NAs</h1>\n    <small class=\"dont-index\">Source: <a href='https://github.com/SteffenMoritz/imputeTS/blob/master/R/ggplot_na_level.R'><code>R/ggplot_na_level.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_level.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the distribution of values directly\nbefore/after NAs via a dotplot.\nUseful to determine if missing values appear more often when a certain\nthreshold level is reached.</p>\n    </div>\n\n    <pre class=\"usage\"><span class='fu'>ggplot_na_level</span><span class='op'>(</span>\n  <span class='va'>x</span>,\n  number_bins <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span><span class='op'>/</span><span class='fl'>10</span> <span class='op'>&lt;</span> <span class='fl'>30</span>, <span class='fl'>30</span>, <span class='fu'><a href='https://rdrr.io/r/base/length.html'>length</a></span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span><span class='op'>/</span><span class='fl'>10</span><span class='op'>)</span>,\n  color_before <span class='op'>=</span> <span class='st'>\"steelblue\"</span>,\n  color_after <span class='op'>=</span> <span class='st'>\"yellowgreen\"</span>,\n  color_regular <span class='op'>=</span> <span class='st'>\"azure2\"</span>,\n  title <span class='op'>=</span> <span class='st'>\"Before/After Analysis\"</span>,\n  subtitle <span class='op'>=</span> <span class='st'>\"Values before and after NAs\"</span>,\n  xlab <span class='op'>=</span> <span class='cn'>NULL</span>,\n  ylab <span class='op'>=</span> <span class='cn'>NULL</span>,\n  legend <span class='op'>=</span> <span class='cn'>TRUE</span>,\n  legend_title <span class='op'>=</span> <span class='st'>\"\"</span>,\n  orientation <span class='op'>=</span> <span class='st'>\"vertical\"</span>,\n  label_before <span class='op'>=</span> <span class='st'>\"before\"</span>,\n  label_after <span class='op'>=</span> <span class='st'>\"after\"</span>,\n  label_regular <span class='op'>=</span> <span class='st'>\"regular\"</span>,\n  theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a></span><span class='op'>(</span><span class='op'>)</span>\n<span class='op'>)</span></pre>\n\n    <h2 class=\"hasAnchor\" id=\"arguments\"><a class=\"anchor\" href=\"#arguments\"></a>Arguments</h2>\n    <table class=\"ref-arguments\">\n    <colgroup><col class=\"name\" /><col class=\"desc\" /></colgroup>\n    <tr>\n      <th>x</th>\n      <td><p>Numeric Vector (<code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code>) or Time Series\n(<code><a href='https://rdrr.io/r/stats/ts.html'>ts</a></code>) object containing NAs.\nThis is the only mandatory parameter - all other parameters are\nonly needed for adjusting the plot appearance.</p></td>\n    </tr>\n    <tr>\n      <th>number_bins</th>\n      <td><p>Number of bins of stacked observations to\nbe created. Default is length of time series divided\nby ten - but with a minimum of 30 bins.</p></td>\n    </tr>\n    <tr>\n      <th>color_before</th>\n      <td><p>Color for the dots representing observations\ndirectly before NA gaps.</p></td>\n    </tr>\n    <tr>\n      <th>color_after</th>\n      <td><p>Color for the dots representing\nobservations directly after NA gaps.</p></td>\n    </tr>\n    <tr>\n      <th>color_regular</th>\n      <td><p>Color for the dots representing all values\nthat are not next to NA observations.</p></td>\n    </tr>\n    <tr>\n      <th>title</th>\n      <td><p>Title of the plot (NULL for deactivating title).</p></td>\n    </tr>\n    <tr>\n      <th>subtitle</th>\n      <td><p>Subtitle of the plot (NULL for deactivating subtitle).</p></td>\n    </tr>\n    <tr>\n      <th>xlab</th>\n      <td><p>Label for x-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>ylab</th>\n      <td><p>Label for y-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>legend</th>\n      <td><p>If TRUE a legend is added at the bottom.</p></td>\n    </tr>\n    <tr>\n      <th>legend_title</th>\n      <td><p>Title for the legend.</p></td>\n    </tr>\n    <tr>\n      <th>orientation</th>\n      <td><p>Can be either 'vertical' or 'horizontal'. Defines\nif the  plot is oriented vertically or horizontally.</p></td>\n    </tr>\n    <tr>\n      <th>label_before</th>\n      <td><p>Defines the legend label assigned to the\nobservations directly before NAs.</p></td>\n    </tr>\n    <tr>\n      <th>label_after</th>\n      <td><p>Defines the legend label assigned to the\nobservations directly after NAs.</p></td>\n    </tr>\n    <tr>\n      <th>label_regular</th>\n      <td><p>Defines the legend label assigned to\nthe observations, that are not next to NA values.</p></td>\n    </tr>\n    <tr>\n      <th>theme</th>\n      <td><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a>)</code></p></td>\n    </tr>\n    </table>\n\n    <h2 class=\"hasAnchor\" id=\"details\"><a class=\"anchor\" href=\"#details\"></a>Details</h2>\n\n    <p>This function visualizes the distribution of missing\nvalues directly before/after NAs via a dotplot. This is useful to\ndetermine if missing values appear more often when near to a\ncertain value level.</p>\n<p>In a <a href='https://ggplot2.tidyverse.org/reference/geom_dotplot.html'>geom_dotplot</a> each dot represents one observation\nin the time series. It can be directly seen how many values\nare stacked into a bin (a value range).</p>\n<p>The ggplot_na_level plot makes use of this and additionally\ncolors observations before and after NAs differently.</p>\n<p>The visualization of the before/after NA observations in a bin in\ncomparison to the regular observations can provide information\nabout the root cause of the missing values. It also can provide\nindications, about the missing data mechanism (MCAR, MAR, MNAR).</p>\n<p>By looking at this plot it can be seen whether the NAs appear\nrather randomly after some values in the overall distribution or\nif e.g. it can be said NAs more likely appear after high values.</p>\n<p>It could, for example be the case, that a sensor can't measure\nvalues above 100 degree and always outputs NA values once the\ntemperature reaches 100 degree. With this plot, it can be realized,\nthat NAs in the next value always occur when the temperature is close\nto 100 degree.</p>\n<p>Thus, unusually high numbers of dots of before/after NA observations in a bin\n(in comparison the amount of dots of other observations in this bin)\nshould draw the users' attention.</p>\n<p>The advantage of the dotplot of ggplot_na_level over the violin plots of ggplot_na_level2\nis that each observation in the time series is really displayed as a dot in the dotplot.\nFor the user this can feel more intuitive. Especially, for very short time series\nthe violins/boxplots and the summary statistics they provide are not so meaningful anymore.\nOn the other hand, the ggplot_na_level is not a good choice for large time series.\nDrawing a visible dot for each observation comes to its limits, when the time series is larger\nthan 500 observations. Also, while our assessment of distributions and anomalies usually\nworks adequate on small amounts of data, we often struggle with large amounts of data.\nHere the violin/boxplot combination of ggplot_na_level2 is a great help.</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric, the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    <h2 class=\"hasAnchor\" id=\"see-also\"><a class=\"anchor\" href=\"#see-also\"></a>See also</h2>\n\n    <div class='dont-index'><p><code><a href='ggplot_na_distribution2.html'>ggplot_na_distribution2</a></code>,\n<code><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></code>,\n<code><a href='ggplot_na_level2.html'>ggplot_na_level2</a></code>,\n<code><a href='ggplot_na_distribution.html'>ggplot_na_distribution</a></code>,\n<code><a href='ggplot_na_imputations.html'>ggplot_na_imputations</a></code></p></div>\n    <h2 class=\"hasAnchor\" id=\"author\"><a class=\"anchor\" href=\"#author\"></a>Author</h2>\n\n    <p>Steffen Moritz</p>\n\n    <h2 class=\"hasAnchor\" id=\"examples\"><a class=\"anchor\" href=\"#examples\"></a>Examples</h2>\n    <pre class=\"examples\"><div class='input'><span class='co'># Example 1: Visualize the before/after NA distributions </span>\n<span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'>stats</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/stats/ts.html'>ts</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>11</span>, <span class='fl'>4</span><span class='op'>:</span><span class='fl'>9</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>11</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>7</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>15</span><span class='op'>:</span><span class='fl'>6</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>2</span><span class='op'>:</span><span class='fl'>5</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>7</span><span class='op'>)</span><span class='op'>)</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-1.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 2: Visualize the before/after in subset of tsNH4 time series, more bins</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsNH4</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>500</span><span class='op'>]</span>, number_bins <span class='op'>=</span> <span class='fl'>100</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-2.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 3: Same as example 1, just written with pipe operator</span>\n<span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/ts.html'>ts</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>11</span>, <span class='fl'>4</span><span class='op'>:</span><span class='fl'>9</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>11</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>7</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>15</span><span class='op'>:</span><span class='fl'>6</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>2</span><span class='op'>:</span><span class='fl'>5</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>7</span><span class='op'>)</span><span class='op'>)</span>\n<span class='va'>x</span> <span class='op'>%&gt;%</span> <span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-3.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 4: Visualize the before/after NA in tsAirgap - different color for violins</span>\n<span class='co'># Plot adjustments via ggplot_na_level function parameters</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsAirgap</span>, color_after <span class='op'>=</span> <span class='st'>\"green\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-4.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 5: Visualize before/after NA in tsAirgap - different theme and orientation</span>\n<span class='co'># Plot adjustments via ggplot_na_level function parameters</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsAirgap</span>, theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_classic</a></span><span class='op'>(</span><span class='op'>)</span> , orientation <span class='op'>=</span> <span class='st'>\"horizontal\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-5.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 6: Visualize before/after NA in tsNH4 - title, subtitle in center</span>\n<span class='co'># Plot adjustments via ggplot2 syntax</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsAirgap</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.subtitle <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-6.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 7: Visualize before/after NA in tsAirgap - title in center, no subtitle</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsAirgap</span>, subtitle <span class='op'>=</span> <span class='cn'>NULL</span>, orientation <span class='op'>=</span> <span class='st'>\"horizontal\"</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-7.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 8: Visualize before/after NA in tsAirgap - y-axis texts with angle</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'>ggplot_na_level</span><span class='op'>(</span><span class='va'>tsAirgap</span>, color_regular <span class='op'>=</span> <span class='st'>\"grey\"</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>axis.text.y <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>angle <span class='op'>=</span> <span class='fl'>60</span>, hjust <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level-8.png' alt='' width='700' height='433' /></div><div class='input'>  \n</div></pre>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\">\n      <h2 data-toc-skip>Contents</h2>\n    </nav>\n  </div>\n</div>\n\n\n      <footer>\n      <div class=\"copyright\">\n  <p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p>Site built with <a href=\"https://pkgdown.r-lib.org/\">pkgdown</a> 1.6.1.</p>\n</div>\n\n      </footer>\n   </div>\n\n  \n\n\n  </body>\n</html>\n\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_level2.html",
    "content": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n  <meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n<title>Parallel Violin Plots of Value Distributions directly before/after NAs — ggplot_na_level2 • imputeTS</title>\n\n<!-- favicons -->\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"../favicon-16x16.png\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"../favicon-32x32.png\">\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"../apple-touch-icon.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"120x120\" href=\"../apple-touch-icon-120x120.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"76x76\" href=\"../apple-touch-icon-76x76.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"60x60\" href=\"../apple-touch-icon-60x60.png\" />\n\n<!-- jquery -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js\" integrity=\"sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=\" crossorigin=\"anonymous\"></script>\n<!-- Bootstrap -->\n<link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\" />\n\n\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script>\n\n<!-- bootstrap-toc -->\n<link rel=\"stylesheet\" href=\"../bootstrap-toc.css\">\n<script src=\"../bootstrap-toc.js\"></script>\n\n<!-- Font Awesome icons -->\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\" />\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\" />\n\n<!-- clipboard.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script>\n\n<!-- headroom.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script>\n\n<!-- pkgdown -->\n<link href=\"../pkgdown.css\" rel=\"stylesheet\">\n<script src=\"../pkgdown.js\"></script>\n\n\n\n\n<meta property=\"og:title\" content=\"Parallel Violin Plots of Value Distributions directly before/after NAs — ggplot_na_level2\" />\n<meta property=\"og:description\" content=\"Visualize the distribution of values directly before/after NAs via violin plots.\nUseful to determine if missing values appear more often when a certain\nthreshold level is reached.\" />\n<meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\" />\n\n\n\n\n<!-- mathjax -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script>\n\n<!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n\n\n\n  </head>\n\n  <body data-spy=\"scroll\" data-target=\"#toc\">\n    <div class=\"container template-reference-topic\">\n      <header>\n      <div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Released version\">3.3</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n        <li>\n  <a href=\"../index.html\">\n    <span class=\"fas fa-home fa-lg\"></span>\n     \n  </a>\n</li>\n<li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n     \n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n    <li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul>\n      <ul class=\"nav navbar-nav navbar-right\">\n        <li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\">\n    <span class=\"fab fa-github fa-lg\"></span>\n     \n  </a>\n</li>\n      </ul>\n      \n    </div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n      \n\n      </header>\n\n<div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Parallel Violin Plots of Value Distributions directly before/after NAs</h1>\n    <small class=\"dont-index\">Source: <a href='https://github.com/SteffenMoritz/imputeTS/blob/master/R/ggplot_na_level2.R'><code>R/ggplot_na_level2.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_level2.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize the distribution of values directly before/after NAs via violin plots.\nUseful to determine if missing values appear more often when a certain\nthreshold level is reached.</p>\n    </div>\n\n    <pre class=\"usage\"><span class='fu'>ggplot_na_level2</span><span class='op'>(</span>\n  <span class='va'>x</span>,\n  inside_information <span class='op'>=</span> <span class='st'>\"boxplot\"</span>,\n  color_before <span class='op'>=</span> <span class='st'>\"pink3\"</span>,\n  color_after <span class='op'>=</span> <span class='st'>\"pink3\"</span>,\n  color_source <span class='op'>=</span> <span class='st'>\"steelblue\"</span>,\n  color_inside <span class='op'>=</span> <span class='st'>\"black\"</span>,\n  alpha_violin <span class='op'>=</span> <span class='fl'>0.5</span>,\n  alpha_inside <span class='op'>=</span> <span class='fl'>0.9</span>,\n  title <span class='op'>=</span> <span class='st'>\"Before/After Analysis\"</span>,\n  subtitle <span class='op'>=</span> <span class='st'>\"Level of values occurring directly before and after NAs\"</span>,\n  xlab <span class='op'>=</span> <span class='st'>\"\"</span>,\n  ylab <span class='op'>=</span> <span class='st'>\"Value\"</span>,\n  legend <span class='op'>=</span> <span class='cn'>FALSE</span>,\n  orientation <span class='op'>=</span> <span class='st'>\"vertical\"</span>,\n  label_before <span class='op'>=</span> <span class='st'>\"before\"</span>,\n  label_after <span class='op'>=</span> <span class='st'>\"after\"</span>,\n  label_source <span class='op'>=</span> <span class='st'>\"source\"</span>,\n  add_n_label <span class='op'>=</span> <span class='cn'>T</span>,\n  theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a></span><span class='op'>(</span><span class='op'>)</span>\n<span class='op'>)</span></pre>\n\n    <h2 class=\"hasAnchor\" id=\"arguments\"><a class=\"anchor\" href=\"#arguments\"></a>Arguments</h2>\n    <table class=\"ref-arguments\">\n    <colgroup><col class=\"name\" /><col class=\"desc\" /></colgroup>\n    <tr>\n      <th>x</th>\n      <td><p>Numeric Vector (<code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code>) or Time Series\n(<code><a href='https://rdrr.io/r/stats/ts.html'>ts</a></code>) object containing NAs.\nThis is the only mandatory parameter - all other parameters are\nonly needed for adjusting the plot appearance.</p></td>\n    </tr>\n    <tr>\n      <th>inside_information</th>\n      <td><p>Defines what is inside the violin as an additional\ndistribution visualization. Accepts the following input:</p>\n<ul>\n<li><p>\"boxplot\" - Adds a boxplot inside the violins  (default choice)</p></li>\n<li><p>\"points\" - Adds jittered points inside the violins</p></li>\n<li><p>\"none\" - Adds nothing inside the violins</p></li>\n</ul><p>Beware, though using jitter option \"points\" can lead to overlays for larger time series.</p></td>\n    </tr>\n    <tr>\n      <th>color_before</th>\n      <td><p>Color to fill the violin representing observations\ndirectly before NA gaps.</p></td>\n    </tr>\n    <tr>\n      <th>color_after</th>\n      <td><p>Color to fill the violin representing\nobservations directly after NA gaps.</p></td>\n    </tr>\n    <tr>\n      <th>color_source</th>\n      <td><p>Color to fill the violin representing the\ndistribution of all non-NA values of a time series.</p></td>\n    </tr>\n    <tr>\n      <th>color_inside</th>\n      <td><p>Color used for the inside information\n(color of boxplot border or color of points).</p></td>\n    </tr>\n    <tr>\n      <th>alpha_violin</th>\n      <td><p>Alpha ((transparency) value used for the violin.</p></td>\n    </tr>\n    <tr>\n      <th>alpha_inside</th>\n      <td><p>Alpha (transparency) value used for the inside\ninformation in the violin (boxplot, points).</p></td>\n    </tr>\n    <tr>\n      <th>title</th>\n      <td><p>Title of the plot (NULL for deactivating title).</p></td>\n    </tr>\n    <tr>\n      <th>subtitle</th>\n      <td><p>Subtitle of the plot (NULL for deactivating subtitle).</p></td>\n    </tr>\n    <tr>\n      <th>xlab</th>\n      <td><p>Label for x-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>ylab</th>\n      <td><p>Label for y-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>legend</th>\n      <td><p>If TRUE a legend is added at the bottom.</p></td>\n    </tr>\n    <tr>\n      <th>orientation</th>\n      <td><p>Can be either 'vertical' or 'horizontal'. Defines\nif the violin plot is oriented vertically or horizontally.</p></td>\n    </tr>\n    <tr>\n      <th>label_before</th>\n      <td><p>Defines the label assigned to the\nviolin for values directly before NAs.</p></td>\n    </tr>\n    <tr>\n      <th>label_after</th>\n      <td><p>Defines the label assigned to the\nviolin for values directly after NAs.</p></td>\n    </tr>\n    <tr>\n      <th>label_source</th>\n      <td><p>Defines the label assigned to the violin\nfor the distribution of all values.</p></td>\n    </tr>\n    <tr>\n      <th>add_n_label</th>\n      <td><p>Whether to automatically additionally add a\nn-value (e.g. n = 100) to the labels as an indication\nhow many observations are represented by the violins.</p></td>\n    </tr>\n    <tr>\n      <th>theme</th>\n      <td><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a>)</code></p></td>\n    </tr>\n    </table>\n\n    <h2 class=\"hasAnchor\" id=\"details\"><a class=\"anchor\" href=\"#details\"></a>Details</h2>\n\n    <p>This function visualizes the distribution of missing\nvalues directly before/after NAs via violin plots. This is useful to\ndetermine if missing values appear more often when near to a\ncertain value level.</p>\n<p>As described in <a href='https://ggplot2.tidyverse.org/reference/geom_violin.html'>geom_violin</a>: 'A violin plot is a compact\ndisplay of a continuous distribution. A violin plot is a mirrored density\nplot displayed in the same way as a boxplot.'</p>\n<p>The visualization of the before/after NA distributions in comparison\nto the overall distribution can provide information about the root\ncause of the missing values. It also can provide indications, about\nthe missing data mechanism (MCAR,MAR, MNAR).</p>\n<p>The default plot consists of three violins/boplots combinations -\none for all values directly before NAs, one for all values directly\nafter NAs and one for the overall distribution of all non-NA values.</p>\n<p>By looking at these plots it can be seen whether the NAs appear\nrather randomly after some values in the overall distribution or\nif e.g. it can be said NAs more likely appear after high values.</p>\n<p>It could, for example be the case, that a sensor can't measure\nvalues above 100 degree and always outputs NA values once the\ntemperature reaches 100 degree. With these plots it could be realized,\nthat NAs in the next value always occur when the temperature is close\nto 100 degree.</p>\n<p>Some more technical implementation details:</p>\n<p>The middle violin with the distribution of all non-NA observations also\nincludes the values directly before/after the NAs.</p>\n<p>Only the values directly before and after the NA gap are used for\nthe before/after violins.</p>\n<p>For the example series 6, 2, NA, NA, NA, 3, 6 this would mean:</p><ul>\n<li><p>The 2 value goes into the before distribution</p></li>\n<li><p>The 3 value goes into the after distribution</p></li>\n<li><p>Both 6 are not in before or after, since only values directly\nbefore or after the gaps are considered</p></li>\n<li><p>No extra values added to before/after as representatives for the middle NAs</p></li>\n</ul><p>So the source/overall distribution for this series would be {6, 2, 3, 6}\nthe before {2} and after {6}.</p>\n<p>Of course the overall plot only makes sense with a longer time series\nwith more missing values.</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric, the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    <h2 class=\"hasAnchor\" id=\"see-also\"><a class=\"anchor\" href=\"#see-also\"></a>See also</h2>\n\n    <div class='dont-index'><p><code><a href='ggplot_na_distribution2.html'>ggplot_na_distribution2</a></code>,\n<code><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></code>,\n<code><a href='ggplot_na_distribution.html'>ggplot_na_distribution</a></code>,\n<code><a href='ggplot_na_imputations.html'>ggplot_na_imputations</a></code></p></div>\n    <h2 class=\"hasAnchor\" id=\"author\"><a class=\"anchor\" href=\"#author\"></a>Author</h2>\n\n    <p>Steffen Moritz</p>\n\n    <h2 class=\"hasAnchor\" id=\"examples\"><a class=\"anchor\" href=\"#examples\"></a>Examples</h2>\n    <pre class=\"examples\"><div class='input'><span class='co'># Example 1: Visualize the before/after NA distributions</span>\n<span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'>stats</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/r/stats/ts.html'>ts</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>11</span>, <span class='fl'>4</span><span class='op'>:</span><span class='fl'>9</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>11</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>7</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>15</span><span class='op'>:</span><span class='fl'>6</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>2</span><span class='op'>:</span><span class='fl'>5</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>7</span><span class='op'>)</span><span class='op'>)</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>x</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-1.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 2: Visualize the before/after NA distributions in tsNH4 time series</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsNH4</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-2.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 3: Same as example 1, just written with pipe operator</span>\n<span class='va'>x</span> <span class='op'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/ts.html'>ts</a></span><span class='op'>(</span><span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span><span class='op'>:</span><span class='fl'>11</span>, <span class='fl'>4</span><span class='op'>:</span><span class='fl'>9</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>11</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>7</span><span class='op'>:</span><span class='fl'>15</span>, <span class='fl'>15</span><span class='op'>:</span><span class='fl'>6</span>, <span class='cn'>NA</span>, <span class='cn'>NA</span>, <span class='fl'>2</span><span class='op'>:</span><span class='fl'>5</span>, <span class='fl'>3</span><span class='op'>:</span><span class='fl'>7</span><span class='op'>)</span><span class='op'>)</span>\n<span class='va'>x</span> <span class='op'>%&gt;%</span> <span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-3.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 4: Visualize the before/after NA in tsAirgap - different color for violins</span>\n<span class='co'># Plot adjustments via ggplot_na_level2 function parameters</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsAirgap</span>, color_after <span class='op'>=</span> <span class='st'>\"green\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-4.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 5: Visualize before/after NA in tsAirgap - different theme</span>\n<span class='co'># Plot adjustments via ggplot_na_level2 function parameters</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsAirgap</span>, theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_classic</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-5.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 6: Visualize before/after NA in tsNH4 - title, subtitle in center</span>\n<span class='co'># Plot adjustments via ggplot2 syntax</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsAirgap</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.subtitle <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-6.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 7: Visualize before/after NA in tsAirgap - title in center, no subtitle</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsAirgap</span>, subtitle <span class='op'>=</span> <span class='cn'>NULL</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-7.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 8: Visualize before/after NA in tsAirgap - y-axis texts with angle</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'>ggplot_na_level2</span><span class='op'>(</span><span class='va'>tsAirgap</span>, color_source <span class='op'>=</span> <span class='st'>\"grey\"</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>axis.text.y <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>angle <span class='op'>=</span> <span class='fl'>60</span>, hjust <span class='op'>=</span> <span class='fl'>1</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_level2-8.png' alt='' width='700' height='433' /></div></pre>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\">\n      <h2 data-toc-skip>Contents</h2>\n    </nav>\n  </div>\n</div>\n\n\n      <footer>\n      <div class=\"copyright\">\n  <p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p>Site built with <a href=\"https://pkgdown.r-lib.org/\">pkgdown</a> 1.6.1.</p>\n</div>\n\n      </footer>\n   </div>\n\n  \n\n\n  </body>\n</html>\n\n\n"
  },
  {
    "path": "docs/reference/ggplot_na_pattern.html",
    "content": "<!-- Generated by pkgdown: do not edit by hand -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n  <meta charset=\"utf-8\">\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n<title>Visualize Patterns in NA occurrences — ggplot_na_pattern • imputeTS</title>\n\n<!-- favicons -->\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"../favicon-16x16.png\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"../favicon-32x32.png\">\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"../apple-touch-icon.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"120x120\" href=\"../apple-touch-icon-120x120.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"76x76\" href=\"../apple-touch-icon-76x76.png\" />\n<link rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"60x60\" href=\"../apple-touch-icon-60x60.png\" />\n\n<!-- jquery -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js\" integrity=\"sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=\" crossorigin=\"anonymous\"></script>\n<!-- Bootstrap -->\n<link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\" />\n\n\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script>\n\n<!-- bootstrap-toc -->\n<link rel=\"stylesheet\" href=\"../bootstrap-toc.css\">\n<script src=\"../bootstrap-toc.js\"></script>\n\n<!-- Font Awesome icons -->\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\" />\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\" />\n\n<!-- clipboard.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script>\n\n<!-- headroom.js -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script>\n\n<!-- pkgdown -->\n<link href=\"../pkgdown.css\" rel=\"stylesheet\">\n<script src=\"../pkgdown.js\"></script>\n\n\n\n\n<meta property=\"og:title\" content=\"Visualize Patterns in NA occurrences — ggplot_na_pattern\" />\n<meta property=\"og:description\" content=\"Visualize Patterns in NA occurrences. E.g. weakly, ...,..\" />\n<meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\" />\n\n\n\n\n<!-- mathjax -->\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script>\n\n<!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]-->\n\n\n\n  </head>\n\n  <body data-spy=\"scroll\" data-target=\"#toc\">\n    <div class=\"container template-reference-topic\">\n      <header>\n      <div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Released version\">3.3</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\">\n        <li>\n  <a href=\"../index.html\">\n    <span class=\"fas fa-home fa-lg\"></span>\n     \n  </a>\n</li>\n<li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n     \n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\">\n    <li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul>\n</li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul>\n      <ul class=\"nav navbar-nav navbar-right\">\n        <li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\">\n    <span class=\"fab fa-github fa-lg\"></span>\n     \n  </a>\n</li>\n      </ul>\n      \n    </div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n      \n\n      </header>\n\n<div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Visualize Patterns in NA occurrences</h1>\n    <small class=\"dont-index\">Source: <a href='https://github.com/SteffenMoritz/imputeTS/blob/master/R/ggplot_na_pattern.R'><code>R/ggplot_na_pattern.R</code></a></small>\n    <div class=\"hidden name\"><code>ggplot_na_pattern.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Visualize Patterns in NA occurrences. E.g. weakly, ...,..</p>\n    </div>\n\n    <pre class=\"usage\"><span class='fu'>ggplot_na_pattern</span><span class='op'>(</span>\n  <span class='va'>x</span>,\n  limit <span class='op'>=</span> <span class='fl'>10</span>,\n  include_total <span class='op'>=</span> <span class='cn'>TRUE</span>,\n  ranked_by <span class='op'>=</span> <span class='st'>\"occurrence\"</span>,\n  color_occurrence <span class='op'>=</span> <span class='st'>\"indianred\"</span>,\n  color_total <span class='op'>=</span> <span class='st'>\"steelblue\"</span>,\n  title <span class='op'>=</span> <span class='st'>\"Occurrence of gap sizes\"</span>,\n  subtitle <span class='op'>=</span> <span class='st'>\"Gap sizes (NAs in a row) ordered by most common\"</span>,\n  xlab <span class='op'>=</span> <span class='cn'>NULL</span>,\n  ylab <span class='op'>=</span> <span class='st'>\"Number occurrence\"</span>,\n  legend <span class='op'>=</span> <span class='cn'>TRUE</span>,\n  orientation <span class='op'>=</span> <span class='st'>\"horizontal\"</span>,\n  label_occurrence <span class='op'>=</span> <span class='st'>\"Number occurrence gapsize\"</span>,\n  label_total <span class='op'>=</span> <span class='st'>\"Resulting NAs for gapsize\"</span>,\n  theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a></span><span class='op'>(</span><span class='op'>)</span>\n<span class='op'>)</span></pre>\n\n    <h2 class=\"hasAnchor\" id=\"arguments\"><a class=\"anchor\" href=\"#arguments\"></a>Arguments</h2>\n    <table class=\"ref-arguments\">\n    <colgroup><col class=\"name\" /><col class=\"desc\" /></colgroup>\n    <tr>\n      <th>x</th>\n      <td><p>Numeric Vector (<code><a href='https://rdrr.io/r/base/vector.html'>vector</a></code>) or Time Series\n(<code><a href='https://rdrr.io/r/stats/ts.html'>ts</a></code>) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.</p></td>\n    </tr>\n    <tr>\n      <th>limit</th>\n      <td><p>Specifies how many of the most common gap sizes are shown in\nthe plot.Default is 10. So only the 10 most often occurring gapsizes will\nbe shown. If more or all present gap sizes should be displayed, the limit needs\nto be increased. Since this might add a lot of additional data, having\nparameter  <code>orientation</code> set to 'horizontal' avoids overlaps in the axis\nlabels.</p></td>\n    </tr>\n    <tr>\n      <th>include_total</th>\n      <td><p>When set to TRUE the total NA count for a gapsize is\nincluded in the plot (total = number occurrence x gap size).\nE.g. if a gapsize of 3 occurs 10 times, this means this gap size makes\nup for 30 NAs in total. This can be a good indicator of the\noverall impact of a gapsize.</p></td>\n    </tr>\n    <tr>\n      <th>ranked_by</th>\n      <td><p>Should the results be sorted according to the number of\noccurrence or total resulting NAs for a gapsize. Total resulting NAs\nare calculated by (total = number occurrence x gap size).</p><ul>\n<li><p>\"occurrence\" - Sorting by 'number of occurrence' of a gap size</p></li>\n<li><p>\"total\" - Sorting by 'total resulting NAs' of a gap size</p></li>\n</ul>\n\n<p>The default setting is \"occurrence\".</p></td>\n    </tr>\n    <tr>\n      <th>color_occurrence</th>\n      <td><p>Defines the Color for the Bars of\n'number of occurrence'.</p></td>\n    </tr>\n    <tr>\n      <th>color_total</th>\n      <td><p>Defines the color for the bars of\n'total resulting NAs'.</p></td>\n    </tr>\n    <tr>\n      <th>title</th>\n      <td><p>Title of the Plot.</p></td>\n    </tr>\n    <tr>\n      <th>subtitle</th>\n      <td><p>Subtitle of the Plot.</p></td>\n    </tr>\n    <tr>\n      <th>xlab</th>\n      <td><p>Label for x-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>ylab</th>\n      <td><p>Label for y-Axis.</p></td>\n    </tr>\n    <tr>\n      <th>legend</th>\n      <td><p>If TRUE a legend is added at the bottom.</p></td>\n    </tr>\n    <tr>\n      <th>orientation</th>\n      <td><p>Can be either 'vertical' or 'horizontal'. Defines\nif the bars are plotted vertically or horizontally. For large amounts\nof different gap sizes horizontal illustration is favorable (also see\nparameter <code>limit</code>).</p></td>\n    </tr>\n    <tr>\n      <th>label_occurrence</th>\n      <td><p>Defines the label assigned to 'number of occurrence'\nin the legend.</p></td>\n    </tr>\n    <tr>\n      <th>label_total</th>\n      <td><p>Defines the label assigned to 'total resulting NAs'\nin the legend.</p></td>\n    </tr>\n    <tr>\n      <th>theme</th>\n      <td><p>Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(<code><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_linedraw</a>)</code></p></td>\n    </tr>\n    </table>\n\n    <h2 class=\"hasAnchor\" id=\"value\"><a class=\"anchor\" href=\"#value\"></a>Value</h2>\n\n    <p>The output is a <code><a href='https://ggplot2.tidyverse.org/reference/ggplot2-package.html'>ggplot2</a></code> object that can be\nfurther adjusted by using the ggplot syntax</p>\n    <h2 class=\"hasAnchor\" id=\"details\"><a class=\"anchor\" href=\"#details\"></a>Details</h2>\n\n    <p>This plotting function can be used to visualize the length of\nthe NA gaps (NAs in a row) in a time series. It shows a ranking of which\ngap sizes occur most often. This ranking can be ordered by the number\noccurrence of the gap sizes or by total resulting NAs for this gap size\n(occurrence * gap length). A NA-gap of 3 occuring 10 times means 30 total\nresulting NAs.</p>\n<p>A resulting plot can for example be described like this:\na 2 NA-gap (2 NAs in a row) occurred  27 times,\na 9 NA-gap (9 NAs in a row) occurred  11 times,\na 27 NA-gap (27 NAs in a row) occurred  1 times, ...</p>\n<p>The only really needed parameter for this function is x (the univariate\ntime series with NAs that shall be visualized). All other parameters\nare solely for altering the appearance of the plot.</p>\n<p>As long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.</p>\n<p>The plot can be adjusted to your needs via the function parameters.\nAdditionally for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.</p>\n    <h2 class=\"hasAnchor\" id=\"see-also\"><a class=\"anchor\" href=\"#see-also\"></a>See also</h2>\n\n    <div class='dont-index'><p><code><a href='ggplot_na_distribution.html'>ggplot_na_distribution</a></code>,\n<code><a href='ggplot_na_distribution2.html'>ggplot_na_distribution2</a></code>,\n<code><a href='ggplot_na_imputations.html'>ggplot_na_imputations</a></code></p></div>\n    <h2 class=\"hasAnchor\" id=\"author\"><a class=\"anchor\" href=\"#author\"></a>Author</h2>\n\n    <p>Steffen Moritz, Sebastian Gatscha</p>\n\n    <h2 class=\"hasAnchor\" id=\"examples\"><a class=\"anchor\" href=\"#examples\"></a>Examples</h2>\n    <pre class=\"examples\"><div class='input'><span class='co'># Example 1: Visualize the top gap sizes in tsNH4 (top 10 by default)</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-1.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 2: Visualize the top gap sizes in tsAirgap - horizontal bars</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsAirgap</span>, orientation <span class='op'>=</span> <span class='st'>\"vertical\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-2.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 3: Same as example 1, just written with pipe operator</span>\n<span class='va'>tsNH4</span> <span class='op'>%&gt;%</span> <span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-3.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 4: Visualize the top 20 gap sizes in tsNH4</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, limit <span class='op'>=</span> <span class='fl'>20</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-4.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 5: Visualize top gap sizes in tsNH4 without showing total NAs</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, limit <span class='op'>=</span> <span class='fl'>20</span>, include_total <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-5.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 6: Visualize top gap sizes in tsNH4 but ordered by total NAs</span>\n<span class='co'># (total = occurrence * gap length)</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, limit <span class='op'>=</span> <span class='fl'>20</span>, ranked_by <span class='op'>=</span> <span class='st'>\"total\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-6.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 7: Visualize top gap sizes in tsNH4 - different theme</span>\n<span class='co'># Plot adjustments via ggplot_na_gapsize function parameters</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, theme <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/ggtheme.html'>theme_classic</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-7.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 8: Visualize top gap sizes in tsNH4 - title, subtitle in center</span>\n<span class='co'># Plot adjustments via ggplot2 syntax</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.subtitle <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-8.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 9: Visualize top gap sizes in tsNH4 - title in center, no subtitle</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, subtitle <span class='op'>=</span> <span class='cn'>NULL</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>plot.title <span class='op'>=</span> <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/element.html'>element_text</a></span><span class='op'>(</span>hjust <span class='op'>=</span> <span class='fl'>0.5</span><span class='op'>)</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-9.png' alt='' width='700' height='433' /></div><div class='input'>\n<span class='co'># Example 10: Top gap sizes in tsNH4 - legend on the right and color change</span>\n<span class='co'># Plot adjustments via ggplot2 syntax and function parameters</span>\n<span class='fu'><a href='ggplot_na_gapsize.html'>ggplot_na_gapsize</a></span><span class='op'>(</span><span class='va'>tsNH4</span>, color_total <span class='op'>=</span> <span class='st'>\"grey\"</span><span class='op'>)</span> <span class='op'>+</span>\n  <span class='fu'>ggplot2</span><span class='fu'>::</span><span class='fu'><a href='https://ggplot2.tidyverse.org/reference/theme.html'>theme</a></span><span class='op'>(</span>legend.position <span class='op'>=</span> <span class='st'>\"right\"</span><span class='op'>)</span>\n</div><div class='img'><img src='ggplot_na_pattern-10.png' alt='' width='700' height='433' /></div></pre>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\">\n      <h2 data-toc-skip>Contents</h2>\n    </nav>\n  </div>\n</div>\n\n\n      <footer>\n      <div class=\"copyright\">\n  <p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p>Site built with <a href=\"https://pkgdown.r-lib.org/\">pkgdown</a> 1.6.1.</p>\n</div>\n\n      </footer>\n   </div>\n\n  \n\n\n  </body>\n</html>\n\n\n"
  },
  {
    "path": "docs/reference/imputeTS-package.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>imputeTS: Time Series Missing Value Imputation — imputeTS-package • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"imputeTS: Time Series Missing Value Imputation — imputeTS-package\"><meta property=\"og:description\" content=\"\nImputation (replacement) of missing values in univariate time series. Offers several imputation functions and missing data plots. Available imputation algorithms include: 'Mean', 'LOCF', 'Interpolation', 'Moving Average', 'Seasonal Decomposition', 'Kalman Smoothing on Structural Time Series models', 'Kalman Smoothing on ARIMA models'. Published in Moritz and Bartz-Beielstein (2017) doi:10.32614/RJ-2017-009\n.\nThe imputeTS package is a collection of algorithms and tools for univariate time series imputation.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>imputeTS: Time Series Missing Value Imputation</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/imputeTS-package.R\" class=\"external-link\"><code>R/imputeTS-package.R</code></a></small>\n    <div class=\"hidden name\"><code>imputeTS-package.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p></p>\n<p>Imputation (replacement) of missing values in univariate time series. Offers several imputation functions and missing data plots. Available imputation algorithms include: 'Mean', 'LOCF', 'Interpolation', 'Moving Average', 'Seasonal Decomposition', 'Kalman Smoothing on Structural Time Series models', 'Kalman Smoothing on ARIMA models'. Published in Moritz and Bartz-Beielstein (2017) <a href=\"https://doi.org/10.32614/RJ-2017-009\" class=\"external-link\">doi:10.32614/RJ-2017-009</a>\n.</p>\n<p>The imputeTS package is a collection of algorithms and tools for univariate time series imputation.</p>\n    </div>\n\n\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The imputeTS package specializes on (univariate) time series imputation.\nIt offers several different imputation algorithm implementations. Beyond the imputation algorithms\nthe package also provides plotting and printing functions of missing data statistics.</p>\n<p>The package is easy to use:</p><ul><li><p>To impute (fill all missing values) in a time series <code>x</code>, run:<br><code>na_interpolation(x)</code> <br></p></li>\n<li><p>To plot missing data statistics for a time series <code>x</code>, run:<br><code>ggplot_na_distribution(x)</code><br></p></li>\n<li><p>To print missing data statistics for a time series <code>x</code>, run:<br><code>statsNA(x)</code><br></p></li>\n</ul><p>Every other imputation function (starting with na_'algorithm name') and plotting\nfunction (starting with plotNA_'plot name') work the same way as in this example.</p>\n    </div>\n    <div id=\"references\">\n    <h2>References</h2>\n    <p>Moritz, Steffen, and Thomas Bartz-Beielstein. \"imputeTS: Time Series Missing Value Imputation in R.\" R Journal 9.1 (2017). doi:10.32614/RJ-2017-009.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p>Useful links:</p><ul><li><p><a href=\"https://github.com/SteffenMoritz/imputeTS\" class=\"external-link\">https://github.com/SteffenMoritz/imputeTS</a></p></li>\n<li><p><a href=\"https://steffenmoritz.github.io/imputeTS/\" class=\"external-link\">https://steffenmoritz.github.io/imputeTS/</a></p></li>\n<li><p>Report bugs at <a href=\"https://github.com/SteffenMoritz/imputeTS/issues\" class=\"external-link\">https://github.com/SteffenMoritz/imputeTS/issues</a></p></li>\n</ul></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p><strong>Maintainer</strong>: Steffen Moritz <a href=\"mailto:steffen.moritz10@gmail.com\">steffen.moritz10@gmail.com</a> (<a href=\"https://orcid.org/0000-0002-0085-1804\" class=\"external-link\">ORCID</a>) [copyright holder]</p>\n<p>Authors:</p><ul><li><p>Sebastian Gatscha <a href=\"mailto:sebastian_gatscha@gmx.at\">sebastian_gatscha@gmx.at</a></p></li>\n</ul><p>Other contributors:</p><ul><li><p>Earo Wang <a href=\"mailto:earo.wang@gmail.com\">earo.wang@gmail.com</a> (<a href=\"https://orcid.org/0000-0001-6448-5260\" class=\"external-link\">ORCID</a>) [contributor]</p></li>\n<li><p>Ron Hause <a href=\"mailto:ronaldhause@gmail.com\">ronaldhause@gmail.com</a> (<a href=\"https://orcid.org/0000-0002-5229-7366\" class=\"external-link\">ORCID</a>) [contributor]</p></li>\n</ul></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/imputeTS.html",
    "content": "<html>\n  <head>\n    <meta http-equiv=\"refresh\" content=\"0;URL=https://SteffenMoritz.github.io/imputeTS/reference/imputeTS-package.html\" />\n    <meta name=\"robots\" content=\"noindex\">\n    <link rel=\"canonical\" href=\"https://SteffenMoritz.github.io/imputeTS/reference/imputeTS-package.html\">\n  </head>\n</html>\n\n"
  },
  {
    "path": "docs/reference/index.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Package index • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Package index\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-index\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"contents col-md-9\">\n    <div class=\"page-header\">\n      <h1>Reference</h1>\n    </div>\n\n    <table class=\"ref-index\"><colgroup><col class=\"alias\"><col class=\"title\"></colgroup><tbody><tr><th colspan=\"2\">\n          <h2 id=\"all-functions\">All functions <a href=\"#all-functions\" class=\"anchor\" aria-hidden=\"true\"></a></h2>\n          <p class=\"section-desc\"></p>\n        </th>\n      </tr></tbody><tbody><tr><td>\n          <p><code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution()</a></code> </p>\n        </td>\n        <td><p>Line Plot to Visualize the Distribution of Missing Values</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2()</a></code> </p>\n        </td>\n        <td><p>Stacked Bar Plot to Visualize Missing Values per Time Interval</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize()</a></code> </p>\n        </td>\n        <td><p>Bar Plot to Visualize Occurrences of Different NA Gap Sizes</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"ggplot_na_gapsize2.html\">ggplot_na_gapsize2()</a></code> </p>\n        </td>\n        <td><p>Bubble Plot to Visualize Total NA Count of NA gap sizes</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations()</a></code> </p>\n        </td>\n        <td><p>Line Plot to Visualize Imputed Values</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_interpolation.html\">na_interpolation()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Interpolation</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_kalman.html\">na_kalman()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Kalman Smoothing and State Space Models</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_locf.html\">na_locf()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Last Observation Carried Forward</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_ma.html\">na_ma()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Weighted Moving Average</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_mean.html\">na_mean()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Mean Value</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_random.html\">na_random()</a></code> </p>\n        </td>\n        <td><p>Missing Value Imputation by Random Sample</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_remove.html\">na_remove()</a></code> </p>\n        </td>\n        <td><p>Remove Missing Values</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_replace.html\">na_replace()</a></code> </p>\n        </td>\n        <td><p>Replace Missing Values by a Defined Value</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_seadec.html\">na_seadec()</a></code> </p>\n        </td>\n        <td><p>Seasonally Decomposed Missing Value Imputation</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"na_seasplit.html\">na_seasplit()</a></code> </p>\n        </td>\n        <td><p>Seasonally Splitted Missing Value Imputation</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"statsNA.html\">statsNA()</a></code> </p>\n        </td>\n        <td><p>Print Statistics about Missing Values</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsAirgap.html\">tsAirgap</a></code> </p>\n        </td>\n        <td><p>Time series of monthly airline passengers (with NAs)</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsAirgapComplete.html\">tsAirgapComplete</a></code> </p>\n        </td>\n        <td><p>Time series of monthly airline passengers (complete)</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsHeating.html\">tsHeating</a></code> </p>\n        </td>\n        <td><p>Time series of a heating systems supply temperature (with NAs)</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsHeatingComplete.html\">tsHeatingComplete</a></code> </p>\n        </td>\n        <td><p>Time series of a heating systems supply temperature (complete)</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsNH4.html\">tsNH4</a></code> </p>\n        </td>\n        <td><p>Time series of NH4 concentration in a wastewater system (with NAs)</p></td>\n      </tr><tr><td>\n          <p><code><a href=\"tsNH4Complete.html\">tsNH4Complete</a></code> </p>\n        </td>\n        <td><p>Time series of NH4 concentration in a wastewater system (complete)</p></td>\n      </tr></tbody></table></div>\n\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.interpolation.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_interpolation instead. — na.interpolation • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_interpolation instead. — na.interpolation\"><meta property=\"og:description\" content=\"na.interpolation is replaced by na_interpolation.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_interpolation.html\">na_interpolation</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.interpolation.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.interpolation is replaced by <code><a href=\"na_interpolation.html\">na_interpolation</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"linear\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"linear\" - for linear interpolation using <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a>  (default choice)</p></li>\n<li><p>\"spline\" - for spline interpolation using <a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a></p></li>\n<li><p>\"stine\" - for Stineman interpolation using <a href=\"https://rdrr.io/pkg/stinepack/man/stinterp.html\" class=\"external-link\">stinterp</a></p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters to be passed through to <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a> or\n<a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a> interpolation functions</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.kalman.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_kalman instead. — na.kalman • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_kalman instead. — na.kalman\"><meta property=\"og:description\" content=\"na.kalman is replaced by na_kalman.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_kalman.html\">na_kalman</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.kalman.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.kalman is replaced by <code><a href=\"na_kalman.html\">na_kalman</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.kalman</span><span class=\"op\">(</span><span class=\"va\">x</span>, model <span class=\"op\">=</span> <span class=\"st\">\"StructTS\"</span>, smooth <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>, nit <span class=\"op\">=</span> <span class=\"op\">-</span><span class=\"fl\">1</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-model\">model<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-model\"></a></dt>\n<dd><p>Model to be used. With this parameter the State Space Model\n(on which KalmanSmooth is performed) can be chosen. Accepts the following input:</p>\n<ul><li><p>\"StructTS\" - For using a structural model fitted by maximum\nlikelihood (using <a href=\"https://rdrr.io/r/stats/StructTS.html\" class=\"external-link\">StructTS</a>)  (default choice)</p></li>\n<li><p>\"auto.arima\" - For using the state space representation of\narima model (using <a href=\"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html\" class=\"external-link\">auto.arima</a>)</p></li>\n</ul><p>For both auto.arima and StructTS additional parameters for model building can\nbe given with the ... parameter</p>\n<p>Additionally it is also possible to use a user created state space model\n(See code Example 5). This state space model could for example be\nobtained from another R package for structural time series modeling.\nFurthermore providing the state space representation of a arima model\nfrom <a href=\"https://rdrr.io/r/stats/arima.html\" class=\"external-link\">arima</a> is also possible. But it is important to note,\nthat user created state space models must meet the requirements specified\nunder <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>. This means the user supplied state space\nmodel has to be in form of a list with at least components T, Z, h , V, a, P, Pn.\n(more details under <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>)</p></dd>\n\n\n<dt id=\"arg-smooth\">smooth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-smooth\"></a></dt>\n<dd><p>if <code>TRUE</code> - <code><a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanSmooth</a></code> is used for\nestimation, if <code>FALSE</code> - <code><a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanRun</a></code> is used.\nSince KalmanRun is often considered extrapolation KalmanSmooth is usually\nthe better choice for imputation.</p></dd>\n\n\n<dt id=\"arg-nit\">nit<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-nit\"></a></dt>\n<dd><p>Parameter from Kalman Filtering (see <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>).\nUsually no need to change from default.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters to be passed through to the functions that\nbuild the State Space Models (<a href=\"https://rdrr.io/r/stats/StructTS.html\" class=\"external-link\">StructTS</a> or <a href=\"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html\" class=\"external-link\">auto.arima</a>).</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.locf.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_locf instead. — na.locf • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_locf instead. — na.locf\"><meta property=\"og:description\" content=\"na.locf is replaced by na_locf.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_locf.html\">na_locf</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.locf.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.locf is replaced by <code><a href=\"na_locf.html\">na_locf</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.locf</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"locf\"</span>, na.remaining <span class=\"op\">=</span> <span class=\"st\">\"rev\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"locf\" - for Last Observation Carried Forward (default choice)</p></li>\n<li><p>\"nocb\" - for Next Observation Carried Backward</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.ma.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_ma instead. — na.ma • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_ma instead. — na.ma\"><meta property=\"og:description\" content=\"na.ma is replaced by na_ma.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_ma.html\">na_ma</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.ma.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.ma is replaced by <code><a href=\"na_ma.html\">na_ma</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.ma</span><span class=\"op\">(</span><span class=\"va\">x</span>, k <span class=\"op\">=</span> <span class=\"fl\">4</span>, weighting <span class=\"op\">=</span> <span class=\"st\">\"exponential\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-k\">k<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-k\"></a></dt>\n<dd><p>integer width of the moving average window. Expands to both sides\nof the center element e.g. k=2 means 4 observations (2 left, 2 right) are\ntaken into account. If all observations in the current window are NA, the\nwindow size is automatically increased until there are at least 2 non-NA\nvalues present.</p></dd>\n\n\n<dt id=\"arg-weighting\">weighting<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-weighting\"></a></dt>\n<dd><p>Weighting to be used. Accepts the following input:</p><ul><li><p>\"simple\" - Simple Moving Average (SMA)</p></li>\n<li><p>\"linear\" - Linear Weighted Moving Average (LWMA)</p></li>\n<li><p>\"exponential\" - Exponential Weighted Moving Average (EWMA) (default choice)</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.mean.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_mean instead. — na.mean • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_mean instead. — na.mean\"><meta property=\"og:description\" content=\"na.mean is replaced by na_mean.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_mean.html\">na_mean</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.mean.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.mean is replaced by <code><a href=\"na_mean.html\">na_mean</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.mean</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"mean\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"mean\" - take the mean for imputation (default choice)</p></li>\n<li><p>\"median\" - take the median for imputation</p></li>\n<li><p>\"mode\" - take the mode for imputation</p></li>\n<li><p>\"harmonic\" - take the harmonic mean</p></li>\n<li><p>\"geometric\" - take the geometric mean</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.random.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_random instead. — na.random • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_random instead. — na.random\"><meta property=\"og:description\" content=\"na.random is replaced by na_random.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_random.html\">na_random</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.random.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.random is replaced by <code><a href=\"na_random.html\">na_random</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.random</span><span class=\"op\">(</span><span class=\"va\">x</span>, lower_bound <span class=\"op\">=</span> <span class=\"cn\">NULL</span>, upper_bound <span class=\"op\">=</span> <span class=\"cn\">NULL</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-lower-bound\">lower_bound<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-lower-bound\"></a></dt>\n<dd><p>Lower bound for the random samples.\nIf nothing or NULL is set min(x) will be used.</p></dd>\n\n\n<dt id=\"arg-upper-bound\">upper_bound<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-upper-bound\"></a></dt>\n<dd><p>Upper bound for the random samples.\nIf nothing or NULL is set man(x) will be used.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.remove.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_remove instead. — na.remove • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_remove instead. — na.remove\"><meta property=\"og:description\" content=\"na.remove is replaced by na_remove.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_remove.html\">na_remove</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.remove.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.remove is replaced by <code><a href=\"na_remove.html\">na_remove</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.remove</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.replace.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_replace instead. — na.replace • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_replace instead. — na.replace\"><meta property=\"og:description\" content=\"na.replace is replaced by na_replace.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_replace.html\">na_replace</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.replace.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.replace is replaced by <code><a href=\"na_replace.html\">na_replace</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.replace</span><span class=\"op\">(</span><span class=\"va\">x</span>, fill <span class=\"op\">=</span> <span class=\"fl\">0</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-fill\">fill<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-fill\"></a></dt>\n<dd><p>Value used to replace the missing values</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.seadec.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_seadec instead. — na.seadec • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_seadec instead. — na.seadec\"><meta property=\"og:description\" content=\"na.seadec is replaced by na_seadec.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_seadec.html\">na_seadec</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.seadec.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.seadec is replaced by <code><a href=\"na_seadec.html\">na_seadec</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.seadec</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span>,</span>\n<span>  find_frequency <span class=\"op\">=</span> <span class=\"cn\">FALSE</span>,</span>\n<span>  maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>,</span>\n<span>  <span class=\"va\">...</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-algorithm\">algorithm<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-algorithm\"></a></dt>\n<dd><p>Algorithm to be used after decomposition.\nAccepts the following input:</p><ul><li><p>\"interpolation\" - Imputation by Interpolation (default choice)</p></li>\n<li><p>\"locf\" - Imputation by Last Observation Carried Forward</p></li>\n<li><p>\"mean\" - Imputation by Mean Value</p></li>\n<li><p>\"random\" - Imputation by Random Sample</p></li>\n<li><p>\"kalman\" - Imputation by Kalman Smoothing and State Space Models</p></li>\n<li><p>\"ma\" - Imputation by Weighted Moving Average</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-find-frequency\">find_frequency<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-find-frequency\"></a></dt>\n<dd><p>If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters for these algorithms that can be passed\nthrough. Look at <code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_locf.html\">na_locf</a></code>, <code><a href=\"na_random.html\">na_random</a></code>,\n<code><a href=\"na_mean.html\">na_mean</a></code> for parameter options.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na.seasplit.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Deprecated use na_seasplit instead. — na.seasplit • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Deprecated use na_seasplit instead. — na.seasplit\"><meta property=\"og:description\" content=\"na.seasplit is replaced by na_seasplit.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Deprecated use <code><a href=\"na_seasplit.html\">na_seasplit</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>na.seasplit.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>na.seasplit is replaced by <code><a href=\"na_seasplit.html\">na_seasplit</a></code>.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na.seasplit</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span>,</span>\n<span>  find_frequency <span class=\"op\">=</span> <span class=\"cn\">FALSE</span>,</span>\n<span>  maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>,</span>\n<span>  <span class=\"va\">...</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-algorithm\">algorithm<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-algorithm\"></a></dt>\n<dd><p>Algorithm to be used after splits.\nAccepts the following input:</p><ul><li><p>\"interpolation\" - Imputation by Interpolation (default choice)</p></li>\n<li><p>\"locf\" - Imputation by Last Observation Carried Forward</p></li>\n<li><p>\"mean\" - Imputation by Mean Value</p></li>\n<li><p>\"random\" - Imputation by Random Sample</p></li>\n<li><p>\"kalman\" - Imputation by Kalman Smoothing and State Space Models</p></li>\n<li><p>\"ma\" - Imputation by Weighted Moving Average</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-find-frequency\">find_frequency<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-find-frequency\"></a></dt>\n<dd><p>If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters for these algorithms that can be\npassed through. Look at <code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_locf.html\">na_locf</a></code>, <code><a href=\"na_random.html\">na_random</a></code>,\n<code><a href=\"na_mean.html\">na_mean</a></code> for parameter options.</p></dd>\n\n</dl></div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_interpolation.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Interpolation — na_interpolation • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Interpolation — na_interpolation\"><meta property=\"og:description\" content=\"Uses either linear, spline or stineman interpolation\nto replace missing values.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Interpolation</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_interpolation.R\" class=\"external-link\"><code>R/na_interpolation.R</code></a></small>\n    <div class=\"hidden name\"><code>na_interpolation.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Uses either linear, spline or stineman interpolation\nto replace missing values.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"linear\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"linear\" - for linear interpolation using <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a>  (default choice)</p></li>\n<li><p>\"spline\" - for spline interpolation using <a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a></p></li>\n<li><p>\"stine\" - for Stineman interpolation using <a href=\"https://rdrr.io/pkg/stinepack/man/stinterp.html\" class=\"external-link\">stinterp</a></p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters to be passed through to <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a> or\n<a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a> interpolation functions</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>Missing values get replaced by values of <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a>, <a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a>\nor <a href=\"https://rdrr.io/pkg/stinepack/man/stinterp.html\" class=\"external-link\">stinterp</a> interpolation.</p>\n<p>The na_interpolation function also supports the use of additional parameters from the respective\nunderlying interpolation functions. While usually not really needed, it is useful to know that\nthis advanced use is in principle possible. These additional parameters are not specified explicitly\nin the na_interpolation function documentation. Take a look into the documentation of the <a href=\"https://rdrr.io/pkg/stinepack/man/stinterp.html\" class=\"external-link\">stinterp</a>, <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a> and <a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a> functions to get an overview about these additional parameters.</p>\n<p>An example for such a parameter is the 'method' argument of spline, which can be used to\nfurther specify the type of spline to be used. Possible values are \"fmm\", \"natural\",\n\"periodic\", \"monoH.FC\" and \"hyman\" (as can be seen in the <a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a>\ndocumentation). The respective function call using this additional parameter would\nlook like this:\n<code>na_interpolation(x, option =\"spline\", method =\"natural\")</code></p>\n<p>Like in this example other additional detail parameters (gained from <a href=\"https://rdrr.io/r/stats/approxfun.html\" class=\"external-link\">approx</a>,\n<a href=\"https://rdrr.io/r/stats/splinefun.html\" class=\"external-link\">spline</a>, <a href=\"https://rdrr.io/pkg/stinepack/man/stinterp.html\" class=\"external-link\">stinterp</a> documentation) can be used by just including\nthem in the na_interpolation function call. As already mentioned, these advanced possibilities\nfor settings parameters are only helpful for specific use cases. For regular use\nthe standard parameters provided directly in the na_interpolation documentation should be\nmore than enough.</p>\n    </div>\n    <div id=\"references\">\n    <h2>References</h2>\n    <p>Johannesson, Tomas, et al. (2015). \"Package stinepack\".</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz, Ron Hause</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Prerequisite: Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">2</span>, <span class=\"fl\">3</span>, <span class=\"fl\">4</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform linear interpolation</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.0 3.0 4.0 5.0 6.0 6.5 7.0 8.0</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform spline interpolation</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"spline\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.00000 3.00000 4.00000 5.00000 6.00000 6.53923 7.00000 8.00000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Perform stine interpolation</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"stine\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.0 3.0 4.0 5.0 6.0 6.5 7.0 8.0</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Perform linear interpolation, with additional parameter pass through from spline()</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Take a look at the 'Details' section of the na_interpolation documentation </span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># for more information about advanced parameter pass through options</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span><span class=\"st\">\"spline\"</span>, method <span class=\"op\">=</span><span class=\"st\">\"natural\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.00000 3.00000 4.00000 5.00000 6.00000 6.50661 7.00000 8.00000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_interpolation</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.0 3.0 4.0 5.0 6.0 6.5 7.0 8.0</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Same as example 2, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_interpolation</span><span class=\"op\">(</span>option <span class=\"op\">=</span> <span class=\"st\">\"spline\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.00000 3.00000 4.00000 5.00000 6.00000 6.53923 7.00000 8.00000</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_kalman.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Kalman Smoothing and State Space Models — na_kalman • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Kalman Smoothing and State Space Models — na_kalman\"><meta property=\"og:description\" content=\"Uses Kalman Smoothing on structural time series models\n(or on the state space representation of an arima model) for imputation.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Kalman Smoothing and State Space Models</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_kalman.R\" class=\"external-link\"><code>R/na_kalman.R</code></a></small>\n    <div class=\"hidden name\"><code>na_kalman.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Uses Kalman Smoothing on structural time series models\n(or on the state space representation of an arima model) for imputation.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">x</span>, model <span class=\"op\">=</span> <span class=\"st\">\"StructTS\"</span>, smooth <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>, nit <span class=\"op\">=</span> <span class=\"op\">-</span><span class=\"fl\">1</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-model\">model<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-model\"></a></dt>\n<dd><p>Model to be used. With this parameter the State Space Model\n(on which KalmanSmooth is performed) can be chosen. Accepts the following input:</p>\n<ul><li><p>\"StructTS\" - For using a structural model fitted by maximum\nlikelihood (using <a href=\"https://rdrr.io/r/stats/StructTS.html\" class=\"external-link\">StructTS</a>)  (default choice)</p></li>\n<li><p>\"auto.arima\" - For using the state space representation of\narima model (using <a href=\"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html\" class=\"external-link\">auto.arima</a>)</p></li>\n</ul><p>For both auto.arima and StructTS additional parameters for model building can\nbe given with the ... parameter</p>\n<p>Additionally it is also possible to use a user created state space model\n(See code Example 5). This state space model could for example be\nobtained from another R package for structural time series modeling.\nFurthermore providing the state space representation of a arima model\nfrom <a href=\"https://rdrr.io/r/stats/arima.html\" class=\"external-link\">arima</a> is also possible. But it is important to note,\nthat user created state space models must meet the requirements specified\nunder <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>. This means the user supplied state space\nmodel has to be in form of a list with at least components T, Z, h , V, a, P, Pn.\n(more details under <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>)</p></dd>\n\n\n<dt id=\"arg-smooth\">smooth<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-smooth\"></a></dt>\n<dd><p>if <code>TRUE</code> - <code><a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanSmooth</a></code> is used for\nestimation, if <code>FALSE</code> - <code><a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanRun</a></code> is used.\nSince KalmanRun is often considered extrapolation KalmanSmooth is usually\nthe better choice for imputation.</p></dd>\n\n\n<dt id=\"arg-nit\">nit<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-nit\"></a></dt>\n<dd><p>Parameter from Kalman Filtering (see <a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanLike</a>).\nUsually no need to change from default.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters to be passed through to the functions that\nbuild the State Space Models (<a href=\"https://rdrr.io/r/stats/StructTS.html\" class=\"external-link\">StructTS</a> or <a href=\"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html\" class=\"external-link\">auto.arima</a>).</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The KalmanSmoother used in this function is <code><a href=\"https://rdrr.io/r/stats/KalmanLike.html\" class=\"external-link\">KalmanSmooth</a></code>.\nIt operates either on a <code>Basic Structural Model</code> obtained by\n<code><a href=\"https://rdrr.io/r/stats/StructTS.html\" class=\"external-link\">StructTS</a></code> or the state space representation of a ARMA model\nobtained by <code><a href=\"https://pkg.robjhyndman.com/forecast/reference/auto.arima.html\" class=\"external-link\">auto.arima</a></code>.</p>\n<p>For an detailed explanation of Kalman Filtering and Space Space Models the\nfollowing literature is a good starting point:</p><ul><li><p><cite>G. Welch, G. Bishop, An Introduction to the Kalman Filter. SIGGRAPH 2001 Course 8, 1995</cite></p></li>\n<li><p><cite>Harvey, Andrew C. Forecasting, structural time series models and the Kalman filter. Cambridge university press, 1990</cite></p></li>\n<li><p><cite>Grewal, Mohinder S. Kalman filtering. Springer Berlin Heidelberg, 2011</cite></p></li>\n</ul></div>\n    <div id=\"references\">\n    <h2>References</h2>\n    <p>Hyndman RJ and Khandakar Y (2008). \"Automatic time series forecasting: the forecast package for R\". Journal of Statistical Software, 26(3).</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform imputation with KalmanSmoother and state space representation of arima model</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 123.5734 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 260.8078 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 312.6060 311.6160 311.0830 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 414.6160 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 382.6912 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 452.5683 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 132.7833 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 157.1427 133.0000 130.8971 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 298.6147 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 390.9089</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform imputation with KalmanRun and state space representation of arima model</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, smooth <span class=\"op\">=</span> <span class=\"cn\">FALSE</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 123.9264 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 232.6461 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 304.4782 302.5073 298.1029 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 385.8343 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 392.3223 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 442.0008 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 141.5691 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 139.5378 133.0000 141.7595 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 327.9040 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 400.7839</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Perform imputation with KalmanSmooth and StructTS model</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, model <span class=\"op\">=</span> <span class=\"st\">\"StructTS\"</span>, smooth <span class=\"op\">=</span> <span class=\"cn\">TRUE</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 123.5734 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 260.8078 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 312.6060 311.6160 311.0830 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 414.6160 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 382.6912 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 452.5683 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 132.7833 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 157.1427 133.0000 130.8971 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 298.6147 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 390.9089</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Perform imputation with KalmanSmooth and StructTS model with additional parameters</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, model <span class=\"op\">=</span> <span class=\"st\">\"StructTS\"</span>, smooth <span class=\"op\">=</span> <span class=\"cn\">TRUE</span>, type <span class=\"op\">=</span> <span class=\"st\">\"trend\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>         Jan    Feb    Mar    Apr    May    Jun    Jul    Aug    Sep    Oct</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.00 118.00 132.00 129.00 132.00 135.00 148.00 148.00 133.50 119.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.00 126.00 141.00 135.00 125.00 149.00 170.00 170.00 151.50 133.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.00 150.00 178.00 163.00 172.00 178.00 199.00 199.00 184.00 162.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.00 180.00 193.00 181.00 183.00 218.00 230.00 242.00 209.00 191.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.00 196.00 236.00 235.00 229.00 243.00 264.00 272.00 237.00 211.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.00 188.00 235.00 227.00 234.00 268.00 302.00 293.00 259.00 229.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.00 233.00 267.00 269.00 270.00 315.00 364.00 347.00 312.00 274.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.00 277.00 301.25 325.50 349.75 374.00 413.00 405.00 355.00 306.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.00 301.00 356.00 348.00 355.00 410.00 465.00 467.00 404.00 347.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.00 318.00 333.00 348.00 363.00 435.00 491.00 505.00 404.00 359.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.00 342.00 406.00 396.00 420.00 472.00 548.00 559.00 463.00 407.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.00 391.00 419.00 461.00 498.00 535.00 622.00 606.00 508.00 461.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>         Nov    Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 104.00 118.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 136.50 140.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 146.00 166.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 172.00 194.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 180.00 201.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 203.00 229.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 237.00 278.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 271.00 306.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 341.50 336.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 310.00 337.00</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 362.00 389.50</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 390.00 432.00</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 5:  Perform imputation with KalmanSmooth and user created model</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">usermodel</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/arima.html\" class=\"external-link\">arima</a></span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, order <span class=\"op\">=</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">1</span>, <span class=\"fl\">0</span>, <span class=\"fl\">1</span><span class=\"op\">)</span><span class=\"op\">)</span><span class=\"op\">$</span><span class=\"va\">model</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, model <span class=\"op\">=</span> <span class=\"va\">usermodel</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 128.9291 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 270.8450 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 292.8668 316.5817 341.4769 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 409.7449 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 329.7566 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 487.7672 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 136.5832 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 150.9669 133.0000 132.7634 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 332.3090 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 388.2858</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 6: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsAirgap</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_kalman</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 123.5734 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 260.8078 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 312.6060 311.6160 311.0830 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 414.6160 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 382.6912 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 452.5683 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 132.7833 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 157.1427 133.0000 130.8971 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 298.6147 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 390.9089</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_locf.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Last Observation Carried Forward — na_locf • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Last Observation Carried Forward — na_locf\"><meta property=\"og:description\" content=\"Replaces each missing value with the most recent present value\nprior to it (Last Observation Carried Forward- LOCF). Optionally this can\nalso be done starting from the back of the series (Next Observation Carried\nBackward - NOCB).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Last Observation Carried Forward</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_locf.R\" class=\"external-link\"><code>R/na_locf.R</code></a></small>\n    <div class=\"hidden name\"><code>na_locf.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Replaces each missing value with the most recent present value\nprior to it (Last Observation Carried Forward- LOCF). Optionally this can\nalso be done starting from the back of the series (Next Observation Carried\nBackward - NOCB).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_locf</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"locf\"</span>, na_remaining <span class=\"op\">=</span> <span class=\"st\">\"rev\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"locf\" - for Last Observation Carried Forward (default choice)</p></li>\n<li><p>\"nocb\" - for Next Observation Carried Backward</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-na-remaining\">na_remaining<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-na-remaining\"></a></dt>\n<dd><p>Method to be used for remaining NAs.</p><ul><li><p>\"rev\" - to perform nocb / locf from the reverse direction (default choice)</p></li>\n<li><p>\"keep\" - to return the series with NAs</p></li>\n<li><p>\"rm\" - to remove remaining NAs</p></li>\n<li><p>\"mean\" - to replace remaining NAs by overall mean</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n\n<div class=\"section\">\n<h3 id=\"general-functionality\">General Functionality<a class=\"anchor\" aria-label=\"anchor\" href=\"#general-functionality\"></a></h3>\n\n\n<p>Replaces each missing value with the most recent present value\nprior to it (Last Observation Carried Forward - LOCF). This can also be\ndone in reverse direction, starting from the end of the series (then\ncalled Next Observation Carried Backward - NOCB).</p>\n</div>\n\n<div class=\"section\">\n<h3 id=\"handling-for-nas-at-the-beginning-of-the-series\">Handling for NAs at the beginning of the series<a class=\"anchor\" aria-label=\"anchor\" href=\"#handling-for-nas-at-the-beginning-of-the-series\"></a></h3>\n\n\n<p>In case one or more successive observations directly at the start of the\ntime series are NA, there exists no 'last value' yet, that can be carried\nforward. Thus, no LOCF imputation can be performed for these NAs. As soon\nas the first non-NA value appears, LOCF can be performed as expected. The\nsame applies to NOCB, but from the opposite direction.</p>\n<p>While this problem might appear seldom and will only affect a very small\namount of values at the beginning, it is something to consider.\nThe <code>na_remaining</code> parameter helps to define, what should happen\nwith these values at the start, that would remain NA after pure LOCF.</p>\n<p>Default setting is <code>na_remaining = \"rev\"</code>, which performs\nnocb / locf from the other direction to fill these NAs. So a NA\nat the beginning will be filled with the next non-NA value appearing\nin the series.</p>\n<p>With <code>na_remaining = \"keep\"</code> NAs at the beginning (that can not\nbe imputed with pure LOCF) are just left as remaining NAs.</p>\n<p>With <code>na_remaining = \"rm\"</code> NAs at the beginning of the series are\ncompletely removed. Thus, the time series is basically shortened.</p>\n<p>Also available is <code>na_remaining = \"mean\"</code>, which uses the overall\nmean of the time series to replace these remaining NAs. (but beware,\nmean is usually not a good imputation choice - even if it  only affects\nthe values at the beginning)</p>\n</div>\n\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Prerequisite: Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"cn\">NA</span>, <span class=\"fl\">3</span>, <span class=\"fl\">4</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform LOCF</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_locf</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 3 3 4 5 6 6 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform NOCF</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_locf</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"nocb\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 3 3 4 5 6 7 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Perform LOCF and remove remaining NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_locf</span><span class=\"op\">(</span><span class=\"va\">x</span>, na_remaining <span class=\"op\">=</span> <span class=\"st\">\"rm\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 3 4 5 6 6 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_locf</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 3 3 4 5 6 6 7 8</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_ma.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Weighted Moving Average — na_ma • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Weighted Moving Average — na_ma\"><meta property=\"og:description\" content=\"Missing value replacement by weighted moving average.\nUses semi-adaptive window size to ensure all NAs are replaced.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Weighted Moving Average</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_ma.R\" class=\"external-link\"><code>R/na_ma.R</code></a></small>\n    <div class=\"hidden name\"><code>na_ma.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Missing value replacement by weighted moving average.\nUses semi-adaptive window size to ensure all NAs are replaced.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_ma</span><span class=\"op\">(</span><span class=\"va\">x</span>, k <span class=\"op\">=</span> <span class=\"fl\">4</span>, weighting <span class=\"op\">=</span> <span class=\"st\">\"exponential\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-k\">k<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-k\"></a></dt>\n<dd><p>integer width of the moving average window. Expands to both sides\nof the center element e.g. k=2 means 4 observations (2 left, 2 right) are\ntaken into account. If all observations in the current window are NA, the\nwindow size is automatically increased until there are at least 2 non-NA\nvalues present.</p></dd>\n\n\n<dt id=\"arg-weighting\">weighting<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-weighting\"></a></dt>\n<dd><p>Weighting to be used. Accepts the following input:</p><ul><li><p>\"simple\" - Simple Moving Average (SMA)</p></li>\n<li><p>\"linear\" - Linear Weighted Moving Average (LWMA)</p></li>\n<li><p>\"exponential\" - Exponential Weighted Moving Average (EWMA) (default choice)</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>In this function missing values get replaced by moving average\nvalues. Moving Averages are also sometimes referred to as \"moving mean\",\n\"rolling mean\", \"rolling average\" or \"running average\".</p>\n<p>The mean in this implementation taken from an equal number of observations\non either side of a central value. This means for an NA value at position\n<code>i</code> of a time series, the observations i-1,i+1 and i+1, i+2 (assuming\na window size of k=2) are used to calculate the mean.</p>\n<p>Since it can in case of long NA gaps also occur, that all values next to the\ncentral value are also NA, the algorithm has a semi-adaptive window size.\nWhenever there are less than 2 non-NA values in the complete window available,\nthe window size is incrementally increased, till at least 2 non-NA values are\nthere. In all other cases the algorithm sticks to the pre-set window size.</p>\n<p>There are options for using Simple Moving Average (SMA), Linear Weighted\nMoving Average (LWMA) and Exponential Weighted Moving Average (EWMA).</p>\n<p>SMA: all observations in the window are equally weighted for calculating the mean.</p>\n<p>LWMA: weights decrease in arithmetical progression. The observations\ndirectly next to a central value i, have weight 1/2, the observations\none further away (i-2,i+2) have weight 1/3, the next (i-3,i+3) have\nweight 1/4, ...</p>\n<p>EWMA: uses weighting factors which decrease exponentially. The observations\ndirectly next to a central value i, have weight 1/2^1, the observations one\nfurther away (i-2,i+2) have weight 1/2^2, the next (i-3,i+3) have weight 1/2^3, ...</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform imputation with simple moving average</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_ma</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, weighting <span class=\"op\">=</span> <span class=\"st\">\"simple\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 131.7143 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 245.8750 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 310.5000 338.5000 351.3333 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 380.3750 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 375.8571 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 494.8750 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 126.7143 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 147.4286 133.0000 155.1429 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 382.4286 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 434.8750</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform imputation with exponential weighted moving average</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_ma</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 133.6552 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 259.1000 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 294.7778 334.3571 369.2778 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 399.6000 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 350.7931 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 501.7000 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 129.8276 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 152.0000 133.0000 144.3077 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 361.2069 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 406.9333</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Perform imputation with exponential weighted moving average, window size 6</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_ma</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, k <span class=\"op\">=</span> <span class=\"fl\">6</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 133.1597 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 256.6349 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 298.0641 330.4516 362.3590 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 396.9677 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 354.1311 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 499.0161 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 129.8607 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 151.7909 133.0000 144.8091 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 360.9500 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 410.7661</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 4: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsAirgap</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_ma</span><span class=\"op\">(</span>weighting <span class=\"op\">=</span> <span class=\"st\">\"simple\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 131.7143 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 245.8750 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 310.5000 338.5000 351.3333 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 380.3750 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 375.8571 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 494.8750 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 126.7143 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 147.4286 133.0000 155.1429 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 382.4286 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 434.8750</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_mean.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Mean Value — na_mean • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Mean Value — na_mean\"><meta property=\"og:description\" content=\"Missing value replacement by mean values. Different means\nlike median, mean, mode possible.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Mean Value</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_mean.R\" class=\"external-link\"><code>R/na_mean.R</code></a></small>\n    <div class=\"hidden name\"><code>na_mean.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Missing value replacement by mean values. Different means\nlike median, mean, mode possible.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_mean</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"mean\"</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-option\">option<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-option\"></a></dt>\n<dd><p>Algorithm to be used. Accepts the following input:</p><ul><li><p>\"mean\" - take the mean for imputation (default choice)</p></li>\n<li><p>\"median\" - take the median for imputation</p></li>\n<li><p>\"mode\" - take the mode for imputation</p></li>\n<li><p>\"harmonic\" - take the harmonic mean</p></li>\n<li><p>\"geometric\" - take the geometric mean</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>Missing values get replaced by overall mean values. The function\ncalculates the mean, median, mode, harmonic or geometric mean over all the non-NA\nvalues and replaces all NAs with this value. Option 'mode' replaces NAs with\nthe most frequent value in the time series. If two or more values occur equally frequent,\nthe function imputes the lower value. Due to their calculation formula geometric and harmonic\nmean are not well defined for negative values or zero values in the input series.</p>\n<p>In general using the mean for imputation imputation is mostly a suboptimal choice and should\nbe handled with great caution.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Prerequisite: Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">2</span>, <span class=\"fl\">3</span>, <span class=\"fl\">4</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform imputation with the overall mean</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_mean</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 4 5 6 5 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform imputation with overall median</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_mean</span><span class=\"op\">(</span><span class=\"va\">x</span>, option <span class=\"op\">=</span> <span class=\"st\">\"median\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 4 5 6 5 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_mean</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 4 5 6 5 7 8</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_random.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Missing Value Imputation by Random Sample — na_random • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Missing Value Imputation by Random Sample — na_random\"><meta property=\"og:description\" content=\"Replaces each missing value by drawing a random sample\nbetween two given bounds.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Missing Value Imputation by Random Sample</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_random.R\" class=\"external-link\"><code>R/na_random.R</code></a></small>\n    <div class=\"hidden name\"><code>na_random.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Replaces each missing value by drawing a random sample\nbetween two given bounds.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_random</span><span class=\"op\">(</span><span class=\"va\">x</span>, lower_bound <span class=\"op\">=</span> <span class=\"cn\">NULL</span>, upper_bound <span class=\"op\">=</span> <span class=\"cn\">NULL</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-lower-bound\">lower_bound<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-lower-bound\"></a></dt>\n<dd><p>Lower bound for the random samples.\nIf nothing or NULL is set min(x) will be used.</p></dd>\n\n\n<dt id=\"arg-upper-bound\">upper_bound<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-upper-bound\"></a></dt>\n<dd><p>Upper bound for the random samples.\nIf nothing or NULL is set man(x) will be used.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>Replaces each missing value by drawing a random sample between two\ngiven bounds. The default bounds are the minimum and the maximum value in\nthe non-NAs from the time series. Function uses <a href=\"https://rdrr.io/r/stats/Uniform.html\" class=\"external-link\">runif</a> function to get\nthe random values.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Prerequisite: Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">2</span>, <span class=\"fl\">3</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Replace all NAs by random values that are between min and max of the input time series</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_random</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.000000 3.000000 4.423466 5.000000 6.000000 3.310586 7.000000 8.000000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Replace all NAs by random values between 1 and 10</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_random</span><span class=\"op\">(</span><span class=\"va\">x</span>, lower_bound <span class=\"op\">=</span> <span class=\"fl\">1</span>, upper_bound <span class=\"op\">=</span> <span class=\"fl\">10</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.000000 3.000000 4.765253 5.000000 6.000000 7.019837 7.000000 8.000000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_random</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.000000 3.000000 5.045902 5.000000 6.000000 5.962156 7.000000 8.000000</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_remove.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Remove Missing Values — na_remove • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Remove Missing Values — na_remove\"><meta property=\"og:description\" content=\"Removes all missing values from a time series.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Remove Missing Values</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_remove.R\" class=\"external-link\"><code>R/na_remove.R</code></a></small>\n    <div class=\"hidden name\"><code>na_remove.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Removes all missing values from a time series.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_remove</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>Removes all missing values from a input time series. This shortens\nthe time series by the number of missing values in the series. Should be\nhandled with care, because this can affect the seasonality of the time\nseries. Seasonal patterns might be destroyed. Independent from the input,\nthis function only returns a vector. (the time information of a resulting\ntime series object wouldn't be correct any more).</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Remove all NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">2</span>, <span class=\"fl\">3</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Remove all NAs</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_remove</span><span class=\"op\">(</span><span class=\"va\">x</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 5 6 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Remove all NAs in tsAirgap</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_remove</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>   [1] 112 118 132 129 135 148 148 119 104 118 115 126 141 135 125 149 170 170</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [19] 133 140 145 150 178 163 172 178 199 199 184 162 146 166 171 180 193 181</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [37] 183 218 230 242 209 191 172 194 196 196 236 235 229 243 264 272 237 211</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [55] 180 201 204 188 235 227 234 302 293 259 229 203 229 242 233 267 269 270</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [73] 315 364 347 312 274 237 278 284 277 374 413 405 355 306 271 306 315 301</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [91] 356 348 355 465 467 404 347 336 340 318 348 363 435 491 505 404 359 310</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [109] 337 360 342 406 396 420 472 548 559 463 407 362 417 391 419 461 535 622</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [127] 606 508 461 390 432</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_remove</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 5 6 7 8</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_replace.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Replace Missing Values by a Defined Value — na_replace • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Replace Missing Values by a Defined Value — na_replace\"><meta property=\"og:description\" content=\"Replaces all missing values with a given value.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Replace Missing Values by a Defined Value</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_replace.R\" class=\"external-link\"><code>R/na_replace.R</code></a></small>\n    <div class=\"hidden name\"><code>na_replace.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Replaces all missing values with a given value.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_replace</span><span class=\"op\">(</span><span class=\"va\">x</span>, fill <span class=\"op\">=</span> <span class=\"fl\">0</span>, maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-fill\">fill<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-fill\"></a></dt>\n<dd><p>Value used to replace the missing values</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code>, <code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Prerequisite: Create Time series with missing values</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\">&lt;-</span> <span class=\"fu\"><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></span><span class=\"op\">(</span><span class=\"fu\"><a href=\"https://rdrr.io/r/base/c.html\" class=\"external-link\">c</a></span><span class=\"op\">(</span><span class=\"fl\">2</span>, <span class=\"fl\">3</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">5</span>, <span class=\"fl\">6</span>, <span class=\"cn\">NA</span>, <span class=\"fl\">7</span>, <span class=\"fl\">8</span><span class=\"op\">)</span><span class=\"op\">)</span></span></span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 1: Replace all NAs with 3.5</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_replace</span><span class=\"op\">(</span><span class=\"va\">x</span>, fill <span class=\"op\">=</span> <span class=\"fl\">3.5</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.0 3.0 3.5 5.0 6.0 3.5 7.0 8.0</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Replace all NAs with 0</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_replace</span><span class=\"op\">(</span><span class=\"va\">x</span>, fill <span class=\"op\">=</span> <span class=\"fl\">0</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2 3 0 5 6 0 7 8</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">x</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_replace</span><span class=\"op\">(</span>fill <span class=\"op\">=</span> <span class=\"fl\">3.5</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Time Series:</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Start = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> End = 8 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> Frequency = 1 </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 2.0 3.0 3.5 5.0 6.0 3.5 7.0 8.0</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_seadec.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Seasonally Decomposed Missing Value Imputation — na_seadec • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Seasonally Decomposed Missing Value Imputation — na_seadec\"><meta property=\"og:description\" content=\"Removes the seasonal component from the time series,\nperforms imputation on the deseasonalized series and afterwards adds\nthe seasonal component again.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Seasonally Decomposed Missing Value Imputation</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_seadec.R\" class=\"external-link\"><code>R/na_seadec.R</code></a></small>\n    <div class=\"hidden name\"><code>na_seadec.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Removes the seasonal component from the time series,\nperforms imputation on the deseasonalized series and afterwards adds\nthe seasonal component again.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_seadec</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span>,</span>\n<span>  find_frequency <span class=\"op\">=</span> <span class=\"cn\">FALSE</span>,</span>\n<span>  maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>,</span>\n<span>  <span class=\"va\">...</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-algorithm\">algorithm<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-algorithm\"></a></dt>\n<dd><p>Algorithm to be used after decomposition.\nAccepts the following input:</p><ul><li><p>\"interpolation\" - Imputation by Interpolation (default choice)</p></li>\n<li><p>\"locf\" - Imputation by Last Observation Carried Forward</p></li>\n<li><p>\"mean\" - Imputation by Mean Value</p></li>\n<li><p>\"random\" - Imputation by Random Sample</p></li>\n<li><p>\"kalman\" - Imputation by Kalman Smoothing and State Space Models</p></li>\n<li><p>\"ma\" - Imputation by Weighted Moving Average</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-find-frequency\">find_frequency<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-find-frequency\"></a></dt>\n<dd><p>If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters for these algorithms that can be passed\nthrough. Look at <code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_locf.html\">na_locf</a></code>, <code><a href=\"na_random.html\">na_random</a></code>,\n<code><a href=\"na_mean.html\">na_mean</a></code> for parameter options.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The algorithm first performs a Seasonal Decomposition of Time Series by Loess\nvia <code><a href=\"https://rdrr.io/r/stats/stl.html\" class=\"external-link\">stl</a></code>. Decomposing the time series into seasonal, trend and irregular\ncomponents. The seasonal component gets then removed (subtracted) from the original series.\nAs a second step the selected imputation algorithm e.g. na_locf, na_ma, ...  is applied\non the deseasonalized series. Thus, the algorithm can work without being affected by seasonal\npatterns. After filling the NA gaps, the seasonal component is added to the deseasonalized\nseries again.</p>\n<p>Implementation details:\nA paper about the STL Decomposition procedure is linked in the references.\nSince the function only works with complete data, the initial NA data is temporarily filled\nvia linear interpolation in order to perform the decomposition. These temporarily imputed\nvalues are replaced with NAs again after obtaining the decomposition for the non-NA\nobservations. STL decomposition is run with robust = TRUE and s.window = 11. Additionally,\napplying STL decomposition needs a preset frequency. This can be passed by the frequency\nset in the input ts object or by setting 'find_frequency=TRUE' in order to find\nan appropriate frequency for the time series. The find_frequency parameter internally uses\n<code><a href=\"https://pkg.robjhyndman.com/forecast/reference/findfrequency.html\" class=\"external-link\">findfrequency</a></code>, which does a spectral analysis of the time series\nfor identifying a suitable frequency. Using find_frequency will update the previously set\nfrequency of a ts object to the newly found frequency. The default is 'find_frequency = FALSE',\nwhich gives a warning if no seasonality is set for the supplied time series object.\nIf neither seasonality is set nor find_frequency is set to TRUE, the function goes on without\ndecomposition and just applies the selected secondary algorithm to the original time series\nthat still includes seasonality.</p>\n    </div>\n    <div id=\"references\">\n    <h2>References</h2>\n    <p>R. B. Cleveland, W. S. Cleveland, J.E. McRae, and I.\nTerpenning (1990) STL: A Seasonal-Trend Decomposition Procedure\nBased on Loess. Journal of Official Statistics, 6, 3–73.</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seasplit.html\">na_seasplit</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform seasonal imputation using algorithm = \"interpolation\"</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_seadec</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 121.3941 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 274.9995 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 321.8776 321.4178 329.4329 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 424.1798 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 357.2362 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 477.2415 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 131.6204 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 149.7682 133.0000 113.0095 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 305.0315 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 398.3917</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform seasonal imputation using algorithm = \"mean\"</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_seadec</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, algorithm <span class=\"op\">=</span> <span class=\"st\">\"mean\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 278.5342 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 310.9817 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 282.0424 276.8787 280.1899 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 323.7648 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 281.3777 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 281.0843 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 289.2064 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 289.6443 133.0000 237.2661 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 215.2535 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 242.2860</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsAirgap</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_seadec</span><span class=\"op\">(</span>algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 121.3941 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 274.9995 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 321.8776 321.4178 329.4329 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 424.1798 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 357.2362 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 477.2415 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 131.6204 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 149.7682 133.0000 113.0095 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 305.0315 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 398.3917</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/na_seasplit.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Seasonally Splitted Missing Value Imputation — na_seasplit • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Seasonally Splitted Missing Value Imputation — na_seasplit\"><meta property=\"og:description\" content=\"Splits the times series into seasons and afterwards performs\nimputation separately for each of the resulting time series datasets\n(each containing the data for one specific season).\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Seasonally Splitted Missing Value Imputation</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/na_seasplit.R\" class=\"external-link\"><code>R/na_seasplit.R</code></a></small>\n    <div class=\"hidden name\"><code>na_seasplit.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Splits the times series into seasons and afterwards performs\nimputation separately for each of the resulting time series datasets\n(each containing the data for one specific season).</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">na_seasplit</span><span class=\"op\">(</span></span>\n<span>  <span class=\"va\">x</span>,</span>\n<span>  algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span>,</span>\n<span>  find_frequency <span class=\"op\">=</span> <span class=\"cn\">FALSE</span>,</span>\n<span>  maxgap <span class=\"op\">=</span> <span class=\"cn\">Inf</span>,</span>\n<span>  <span class=\"va\">...</span></span>\n<span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject in which missing values shall be replaced</p></dd>\n\n\n<dt id=\"arg-algorithm\">algorithm<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-algorithm\"></a></dt>\n<dd><p>Algorithm to be used after splits.\nAccepts the following input:</p><ul><li><p>\"interpolation\" - Imputation by Interpolation (default choice)</p></li>\n<li><p>\"locf\" - Imputation by Last Observation Carried Forward</p></li>\n<li><p>\"mean\" - Imputation by Mean Value</p></li>\n<li><p>\"random\" - Imputation by Random Sample</p></li>\n<li><p>\"kalman\" - Imputation by Kalman Smoothing and State Space Models</p></li>\n<li><p>\"ma\" - Imputation by Weighted Moving Average</p></li>\n</ul></dd>\n\n\n<dt id=\"arg-find-frequency\">find_frequency<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-find-frequency\"></a></dt>\n<dd><p>If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.</p></dd>\n\n\n<dt id=\"arg-maxgap\">maxgap<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-maxgap\"></a></dt>\n<dd><p>Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.</p></dd>\n\n\n<dt id=\"arg--\">...<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg--\"></a></dt>\n<dd><p>Additional parameters for these algorithms that can be\npassed through. Look at <code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_locf.html\">na_locf</a></code>, <code><a href=\"na_random.html\">na_random</a></code>,\n<code><a href=\"na_mean.html\">na_mean</a></code> for parameter options.</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>)\nobject (dependent on given input at parameter x)</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"na_interpolation.html\">na_interpolation</a></code>,\n<code><a href=\"na_kalman.html\">na_kalman</a></code>, <code><a href=\"na_locf.html\">na_locf</a></code>,\n<code><a href=\"na_ma.html\">na_ma</a></code>, <code><a href=\"na_mean.html\">na_mean</a></code>,\n<code><a href=\"na_random.html\">na_random</a></code>, <code><a href=\"na_replace.html\">na_replace</a></code>,\n<code><a href=\"na_seadec.html\">na_seadec</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Perform seasonal splitted imputation using algorithm = \"interpolation\"</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_seasplit</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>        Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov   Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0 118.0 132.0 129.0 125.0 135.0 148.0 148.0 184.0 119.0 104.0 118.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0 126.0 141.0 135.0 125.0 149.0 170.0 170.0 184.0 133.0 125.0 140.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0 150.0 178.0 163.0 172.0 178.0 199.0 199.0 184.0 162.0 146.0 166.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0 180.0 193.0 181.0 183.0 218.0 230.0 242.0 209.0 191.0 172.0 194.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0 196.0 236.0 235.0 229.0 243.0 264.0 272.0 237.0 211.0 180.0 201.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0 188.0 235.0 227.0 234.0 279.0 302.0 293.0 259.0 229.0 203.0 229.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0 233.0 267.0 269.0 270.0 315.0 364.0 347.0 312.0 274.0 237.0 278.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0 277.0 311.5 308.5 312.5 374.0 413.0 405.0 355.0 306.0 271.0 306.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0 301.0 356.0 348.0 355.0 404.5 465.0 467.0 404.0 347.0 290.5 336.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0 318.0 381.0 348.0 363.0 435.0 491.0 505.0 404.0 359.0 310.0 337.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0 342.0 406.0 396.0 420.0 472.0 548.0 559.0 463.0 407.0 362.0 384.5</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0 391.0 419.0 461.0 420.0 535.0 622.0 606.0 508.0 461.0 390.0 432.0</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Perform seasonal splitted imputation using algorithm = \"mean\"</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">na_seasplit</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, algorithm <span class=\"op\">=</span> <span class=\"st\">\"mean\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Jan      Feb      Mar      Apr      May      Jun      Jul      Aug</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0000 118.0000 132.0000 129.0000 261.2222 135.0000 148.0000 148.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0000 126.0000 141.0000 135.0000 125.0000 149.0000 170.0000 170.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0000 150.0000 178.0000 163.0000 172.0000 178.0000 199.0000 199.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0000 180.0000 193.0000 181.0000 183.0000 218.0000 230.0000 242.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0000 196.0000 236.0000 235.0000 229.0000 243.0000 264.0000 272.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0000 188.0000 235.0000 227.0000 234.0000 305.4000 302.0000 293.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0000 233.0000 267.0000 269.0000 270.0000 315.0000 364.0000 347.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0000 277.0000 256.3000 262.9091 261.2222 374.0000 413.0000 405.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0000 301.0000 356.0000 348.0000 355.0000 305.4000 465.0000 467.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0000 318.0000 256.3000 348.0000 363.0000 435.0000 491.0000 505.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0000 342.0000 406.0000 396.0000 420.0000 472.0000 548.0000 559.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0000 391.0000 419.0000 461.0000 261.2222 535.0000 622.0000 606.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>           Sep      Oct      Nov      Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 333.5000 119.0000 104.0000 118.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 333.5000 133.0000 237.5000 140.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 184.0000 162.0000 146.0000 166.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 209.0000 191.0000 172.0000 194.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 237.0000 211.0000 180.0000 201.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 259.0000 229.0000 203.0000 229.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 312.0000 274.0000 237.0000 278.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 355.0000 306.0000 271.0000 306.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 404.0000 347.0000 237.5000 336.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 404.0000 359.0000 310.0000 337.0000</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 463.0000 407.0000 362.0000 248.8182</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 508.0000 461.0000 390.0000 432.0000</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsAirgap</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">na_seasplit</span><span class=\"op\">(</span>algorithm <span class=\"op\">=</span> <span class=\"st\">\"interpolation\"</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>        Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep   Oct   Nov   Dec</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1949 112.0 118.0 132.0 129.0 125.0 135.0 148.0 148.0 184.0 119.0 104.0 118.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1950 115.0 126.0 141.0 135.0 125.0 149.0 170.0 170.0 184.0 133.0 125.0 140.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1951 145.0 150.0 178.0 163.0 172.0 178.0 199.0 199.0 184.0 162.0 146.0 166.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1952 171.0 180.0 193.0 181.0 183.0 218.0 230.0 242.0 209.0 191.0 172.0 194.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1953 196.0 196.0 236.0 235.0 229.0 243.0 264.0 272.0 237.0 211.0 180.0 201.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1954 204.0 188.0 235.0 227.0 234.0 279.0 302.0 293.0 259.0 229.0 203.0 229.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1955 242.0 233.0 267.0 269.0 270.0 315.0 364.0 347.0 312.0 274.0 237.0 278.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1956 284.0 277.0 311.5 308.5 312.5 374.0 413.0 405.0 355.0 306.0 271.0 306.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1957 315.0 301.0 356.0 348.0 355.0 404.5 465.0 467.0 404.0 347.0 290.5 336.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1958 340.0 318.0 381.0 348.0 363.0 435.0 491.0 505.0 404.0 359.0 310.0 337.0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1959 360.0 342.0 406.0 396.0 420.0 472.0 548.0 559.0 463.0 407.0 362.0 384.5</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> 1960 417.0 391.0 419.0 461.0 420.0 535.0 622.0 606.0 508.0 461.0 390.0 432.0</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/plotNA.distribution.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Discontinued - Use ggplot_na_distribution instead. — plotNA.distribution • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Discontinued - Use ggplot_na_distribution instead. — plotNA.distribution\"><meta property=\"og:description\" content=\"plotNA.distribution was replaced by ggplot_na_distribution.\nThe new plotting function provides an improved version of the old plot, e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Discontinued - Use <code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>plotNA.distribution.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>plotNA.distribution was replaced by <code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>.\nThe new plotting function provides an improved version of the old plot, e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">plotNA.distribution</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/plotNA.distributionBar.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Discontinued - Use ggplot_na_distribution2 instead. — plotNA.distributionBar • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Discontinued - Use ggplot_na_distribution2 instead. — plotNA.distributionBar\"><meta property=\"og:description\" content=\"plotNA.distributionBar was replaced by ggplot_na_distribution2.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Discontinued - Use <code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>plotNA.distributionBar.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>plotNA.distributionBar was replaced by <code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">plotNA.distributionBar</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/plotNA.gapsize.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Discontinued - Use ggplot_na_gapsize instead. — plotNA.gapsize • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Discontinued - Use ggplot_na_gapsize instead. — plotNA.gapsize\"><meta property=\"og:description\" content=\"plotNA.gapsize was replaced by ggplot_na_gapsize.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Discontinued - Use <code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>plotNA.gapsize.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>plotNA.gapsize was replaced by <code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code>.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">plotNA.gapsize</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/plotNA.imputations.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Discontinued - Use ggplot_na_imputations instead. — plotNA.imputations • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Discontinued - Use ggplot_na_imputations instead. — plotNA.imputations\"><meta property=\"og:description\" content=\"plotNA.imputations was replaced by ggplot_na_imputations.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Discontinued - Use <code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code> instead.</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/deprecated_defunct.R\" class=\"external-link\"><code>R/deprecated_defunct.R</code></a></small>\n    <div class=\"hidden name\"><code>plotNA.imputations.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>plotNA.imputations was replaced by <code><a href=\"ggplot_na_imputations.html\">ggplot_na_imputations</a></code>.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">plotNA.imputations</span><span class=\"op\">(</span><span class=\"va\">x</span>, <span class=\"va\">...</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/reexports.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Objects exported from other packages — reexports • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Objects exported from other packages — reexports\"><meta property=\"og:description\" content=\"These objects are imported from other packages. Follow the links\nbelow to see their documentation.\n\n  magrittr\n%&amp;gt;%\n\n\n\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Objects exported from other packages</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/imputeTS-package.R\" class=\"external-link\"><code>R/imputeTS-package.R</code></a></small>\n    <div class=\"hidden name\"><code>reexports.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>These objects are imported from other packages. Follow the links\nbelow to see their documentation.</p>\n<dl><dt>magrittr</dt>\n<dd><p><code>%&gt;%</code></p></dd>\n\n\n</dl></div>\n\n\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/statsNA.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Print Statistics about Missing Values — statsNA • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Print Statistics about Missing Values — statsNA\"><meta property=\"og:description\" content=\"Print summary stats about the distribution of\nmissing values in a univariate time series.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Print Statistics about Missing Values</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/statsNA.R\" class=\"external-link\"><code>R/statsNA.R</code></a></small>\n    <div class=\"hidden name\"><code>statsNA.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Print summary stats about the distribution of\nmissing values in a univariate time series.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"fu\">statsNA</span><span class=\"op\">(</span><span class=\"va\">x</span>, bins <span class=\"op\">=</span> <span class=\"fl\">4</span>, print_only <span class=\"op\">=</span> <span class=\"cn\">TRUE</span><span class=\"op\">)</span></span></code></pre></div>\n    </div>\n\n    <div id=\"arguments\">\n    <h2>Arguments</h2>\n\n\n<dl><dt id=\"arg-x\">x<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-x\"></a></dt>\n<dd><p>Numeric Vector (<code><a href=\"https://rdrr.io/r/base/vector.html\" class=\"external-link\">vector</a></code>) or\nTime Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) object containing NAs</p></dd>\n\n\n<dt id=\"arg-bins\">bins<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-bins\"></a></dt>\n<dd><p>Split number for bin stats. Number of bins the time series gets\ndivided into. For each bin information about amount/percentage of missing\nvalues is printed. Default value is 4 - what means stats about the\n1st,2nd,3rd,4th quarter of the time series are shown.</p></dd>\n\n\n<dt id=\"arg-print-only\">print_only<a class=\"anchor\" aria-label=\"anchor\" href=\"#arg-print-only\"></a></dt>\n<dd><p>Choose if the function Prints or Returns.\nFor print_only = TRUE the function has no return value and just prints out\nmissing value stats. If print_only is changed to FALSE, nothing is printed\nand the function returns a list.Print gives a little bit more information,\nsince the returned list does not include \"Stats for Bins\"\nand \"overview NA series\"</p></dd>\n\n</dl></div>\n    <div id=\"value\">\n    <h2>Value</h2>\n    <p>A <code><a href=\"https://rdrr.io/r/base/list.html\" class=\"external-link\">list</a></code> containing the stats. Beware: Function gives\nonly a return value if print_only = FALSE.</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>Prints the following information about the missing values in the time series:</p><ul><li><p>\"Length of time series\" - Number of observations in the time series (including NAs)</p></li>\n<li><p>\"Number of Missing Values\" - Number of missing values in the time series</p></li>\n<li><p>\"Percentage of Missing Values\" - Percentage of missing values in the time series</p></li>\n<li><p>\"Number of Gaps\" - Number of NA gaps (consisting of one or more consecutive NAs) in the time series</p></li>\n<li><p>\"Average Gap Size\" - Average size of consecutive NAs for the NA gaps in the time series</p></li>\n<li><p>\"Stats for Bins\" - Number/percentage of missing values for the split into bins</p></li>\n<li><p>\"Longest NA gap\" - Longest series of consecutive missing values (NAs in a row) in the time series</p></li>\n<li><p>\"Most frequent gap size\" - Most frequent occurring series of missing values in the time series</p></li>\n<li><p>\"Gap size accounting for most NAs\" - The series of consecutive missing values that accounts for most missing values overall in the time series</p></li>\n<li><p>\"Overview NA series\" - Overview about how often each series of consecutive missing values occurs. Series occurring 0 times are skipped</p></li>\n</ul><p>It is furthermore, important to note, that you are able to choose whether\nthe function returns a list or prints the information only.\n(see description of parameter \"print_only\")</p>\n    </div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"ggplot_na_distribution.html\">ggplot_na_distribution</a></code>,\n<code><a href=\"ggplot_na_distribution2.html\">ggplot_na_distribution2</a></code>,\n<code><a href=\"ggplot_na_gapsize.html\">ggplot_na_gapsize</a></code></p></div>\n    </div>\n    <div id=\"author\">\n    <h2>Author</h2>\n    <p>Steffen Moritz</p>\n    </div>\n\n    <div id=\"ref-examples\">\n    <h2>Examples</h2>\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span class=\"r-in\"><span><span class=\"co\"># Example 1: Print stats about the missing data in tsNH4</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">statsNA</span><span class=\"op\">(</span><span class=\"va\">tsNH4</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Length of time series:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 4552</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Number of Missing Values:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 883</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Percentage of Missing Values:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"19.4%\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Number of Gaps:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 155</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Average Gap Size:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 5.696774</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Stats for Bins\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 1 (1138 values from 1 to 1138) :      233 NAs (20.5%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 2 (1138 values from 1139 to 2276) :      433 NAs (38%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 3 (1138 values from 2277 to 3414) :      135 NAs (11.9%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 4 (1138 values from 3415 to 4552) :      82 NAs (7.21%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Longest NA gap (series of consecutive NAs)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"157 in a row\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Most frequent gap size (series of consecutive NA series)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"1 NA in a row (occurring 68 times)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Gap size accounting for most NAs\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"157 NA in a row (occurring 1 times, making up for overall 157 NAs)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Overview NA series\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  1 NA in a row: 68 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  2 NA in a row: 26 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  3 NA in a row: 16 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  4 NA in a row: 10 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  5 NA in a row: 8 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  6 NA in a row: 4 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  7 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  8 NA in a row: 3 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  9 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  10 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  11 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  12 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  14 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  16 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  17 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  21 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  25 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  26 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  27 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  32 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  42 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  91 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  157 NA in a row: 1 times\"</span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 2: Return list with stats about the missing data in tsAirgap</span></span></span>\n<span class=\"r-in\"><span><span class=\"fu\">statsNA</span><span class=\"op\">(</span><span class=\"va\">tsAirgap</span>, print_only <span class=\"op\">=</span> <span class=\"cn\">FALSE</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $length_series</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 144</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $number_NAs</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 13</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $number_na_gaps</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 11</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $average_size_na_gaps</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 1.181818</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $percentage_NAs</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"9.03%\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $longest_na_gap</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 3</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $most_frequent_na_gap</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 1</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $most_weighty_na_gap</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 1</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> $df_distribution_na_gaps</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>   [1] 10  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [26]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [51]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span>  [76]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [101]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [126]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> </span>\n<span class=\"r-in\"><span></span></span>\n<span class=\"r-in\"><span><span class=\"co\"># Example 3: Same as example 1, just written with pipe operator</span></span></span>\n<span class=\"r-in\"><span><span class=\"va\">tsNH4</span> <span class=\"op\"><a href=\"https://magrittr.tidyverse.org/reference/pipe.html\" class=\"external-link\">%&gt;%</a></span> <span class=\"fu\">statsNA</span><span class=\"op\">(</span><span class=\"op\">)</span></span></span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Length of time series:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 4552</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Number of Missing Values:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 883</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Percentage of Missing Values:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"19.4%\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Number of Gaps:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 155</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Average Gap Size:\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] 5.696774</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Stats for Bins\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 1 (1138 values from 1 to 1138) :      233 NAs (20.5%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 2 (1138 values from 1139 to 2276) :      433 NAs (38%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 3 (1138 values from 2277 to 3414) :      135 NAs (11.9%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  Bin 4 (1138 values from 3415 to 4552) :      82 NAs (7.21%)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Longest NA gap (series of consecutive NAs)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"157 in a row\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Most frequent gap size (series of consecutive NA series)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"1 NA in a row (occurring 68 times)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Gap size accounting for most NAs\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"157 NA in a row (occurring 1 times, making up for overall 157 NAs)\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"-------------------------\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"Overview NA series\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  1 NA in a row: 68 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  2 NA in a row: 26 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  3 NA in a row: 16 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  4 NA in a row: 10 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  5 NA in a row: 8 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  6 NA in a row: 4 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  7 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  8 NA in a row: 3 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  9 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  10 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  11 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  12 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  14 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  16 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  17 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  21 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  25 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  26 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  27 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  32 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  42 NA in a row: 2 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  91 NA in a row: 1 times\"</span>\n<span class=\"r-out co\"><span class=\"r-pr\">#&gt;</span> [1] \"  157 NA in a row: 1 times\"</span>\n</code></pre></div>\n    </div>\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsAirgap.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of monthly airline passengers (with NAs) — tsAirgap • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of monthly airline passengers (with NAs) — tsAirgap\"><meta property=\"og:description\" content=\"Monthly totals of international airline passengers, 1949 to 1960.\nThis time series contains missing values. In the package included is also the tsAirgapComplete time series providing the true values for the\nmissing values.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of monthly airline passengers (with NAs)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsAirgap.R\" class=\"external-link\"><code>R/tsAirgap.R</code></a></small>\n    <div class=\"hidden name\"><code>tsAirgap.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Monthly totals of international airline passengers, 1949 to 1960.\nThis time series contains missing values. In the package included is also the <code><a href=\"tsAirgapComplete.html\">tsAirgapComplete</a></code> time series providing the true values for the\nmissing values.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsAirgap</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 144 rows including 13 NAs.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.</cite></p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The dataset originates from Box and Jenkins (see citation) and is a commonly used example in\ntime series analysis literature.</p>\n<p>It characteristics (strong trend, strong seasonal behavior) make it also a great\nexample for time series imputation.\nThus the version with inserted NA gaps was created under the name tsAirgap.</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied.</p>\n<p>There are the two time series:</p><ul><li><p>tsAirgap - The time series with NAs.</p></li>\n<li><p>tsAirgapComplete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsHeating.html\">tsHeating</a></code>, <code><a href=\"tsNH4.html\">tsNH4</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsAirgapComplete.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of monthly airline passengers (complete) — tsAirgapComplete • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of monthly airline passengers (complete) — tsAirgapComplete\"><meta property=\"og:description\" content=\"Monthly totals of international airline passengers, 1949 to 1960.\nThis time series provides the truth for the missing values of the tsAirgap time series. Thus it is identical\nto the tsAirgap time series except that no value is missing.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of monthly airline passengers (complete)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsAirgapComplete.R\" class=\"external-link\"><code>R/tsAirgapComplete.R</code></a></small>\n    <div class=\"hidden name\"><code>tsAirgapComplete.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Monthly totals of international airline passengers, 1949 to 1960.\nThis time series provides the truth for the missing values of the <code><a href=\"tsAirgap.html\">tsAirgap</a></code> time series. Thus it is identical\nto the tsAirgap time series except that no value is missing.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsAirgapComplete</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 144 rows.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.</cite></p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The dataset originates from Box and Jenkins (see citation) and is a commonly used example in\ntime series analysis literature.</p>\n<p>It characteristics (strong trend, strong seasonal behavior) make it also a great\nexample for time series imputation.\nThus the version with inserted NA gaps was created under the name tsAirgap.</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied.</p>\n<p>There are the two time series:</p><ul><li><p>tsAirgap - The time series with NAs.</p></li>\n<li><p>tsAirgapComplete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsHeating.html\">tsHeating</a></code>, <code><a href=\"tsNH4.html\">tsNH4</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsHeating.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of a heating systems supply temperature (with NAs) — tsHeating • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of a heating systems supply temperature (with NAs) — tsHeating\"><meta property=\"og:description\" content=\"Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series contains missing values. In the package included is also the tsHeatingComplete time series providing the true values for the\nmissing values.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of a heating systems supply temperature (with NAs)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsHeating.R\" class=\"external-link\"><code>R/tsHeating.R</code></a></small>\n    <div class=\"hidden name\"><code>tsHeating.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series contains missing values. In the package included is also the <code><a href=\"tsHeatingComplete.html\">tsHeatingComplete</a></code> time series providing the true values for the\nmissing values.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsHeating</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 606837 rows including 57391 NAs.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt,\nChristopher, and Bartz-Beielstein, Thomas. (2015, May 1).\nGECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering\nmissing information in heating system operating data' competition at the\nGenetic and Evolutionary Computation Conference 2015, Madrid, Spain.\nhttp://doi.org/10.5281/zenodo.3884899 </cite></p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The time series originates from the GECCO Industrial Challenge 2015.\nThis Challenge was about \"Recovering missing information in heating system operating data\".\nGoal was to impute missing values in heating system sensor data as accurate as possible.\n(<a href=\"https://doi.org/10.5281/zenodo.3884899\" class=\"external-link\">doi:10.5281/zenodo.3884899</a>\n)</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.</p>\n<p>There are the two time series:</p><ul><li><p>tsHeating - The time series with NAs.</p></li>\n<li><p>tsHeatingComplete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsAirgap.html\">tsAirgap</a></code>, <code><a href=\"tsNH4.html\">tsNH4</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsHeatingComplete.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of a heating systems supply temperature (complete) — tsHeatingComplete • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of a heating systems supply temperature (complete) — tsHeatingComplete\"><meta property=\"og:description\" content=\"Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series provides the truth for the missing values of the tsHeating time series. Thus it is identical\nto the heating time series except that no value is missing.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of a heating systems supply temperature (complete)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsHeatingComplete.R\" class=\"external-link\"><code>R/tsHeatingComplete.R</code></a></small>\n    <div class=\"hidden name\"><code>tsHeatingComplete.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Time series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series provides the truth for the missing values of the <code><a href=\"tsHeating.html\">tsHeating</a></code> time series. Thus it is identical\nto the heating time series except that no value is missing.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsHeatingComplete</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 606837 rows.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt,\nChristopher, and Bartz-Beielstein, Thomas. (2015, May 1).\nGECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering\nmissing information in heating system operating data' competition at the\nGenetic and Evolutionary Computation Conference 2015, Madrid, Spain.\nhttp://doi.org/10.5281/zenodo.3884899 </cite></p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The time series originates from the GECCO Industrial Challenge 2015.\nThis Challenge was about \"Recovering missing information in heating system operating data\".\nGoal was to impute missing values in heating system sensor data as accurate as possible.\n(<a href=\"https://doi.org/10.5281/zenodo.3884899\" class=\"external-link\">doi:10.5281/zenodo.3884899</a>\n)</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.</p>\n<p>There are the two time series:</p><ul><li><p>tsHeating - The time series with NAs.</p></li>\n<li><p>tsHeatingComplete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsAirgap.html\">tsAirgap</a></code>, <code><a href=\"tsNH4.html\">tsNH4</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsNH4.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of NH4 concentration in a wastewater system (with NAs) — tsNH4 • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of NH4 concentration in a wastewater system (with NAs) — tsNH4\"><meta property=\"og:description\" content=\"Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series contains missing values. In the package included is also the tsNH4Complete time series providing the true values for the\nmissing values.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of NH4 concentration in a wastewater system (with NAs)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsNH4.R\" class=\"external-link\"><code>R/tsNH4.R</code></a></small>\n    <div class=\"hidden name\"><code>tsNH4.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series contains missing values. In the package included is also the <code><a href=\"tsNH4Complete.html\">tsNH4Complete</a></code> time series providing the true values for the\nmissing values.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsNH4</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 4552 rows including 883 NAs.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\nBartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16).\nGECCO Industrial Challenge 2014 Dataset: A water quality dataset for the\n'Active protection against pollution of the surface water' competition at the\nGenetic and Evolutionary Computation Conference 2015, Vancouver, Canada.\nhttp://www.spotseven.de/gecco-challenge/gecco-challenge-2014</cite></p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The time series is derived from the dataset of the  GECCO Industrial Challenge 2014.</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.</p>\n<p>There are the two time series:</p><ul><li><p>tsNH4 - The time series with NAs.</p></li>\n<li><p>tsNH4Complete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsAirgap.html\">tsAirgap</a></code>,<code><a href=\"tsHeating.html\">tsHeating</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/reference/tsNH4Complete.html",
    "content": "<!DOCTYPE html>\n<!-- Generated by pkgdown: do not edit by hand --><html lang=\"en\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>Time series of NH4 concentration in a wastewater system (complete) — tsNH4Complete • imputeTS</title><!-- favicons --><link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"../favicon-48x48.png\"><link rel=\"icon\" type=\"”image/svg+xml”\" href=\"../favicon.svg\"><link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"../apple-touch-icon.png\"><link rel=\"icon\" sizes=\"any\" href=\"../favicon.ico\"><link rel=\"manifest\" href=\"../site.webmanifest\"><!-- jquery --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\" integrity=\"sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script><!-- Bootstrap --><link href=\"https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/flatly/bootstrap.min.css\" rel=\"stylesheet\" crossorigin=\"anonymous\"><script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js\" integrity=\"sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=\" crossorigin=\"anonymous\"></script><!-- bootstrap-toc --><link rel=\"stylesheet\" href=\"../bootstrap-toc.css\"><script src=\"../bootstrap-toc.js\"></script><!-- Font Awesome icons --><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css\" integrity=\"sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=\" crossorigin=\"anonymous\"><link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css\" integrity=\"sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=\" crossorigin=\"anonymous\"><!-- clipboard.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js\" integrity=\"sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=\" crossorigin=\"anonymous\"></script><!-- headroom.js --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js\" integrity=\"sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js\" integrity=\"sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=\" crossorigin=\"anonymous\"></script><!-- pkgdown --><link href=\"../pkgdown.css\" rel=\"stylesheet\"><script src=\"../pkgdown.js\"></script><meta property=\"og:title\" content=\"Time series of NH4 concentration in a wastewater system (complete) — tsNH4Complete\"><meta property=\"og:description\" content=\"Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series provides the truth for the missing values of the tsNH4 time series. Thus it is identical\nto the heating time series except that no value is missing.\"><meta property=\"og:image\" content=\"https://SteffenMoritz.github.io/imputeTS/logo.png\"><!-- mathjax --><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js\" integrity=\"sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=\" crossorigin=\"anonymous\"></script><script src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js\" integrity=\"sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=\" crossorigin=\"anonymous\"></script><!--[if lt IE 9]>\n<script src=\"https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js\"></script>\n<script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n<![endif]--></head><body data-spy=\"scroll\" data-target=\"#toc\">\n\n\n    <div class=\"container template-reference-topic\">\n      <header><div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n  <div class=\"container\">\n    <div class=\"navbar-header\">\n      <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\">\n        <span class=\"sr-only\">Toggle navigation</span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n        <span class=\"icon-bar\"></span>\n      </button>\n      <span class=\"navbar-brand\">\n        <a class=\"navbar-link\" href=\"../index.html\">imputeTS</a>\n        <span class=\"version label label-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"\">3.4</span>\n      </span>\n    </div>\n\n    <div id=\"navbar\" class=\"navbar-collapse collapse\">\n      <ul class=\"nav navbar-nav\"><li>\n  <a href=\"../reference/index.html\">Reference</a>\n</li>\n<li class=\"dropdown\">\n  <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\">\n    Articles\n\n    <span class=\"caret\"></span>\n  </a>\n  <ul class=\"dropdown-menu\" role=\"menu\"><li>\n      <a href=\"../articles/gallery_visualizations.html\">Gallery: Times Series Missing Data Visualizations</a>\n    </li>\n  </ul></li>\n<li>\n  <a href=\"../news/index.html\">Changelog</a>\n</li>\n      </ul><ul class=\"nav navbar-nav navbar-right\"><li>\n  <a href=\"https://github.com/SteffenMoritz/imputeTS/\" class=\"external-link\">\n    <span class=\"fab fa-github fa-lg\"></span>\n\n  </a>\n</li>\n      </ul></div><!--/.nav-collapse -->\n  </div><!--/.container -->\n</div><!--/.navbar -->\n\n\n\n      </header><div class=\"row\">\n  <div class=\"col-md-9 contents\">\n    <div class=\"page-header\">\n    <h1>Time series of NH4 concentration in a wastewater system (complete)</h1>\n    <small class=\"dont-index\">Source: <a href=\"https://github.com/SteffenMoritz/imputeTS/blob/HEAD/R/tsNH4Complete.R\" class=\"external-link\"><code>R/tsNH4Complete.R</code></a></small>\n    <div class=\"hidden name\"><code>tsNH4Complete.Rd</code></div>\n    </div>\n\n    <div class=\"ref-description\">\n    <p>Time series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series provides the truth for the missing values of the <code><a href=\"tsNH4.html\">tsNH4</a></code> time series. Thus it is identical\nto the heating time series except that no value is missing.</p>\n    </div>\n\n    <div id=\"ref-usage\">\n    <div class=\"sourceCode\"><pre class=\"sourceCode r\"><code><span><span class=\"va\">tsNH4Complete</span></span></code></pre></div>\n    </div>\n\n    <div id=\"format\">\n    <h2>Format</h2>\n    <p>Time Series (<code><a href=\"https://rdrr.io/r/stats/ts.html\" class=\"external-link\">ts</a></code>) with 4552 rows.</p>\n    </div>\n    <div id=\"source\">\n    <h2>Source</h2>\n    <p><cite>Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\nBartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16).\nGECCO Industrial Challenge 2014 Dataset: A water quality dataset for the\n'Active protection against pollution of the surface water' competition at the\nGenetic and Evolutionary Computation Conference 2015, Vancouver, Canada.\nhttp://www.spotseven.de/gecco-challenge/gecco-challenge-2014</cite>#'</p>\n    </div>\n    <div id=\"details\">\n    <h2>Details</h2>\n    <p>The time series is derived from the dataset of the  GECCO Industrial Challenge 2014.</p>\n<p>In order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.</p>\n<p>There are the two time series:</p><ul><li><p>tsNH4 - The time series with NAs.</p></li>\n<li><p>tsNH4Complete - Time series without NAs.</p></li>\n</ul></div>\n    <div id=\"see-also\">\n    <h2>See also</h2>\n    <div class=\"dont-index\"><p><code><a href=\"tsAirgap.html\">tsAirgap</a></code>,<code><a href=\"tsHeating.html\">tsHeating</a></code></p></div>\n    </div>\n\n  </div>\n  <div class=\"col-md-3 hidden-xs hidden-sm\" id=\"pkgdown-sidebar\">\n    <nav id=\"toc\" data-toggle=\"toc\" class=\"sticky-top\"><h2 data-toc-skip>Contents</h2>\n    </nav></div>\n</div>\n\n\n      <footer><div class=\"copyright\">\n  <p></p><p>Developed by Steffen Moritz, Sebastian Gatscha.</p>\n</div>\n\n<div class=\"pkgdown\">\n  <p></p><p>Site built with <a href=\"https://pkgdown.r-lib.org/\" class=\"external-link\">pkgdown</a> 2.1.3.</p>\n</div>\n\n      </footer></div>\n\n\n\n\n\n\n  </body></html>\n\n"
  },
  {
    "path": "docs/sitemap.xml",
    "content": "<urlset xmlns = 'http://www.sitemaps.org/schemas/sitemap/0.9'>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/404.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/articles/gallery_visualizations.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/articles/index.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/authors.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/index.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/news/index.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_distribution.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_distribution2.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_gapsize.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_gapsize2.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_imputations.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_intervals.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_level.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_level2.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/ggplot_na_pattern.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/imputeTS-package.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/index.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.interpolation.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.kalman.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.locf.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.ma.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.mean.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.random.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.remove.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.replace.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.seadec.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na.seasplit.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_interpolation.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_kalman.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_locf.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_ma.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_mean.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_random.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_remove.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_replace.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_seadec.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/na_seasplit.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/plotNA.distribution.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/plotNA.distributionBar.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/plotNA.gapsize.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/plotNA.imputations.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/reexports.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/statsNA.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsAirgap.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsAirgapComplete.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsHeating.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsHeatingComplete.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsNH4.html</loc></url>\n<url><loc>https://SteffenMoritz.github.io/imputeTS/reference/tsNH4Complete.html</loc></url>\n</urlset>\n\n"
  },
  {
    "path": "imputeTS.Rproj",
    "content": "Version: 1.0\n\nRestoreWorkspace: Default\nSaveWorkspace: Default\nAlwaysSaveHistory: Default\n\nEnableCodeIndexing: Yes\nUseSpacesForTab: Yes\nNumSpacesForTab: 2\nEncoding: UTF-8\n\nRnwWeave: Sweave\nLaTeX: pdfLaTeX\n\nBuildType: Package\nPackageUseDevtools: Yes\nPackageInstallArgs: --no-multiarch --with-keep.source\nPackageRoxygenize: rd,collate,namespace\n"
  },
  {
    "path": "inst/CITATION",
    "content": "year <- sub(\"-.*\", \"\", meta$Date)\nvers <- paste(\"R package version\", meta$Version)\n\ncitHeader(\"To cite the imputeTS package, use:\")\n\nbibentry(bibtype = \"Article\",\n  title     = \"{imputeTS: Time Series Missing Value Imputation in R}\",\n  author    = c(person(\"Steffen Moritz\"),person(\"Thomas Bartz-Beielstein\")),\n  journal   = \"{The R Journal}\",\n  volume    =  9,\n  number    =  1,\n  pages     = \"207--218\",\n  year      =  2017,\n  doi       = \"10.32614/RJ-2017-009\")\n  \n\n"
  },
  {
    "path": "man/ggplot_na_distribution.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot_na_distribution.R\n\\name{ggplot_na_distribution}\n\\alias{ggplot_na_distribution}\n\\title{Line Plot to Visualize the Distribution of Missing Values}\n\\usage{\nggplot_na_distribution(\n  x,\n  x_axis_labels = NULL,\n  color_points = \"steelblue\",\n  color_lines = \"steelblue2\",\n  color_missing = \"indianred\",\n  color_missing_border = \"indianred\",\n  alpha_missing = 0.5,\n  title = \"Distribution of Missing Values\",\n  subtitle = \"Time Series with highlighted missing regions\",\n  xlab = \"Time\",\n  ylab = \"Value\",\n  shape_points = 20,\n  size_points = 2.5,\n  theme = ggplot2::theme_linedraw()\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n(\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.}\n\n\\item{x_axis_labels}{For adding specific x-axis labels. Takes a vector of\n\\code{\\link[base]{Date}} or \\code{\\link[base]{POSIXct}} objects\nas an input (needs the same length as x) . The Default (NULL) uses the\nobservation numbers as  x-axis tick labels.}\n\n\\item{color_points}{Color for the Symbols/Points.}\n\n\\item{color_lines}{Color for the Lines.}\n\n\\item{color_missing}{Color used for highlighting the time spans with NA values.}\n\n\\item{color_missing_border}{Color used as border for time spans with NA values.}\n\n\\item{alpha_missing}{Alpha (transparency) value used for color_missing.}\n\n\\item{title}{Title of the Plot (NULL for deactivating title).}\n\n\\item{subtitle}{Subtitle of the Plot (NULL for deactivating subtitle).}\n\n\\item{xlab}{Label for x-Axis.}\n\n\\item{ylab}{Label for y-Axis.}\n\n\\item{shape_points}{Symbol to use for the Observations/Points. See\nhttps://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.}\n\n\\item{size_points}{Size of Symbols/Points.}\n\n\\item{theme}{Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(\\code{\\link[ggplot2]{theme_linedraw})}}\n}\n\\description{\nVisualize the distribution of missing values within a time series.\n}\n\\details{\nThis function visualizes the distribution of missing values within\na time series. If a value is NA, the background is colored differently.\nThis gives a good overview of where most missing values occur.\n\nThe only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.\n\nAs long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.\n\nThe plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.\n\nFor very long time series it might happen, that the plot gets too crowded\nand overplotting issues occur. In this case the\n\\code{\\link[imputeTS]{ggplot_na_distribution2}} plotting function can provide\na more condensed overview.\n}\n\\examples{\n# Example 1: Visualize the missing values in x\nx <- stats::ts(c(1:11, 4:9, NA, NA, NA, 11:15, 7:15, 15:6, NA, NA, 2:5, 3:7))\nggplot_na_distribution(x)\n\n# Example 2: Visualize the missing values in tsAirgap time series\nggplot_na_distribution(tsAirgap)\n\n# Example 3: Same as example 1, just written with pipe operator\nx <- ts(c(1:11, 4:9, NA, NA, NA, 11:15, 7:15, 15:6, NA, NA, 2:5, 3:7))\nx \\%>\\% ggplot_na_distribution()\n\n# Example 4: Visualize NAs in tsAirgap - different color for points\n# Plot adjustments via ggplot_na_distribution function parameters\nggplot_na_distribution(tsAirgap, color_points = \"grey\")\n\n# Example 5: Visualize NAs in tsAirgap - different theme\n# Plot adjustments via ggplot_na_distribution function parameters\nggplot_na_distribution(tsAirgap, theme = ggplot2::theme_classic())\n\n# Example 6: Visualize NAs in tsAirgap - title, subtitle in center\n# Plot adjustments via ggplot2 syntax\nggplot_na_distribution(tsAirgap) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n  ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n\n# Example 7: Visualize NAs in tsAirgap - title in center, no subtitle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_distribution(tsAirgap, subtitle = NULL) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n\n# Example 8: Visualize NAs in tsAirgap - x-axis texts with angle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_distribution(tsAirgap, color_points = \"grey\") +\n  ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n  \n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_distribution2}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n\\code{\\link[imputeTS]{ggplot_na_imputations}}\n}\n\\author{\nSteffen Moritz, Sebastian Gatscha\n}\n"
  },
  {
    "path": "man/ggplot_na_distribution2.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot_na_distribution2.R\n\\name{ggplot_na_distribution2}\n\\alias{ggplot_na_distribution2}\n\\title{Stacked Bar Plot to Visualize Missing Values per Time Interval}\n\\usage{\nggplot_na_distribution2(\n  x,\n  number_intervals = NULL,\n  interval_size = NULL,\n  measure = \"percent\",\n  color_missing = \"indianred2\",\n  color_existing = \"steelblue\",\n  alpha_missing = 0.8,\n  alpha_existing = 0.3,\n  title = \"Missing Values per Interval\",\n  subtitle = \"Amount of NA and non-NA for successive intervals\",\n  xlab = \"Time Lapse (Interval Size: XX)\",\n  ylab = NULL,\n  color_border = \"white\",\n  theme = ggplot2::theme_linedraw()\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n(\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.}\n\n\\item{number_intervals}{Defines the number of bins to be created. Default\nnumber of intervals (denoted by NULL) is calculated by \\code{\\link[grDevices]{nclass.Sturges}}\nusing Sturges' formula. If the interval_size parameter is set to a value\ndifferent to NULL this parameter is ignored.}\n\n\\item{interval_size}{Defines how many observations should be in one bin/interval.\nThe required number of overall bins is afterwards calculated automatically.\nIf used this parameter overwrites the number_intervals parameter.\nFor a very long time series be sure to make the interval_size not extremely\nsmall, otherwise because of  overplotting issues nothing can be seen until\nyou also increase the plot width.}\n\n\\item{measure}{Whether the NA / non-NA ratio should be given as\npercent or absolute numbers.\n\n\\itemize{\n\\item{\"percent\" - for percentages}\n\n\\item{\"count\" - for absolute numbers of NAs}\n}}\n\n\\item{color_missing}{Color for the amount of missing values.}\n\n\\item{color_existing}{Color for the amount of existing values.}\n\n\\item{alpha_missing}{Alpha (transparency) value for the missing values.}\n\n\\item{alpha_existing}{Alpha (transparency) value for the existing values.}\n\n\\item{title}{Title of the Plot (NULL for deactivating title).}\n\n\\item{subtitle}{Subtitle of the Plot (NULL for deactivating subtitle).}\n\n\\item{xlab}{Label for x-Axis. Automatically set to the current interval size, if\nno custom text is chosen.}\n\n\\item{ylab}{Label for y-Axis. As default (NULL), the axis is automatically set\nto either 'Percent' or 'Count' dependent on the settings of parameter \\code{measure}.}\n\n\\item{color_border}{Color for the small borders between the intervals/bins.\nDefault is 'white'.}\n\n\\item{theme}{Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(\\code{\\link[ggplot2]{theme_linedraw})}}\n}\n\\description{\nVisualization of missing values in barplot form.\nEspecially useful when looking at specific intervals and for\ntime series with a lot of observations.\n}\n\\details{\nThis function visualizes the distribution of missing values within\na time series. In comparison to the \\code{\\link[imputeTS]{ggplot_na_distribution}}\nfunction this is not done by plotting each observation of the time series\nseparately. Instead observations for time intervals are represented as\nintervals/bins of multiple values. For these intervals information about\nthe amount of missing values are shown. This has the advantage, that also\nfor large time series a plot which is easy to overview can be created.\n\nThe only really needed parameter for this function is x (the univariate\ntime series that shall be visualized). All other parameters are solely\nfor altering the appearance of the plot.\n\nAs long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.\n\nThe plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.\n}\n\\examples{\n# Example 1: Visualize the missing values in tsNH4 time series as percentages\nggplot_na_distribution2(tsNH4)\n\n# Example 2: Visualize the missing values in tsNH4 time series as counts \nggplot_na_distribution2(tsNH4, measure = \"count\")\n\n# Example 3: Visualize the missing values in tsHeating time series\nggplot_na_distribution2(tsHeating)\n\n# Example 4: Same as example 1, just written with pipe operator\ntsNH4 \\%>\\% ggplot_na_distribution2()\n\n# Example 5: Visualize NAs in tsNH4 - exactly 8 intervals\nggplot_na_distribution2(tsNH4, number_intervals = 8)\n\n# Example 6: Visualize NAs in tsNH4 - 300 observations per interval\nggplot_na_distribution2(tsNH4, interval_size = 300)\n\n# Example 7: Visualize NAs in tsAirgap - different color for NAs\n# Plot adjustments via ggplot_na_distribution2 function parameters\nggplot_na_distribution2(tsAirgap, color_missing = \"pink\")\n\n# Example 8: Visualize NAs in tsNH4 - different theme\n# Plot adjustments via ggplot_na_distribution2 function parameters\nggplot_na_distribution2(tsNH4, theme = ggplot2::theme_classic())\n\n# Example 9: Visualize NAs in tsAirgap - title, subtitle in center\n# Plot adjustments via ggplot2 syntax\nggplot_na_distribution2(tsAirgap) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n  ggplot2::theme(plot.subtitle = ggtext::element_markdown(hjust = 0.5))\n\n# Example 10: Visualize NAs in tsAirgap - title in center, no subtitle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_distribution2(tsAirgap, subtitle = NULL) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n\n# Example 11: Visualize NAs in tsAirgap - x-axis texts with angle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_distribution2(tsAirgap, color_missing = \"grey\") +\n  ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n  \n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_distribution}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n\\code{\\link[imputeTS]{ggplot_na_imputations}}\n}\n\\author{\nSteffen Moritz, Sebastian Gatscha\n}\n"
  },
  {
    "path": "man/ggplot_na_gapsize.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot_na_gapsize.R\n\\name{ggplot_na_gapsize}\n\\alias{ggplot_na_gapsize}\n\\title{Bar Plot to Visualize Occurrences of Different NA Gap Sizes}\n\\usage{\nggplot_na_gapsize(\n  x,\n  limit = 10,\n  include_total = TRUE,\n  ranked_by = \"occurrence\",\n  color_occurrence = \"indianred\",\n  color_total = \"steelblue\",\n  color_border = \"black\",\n  alpha_bars = 1,\n  title = \"Occurrence of gap sizes\",\n  subtitle = \"Gap sizes (NAs in a row) ordered by most common\",\n  xlab = NULL,\n  ylab = \"Number occurrence\",\n  legend = TRUE,\n  orientation = \"horizontal\",\n  label_occurrence = \"Number occurrence gapsize\",\n  label_total = \"Resulting NAs for gapsize\",\n  theme = ggplot2::theme_linedraw()\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n(\\code{\\link[stats]{ts}}) object containing NAs. This is the only mandatory\nparameter - all other parameters are only needed for adjusting the plot appearance.}\n\n\\item{limit}{Specifies how many of the most common gap sizes are shown in\nthe plot.Default is 10. So only the 10 most often occurring gapsizes will\nbe shown. If more or all present gap sizes should be displayed, the limit needs\nto be increased. Since this might add a lot of additional data, having\nparameter  \\code{orientation} set to 'horizontal' avoids overlaps in the axis\nlabels.}\n\n\\item{include_total}{When set to TRUE the total NA count for a gapsize is\nincluded in the plot (total = number occurrence x gap size).\nE.g. if a gapsize of 3 occurs 10 times, this means this gap size makes\nup for 30 NAs in total. This can be a good indicator of the\noverall impact of a gapsize.}\n\n\\item{ranked_by}{Should the results be sorted according to the number of\noccurrence or total resulting NAs for a gapsize. Total resulting NAs\nare calculated by (total = number occurrence x gap size).\n\\itemize{\n\\item{\"occurrence\" - Sorting by 'number of occurrence' of a gap size}\n\n\\item{\"total\" - Sorting by 'total resulting NAs' of a gap size}\n}\n\nThe default setting is \"occurrence\".}\n\n\\item{color_occurrence}{Defines the Color for the Bars of\n'number of occurrence'.}\n\n\\item{color_total}{Defines the color for the bars of\n'total resulting NAs'.}\n\n\\item{color_border}{Defines the color for the border of the bars.}\n\n\\item{alpha_bars}{Alpha (transparency) value used for filling the bars.}\n\n\\item{title}{Title of the Plot.}\n\n\\item{subtitle}{Subtitle of the Plot.}\n\n\\item{xlab}{Label for x-Axis.}\n\n\\item{ylab}{Label for y-Axis.}\n\n\\item{legend}{If TRUE a legend is added at the bottom.}\n\n\\item{orientation}{Can be either 'vertical' or 'horizontal'. Defines\nif the bars are plotted vertically or horizontally. For large amounts\nof different gap sizes horizontal illustration is favorable (also see\nparameter \\code{limit}).}\n\n\\item{label_occurrence}{Defines the label assigned to 'number of occurrence'\nin the legend.}\n\n\\item{label_total}{Defines the label assigned to 'total resulting NAs'\nin the legend.}\n\n\\item{theme}{Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(\\code{\\link[ggplot2]{theme_linedraw})}}\n}\n\\value{\nThe output is a \\code{\\link[ggplot2]{ggplot2}} object that can be\nfurther adjusted by using the ggplot syntax\n}\n\\description{\nVisualize the Number of Occurrences for existing NA Gap Sizes\n(NAs in a row) in a Time Series\n}\n\\details{\nThis plotting function can be used to visualize the length of\nthe NA gaps (NAs in a row) in a time series. It shows a ranking of which\ngap sizes occur most often. This ranking can be ordered by the number\noccurrence of the gap sizes or by total resulting NAs for this gap size\n(occurrence * gap length). A NA-gap of 3 occurring 10 times means 30 total\nresulting NAs.\n\nA resulting plot can for example be described like this:\na 2 NA-gap (2 NAs in a row) occurred  27 times,\na 9 NA-gap (9 NAs in a row) occurred  11 times,\na 27 NA-gap (27 NAs in a row) occurred  1 times, ...\n\nThe only really needed parameter for this function is x (the univariate\ntime series with NAs that shall be visualized). All other parameters\nare solely for altering the appearance of the plot.\n\nAs long as the input is univariate and numeric, the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.\n\nThe plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.\n}\n\\examples{\n# Example 1: Visualize the top gap sizes in tsNH4 (top 10 by default)\nggplot_na_gapsize(tsNH4)\n\n# Example 2: Visualize the top gap sizes in tsAirgap - horizontal bars\nggplot_na_gapsize(tsAirgap, orientation = \"vertical\")\n\n# Example 3: Same as example 1, just written with pipe operator\ntsNH4 \\%>\\% ggplot_na_gapsize()\n\n# Example 4: Visualize the top 20 gap sizes in tsNH4\nggplot_na_gapsize(tsNH4, limit = 20)\n\n# Example 5: Visualize top gap sizes in tsNH4 without showing total NAs\nggplot_na_gapsize(tsNH4, limit = 20, include_total = FALSE)\n\n# Example 6: Visualize top gap sizes in tsNH4 but ordered by total NAs\n# (total = occurrence * gap length)\nggplot_na_gapsize(tsNH4, limit = 20, ranked_by = \"total\")\n\n# Example 7: Visualize top gap sizes in tsNH4 - different theme\n# Plot adjustments via ggplot_na_gapsize function parameters\nggplot_na_gapsize(tsNH4, theme = ggplot2::theme_classic())\n\n# Example 8: Visualize top gap sizes in tsNH4 - title, subtitle in center\n# Plot adjustments via ggplot2 syntax\nggplot_na_gapsize(tsNH4) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n  ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n\n# Example 9: Visualize top gap sizes in tsNH4 - title in center, no subtitle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_gapsize(tsNH4, subtitle = NULL) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n\n# Example 10: Top gap sizes in tsNH4 - legend on the right and color change\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_gapsize(tsNH4, color_total = \"grey\") +\n  ggplot2::theme(legend.position = \"right\")\n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_gapsize2}},\n\\code{\\link[imputeTS]{ggplot_na_distribution}},\n\\code{\\link[imputeTS]{ggplot_na_distribution2}},\n\\code{\\link[imputeTS]{ggplot_na_imputations}}\n}\n\\author{\nSteffen Moritz, Sebastian Gatscha\n}\n"
  },
  {
    "path": "man/ggplot_na_gapsize2.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot_na_gapsize2.R\n\\name{ggplot_na_gapsize2}\n\\alias{ggplot_na_gapsize2}\n\\title{Bubble Plot to Visualize Total NA Count of NA gap sizes}\n\\usage{\nggplot_na_gapsize2(\n  x,\n  colors_bubbles = c(\"#FCFBFF\", \"#EFEEFA\", \"#DDDAEF\", \"#C8C3E2\", \"#B1AAD4\", \"#9A8FC4\",\n    \"#8273B5\", \"#6B56A7\", \"#553695\", \"#3D1778\"),\n  color_border = \"black\",\n  alpha_bubbles = 0.4,\n  labels_bubbles = \"none\",\n  size_bubbles = 25,\n  min_totals = NULL,\n  min_occurrence = NULL,\n  min_gapsize = NULL,\n  max_gapsize = NULL,\n  title = \"Gap Size Analysis\",\n  subtitle = \"Total NA counts for different gapsizes\",\n  xlab = \"Gapsize\",\n  ylab = \"Number occurrence\",\n  legend = TRUE,\n  legend_breaks = 4,\n  legend_title = \"Total NAs\",\n  legend_position = \"right\",\n  legend_point_sizes = \"default\",\n  theme = ggplot2::theme_linedraw()\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link[base]{vector}}) or Time Series\n(\\code{\\link[stats]{ts}}) object containing NAs. This is the only\nmandatory parameter - all other parameters are only needed for adjusting\nthe plot appearance.}\n\n\\item{colors_bubbles}{Choose a color gradient that encodes lower to\nhigher total NA counts.\nColor codes can be given as vector. Using color palettes from  colorspace,\ngrDevices, RColorBrewer or other packages is useful here.\nE.g. grDevices::heat.colors(10) would be a possible input.}\n\n\\item{color_border}{Color for the border of the bubbles.}\n\n\\item{alpha_bubbles}{Alpha (transparency) value used for filling the bubbles.}\n\n\\item{labels_bubbles}{Should labels be added to the individual bubbles inside\nthe plot.\nFor many datasets there will be overplotting issues once labels are added.\nIn these cases using the min_gapsize, min_totals or min_occurrence options\nmight be useful to only display the most relevant gap sizes.\n\nYou can choose between these labels to be added:\n\\itemize{\n\\item{\"none\" - No label gets added to the bubbles}\n(default choice)\n\n\\item{\"gap\" - Adds a label displaying the gap size belonging to the\nrespective bubble}\n\n\\item{\"total\" - Adds a label displaying the total NA count for the\nrespective bubble}\n\n\\item{\"gap-occurrence\" - Adds a label displaying the respective\ngap size and number of its occurrence}\n}\n\nThe default setting is \"none\".}\n\n\\item{size_bubbles}{Allows to scale the size of the bubbles.\nSome experimenting with this parameter might be needed to get\na good visualization for your specific dataset.}\n\n\\item{min_totals}{Only print bubbles for gap sizes that account\nfor at least min_totals NAs in the time series.}\n\n\\item{min_occurrence}{Only print bubbles for gap sizes that occur at least\nmin_occurrence times in the time series.}\n\n\\item{min_gapsize}{Only show gap sizes larger than min_gapsize. Together with\nmax_gapsize enables zooming into in certain regions of interest.}\n\n\\item{max_gapsize}{Only show gapsizes smaller than max_gapsize. Together with\nmin_gapsize enables zooming into in certain regions of interest.}\n\n\\item{title}{Title of the Plot.}\n\n\\item{subtitle}{Subtitle of the Plot.}\n\n\\item{xlab}{Label for x-Axis.}\n\n\\item{ylab}{Label for y-Axis.}\n\n\\item{legend}{If TRUE a legend is added on the right side}\n\n\\item{legend_breaks}{Number of displayed breaks / labels in the legend.\nNeeds an integer giving the desired number of breaks as input. Breakpoints are\ninternally calculated by R's pretty() function, which can also lead to\nvalues slightly smaller or larger than the desired number.}\n\n\\item{legend_title}{Defines the title of the legend.}\n\n\\item{legend_position}{Defines position of the legend. Choose either\n'bottom', right', 'left' or 'top'.}\n\n\\item{legend_point_sizes}{Defines the size of the symbols representing the total\nNA bubbles in the legend.\n\nYou can choose between \"default\", \"actual\" or a custom vector of sizes.\n\n\\itemize{\n\\item{\"default\" - Scales the points in the legend to symbolically\nresemble the size differences} (default choice)\n\n\\item{\"actual\" - Scales the points in the legend according\nto their actual size in the plot}\n}\n\nSince these two options are not be always sufficient, a custom vector of\nsizes can be used as input. This would look like this: c(4,5,6,7). Be\naware, that the length of this vector must match the number of breakpoints\n(can be adjusted with legend_breaks).}\n\n\\item{theme}{Set a theme for ggplot2. Default is ggplot2::theme_linedraw().\n(\\code{\\link[ggplot2]{theme_linedraw})}}\n}\n\\value{\nThe output is a \\code{\\link[ggplot2]{ggplot2}} object that can be\nfurther adjusted by using the ggplot syntax\n}\n\\description{\nVisualize the total NA count (gap size * occurrence) for\nthe existing gaps sizes (NAs in a row).\n}\n\\details{\nThis function visualizes total NA counts by individual gap size\n(consecutive NAs) in a time series. The bubble plot makes it easy to see\nwhich gap sizes account for most of the NAs in the series. The size and\ncolor of the bubbles represent the total number of NAs a given gap size\naccounts for.\n\nTotal NAs for a gap size are calculated as follows:\ntotal NAs = occurrence * gap length\n\nFor example, interpret a bubble for gap size 2 as follows:\na 2-NA gap (two NAs in a row) occurred 27 times in the time series and thus\naccounts for 54 total NAs.\n\nOn the x-axis, the different gap sizes are plotted in increasing order.\nThe y-axis shows the occurrence count of these gap sizes in the time series.\n\nThe plot is useful for investigating possible root causes of the missing\ndata. It can indicate whether the missing data are random or whether there\nare patterns of interest.\n\nDepending on the input time series, there might be too much information in\nthe plot, leading to overplotting. In these cases, use the parameters\n\\code{min_totals}, \\code{min_occurrence}, and \\code{min_gapsize} to display\nonly the information of interest.\n\nThe only required parameter is \\code{x} (the univariate time series with NAs\nto visualize). All other parameters alter the appearance of the plot.\n\nAs long as the input is univariate and numeric, the function also accepts\n\\code{data.frame}, \\code{tibble}, \\code{tsibble}, \\code{zoo}, or \\code{xts}\ninput.\n\nThe plot can be adjusted via function parameters. For more complex\nadjustments, you can modify the result using ggplot2 syntax, since the\nfunction returns a ggplot2 object. See the Examples for typical adjustments.\n}\n\\examples{\n# Example 1: Visualize total NA counts in tsNH4\nggplot_na_gapsize2(tsNH4)\n\n# Example 2: Visualize total NA counts in tsNH4, different color gradient\nggplot_na_gapsize2(tsNH4, colors_bubbles = rev(grDevices::heat.colors(10)))\n\n# Example 3: Same as example 1, just written with pipe operator\ntsNH4 \\%>\\% ggplot_na_gapsize2()\n\n# Example 4: Visualize total NA counts in tsHeating\n# Limited to gap sizes that account for a total of > 600 NAs\nggplot_na_gapsize2(tsHeating, min_totals = 600)\n\n# Example 5: Visualize total NA counts in tsNH4 - no legend\nggplot_na_gapsize2(tsNH4, legend = FALSE)\n\n# Example 6: Visualize total NA counts in tsAirgap - increased bubble size\nggplot_na_gapsize2(tsAirgap, size_bubbles = 35)\n\n# Example 7: Visualize total NA counts in tsNH4\n# Plot adjustments via ggplot_na_gapsize2 function parameters\nggplot_na_gapsize2(tsNH4, theme = ggplot2::theme_classic())\n\n# Example 8: Visualize total NA counts in tsNH4 - title, subtitle in center\n# Plot adjustments via ggplot2 syntax\nggplot_na_gapsize2(tsNH4) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n  ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))\n\n# Example 9: Visualize total NA counts in tsNH4 - title in center, no subtitle\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_gapsize2(tsNH4, subtitle = NULL) +\n  ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n\n# Example 10: Total NA counts in tsNH4 - legend on the bottom and color change\n# Plot adjustments via ggplot2 syntax and function parameters\nggplot_na_gapsize2(tsNH4, colors_bubbles = grDevices::heat.colors(10)) +\n  ggplot2::theme(legend.position = \"bottom\")\n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_distribution}},\n\\code{\\link[imputeTS]{ggplot_na_distribution2}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize}},\n\\code{\\link[imputeTS]{ggplot_na_imputations}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/ggplot_na_imputations.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot_na_imputations.R\n\\name{ggplot_na_imputations}\n\\alias{ggplot_na_imputations}\n\\title{Line Plot to Visualize Imputed Values}\n\\usage{\nggplot_na_imputations(\n  x_with_na,\n  x_with_imputations,\n  x_with_truth = NULL,\n  x_axis_labels = NULL,\n  title = \"Imputed Values\",\n  subtitle = \"Visualization of missing value replacements\",\n  xlab = \"Time\",\n  ylab = \"Value\",\n  color_points = \"steelblue\",\n  color_imputations = \"indianred\",\n  color_truth = \"seagreen3\",\n  color_lines = \"lightslategray\",\n  shape_points = 16,\n  shape_imputations = 18,\n  shape_truth = 16,\n  size_points = 1.5,\n  size_imputations = 2.5,\n  size_truth = 1.5,\n  width_lines = 0.5,\n  linetype = \"solid\",\n  connect_na = TRUE,\n  legend = TRUE,\n  legend_size = 5,\n  label_known = \"known values\",\n  label_imputations = \"imputed values\",\n  label_truth = \"ground truth\",\n  theme = ggplot2::theme_linedraw()\n)\n}\n\\arguments{\n\\item{x_with_na}{Numeric Vector or Time Series (\\code{\\link{ts}}) object\nwith NAs before imputation. This parameter and x_with_imputation shave to\nbe set. The rest of the parameters are mostly needed for adjusting the plot\nappearance.}\n\n\\item{x_with_imputations}{Numeric Vector or Time Series (\\code{\\link{ts}})\nobject with NAs replaced by imputed values. This parameter and\nx_with_imputation shave to be set.The rest of the parameters are mostly\nneeded for adjusting the plot appearance.}\n\n\\item{x_with_truth}{Numeric Vector or Time Series (\\code{\\link{ts}}) object\nwith the real values (optional parameter). If the ground truth is known\n(e.g. in experiments where the missing values were artificially added)\nit can be displayed in the plot with this parameter.\nDefault is NULL (ground truth not known).}\n\n\\item{x_axis_labels}{For adding specific x-axis labels. Takes a vector of\n\\code{\\link[base]{Date}} or \\code{\\link[base]{POSIXct}} objects as an input\n(needs the same length as x_with_na).\nThe Default (NULL) uses the observation numbers as x-axis tick labels.}\n\n\\item{title}{Title of the Plot.}\n\n\\item{subtitle}{Subtitle of the Plot.}\n\n\\item{xlab}{Label for x-Axis.}\n\n\\item{ylab}{Label for y-Axis.}\n\n\\item{color_points}{Color for the Symbols/Points of the non-NA Observations.}\n\n\\item{color_imputations}{Color for the Symbols/Points of the Imputed Values.}\n\n\\item{color_truth}{Color for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).}\n\n\\item{color_lines}{Color for the Lines connecting the Observations/Points.}\n\n\\item{shape_points}{Shape for the Symbols/Points of the non-NA observations.\nSee https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.}\n\n\\item{shape_imputations}{Shape for the Symbols/Points of the imputed values.\nSee https://ggplot2.tidyverse.org/articles/ggplot2-specs.html as reference.}\n\n\\item{shape_truth}{Shape for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).}\n\n\\item{size_points}{Size for the Symbols/Points of the non-NA Observations.}\n\n\\item{size_imputations}{Size for the Symbols/Points of the Imputed Values.}\n\n\\item{size_truth}{Size for the Symbols/Points of the NA value Ground Truth\n(only relevant when x_with_truth available).}\n\n\\item{width_lines}{Width for the Lines connecting the Observations/Points.}\n\n\\item{linetype}{Linetype for the Lines connecting the Observations/Points.}\n\n\\item{connect_na}{If TRUE the Imputations are connected\nto the non-NA observations in the plot. Otherwise there are no\nconnecting lines between symbols in NA areas.}\n\n\\item{legend}{If TRUE a Legend is added at the bottom.}\n\n\\item{legend_size}{Size of the Symbols used in the Legend.}\n\n\\item{label_known}{Legend label for the non-NA Observations.}\n\n\\item{label_imputations}{Legend label for the Imputed Values.}\n\n\\item{label_truth}{Legend label for the Ground Truth of the NA values.}\n\n\\item{theme}{Set a Theme for ggplot2. Default is ggplot2::theme_linedraw().\n(\\code{\\link[ggplot2]{theme_linedraw})}}\n}\n\\description{\nVisualize the imputed values in a time series.\n}\n\\details{\nThis plot can be used, to visualize imputed values for a time\nseries. Imputed values (filled NA gaps) are shown in a different color\nthan the other values. If real values (ground truth) for the NA gaps are known,\nthey can be optionally added in a different color.\n\nThe only really needed parameters for this function are x_with_na\n(the time series with NAs before imputation) and x_with_imputations\n(the time series without NAs after imputation). All other parameters\nare msotly for altering the appearance of the plot.\n\nAs long as the input is univariate and numeric the function also takes\ndata.frame, tibble, tsibble, zoo, xts as an input.\n\nThe plot can be adjusted to your needs via the function parameters.\nAdditionally, for more complex adjustments, the output can also be\nadjusted via ggplot2 syntax. This is possible, since the output\nof the function is a ggplot2 object. Also take a look at the Examples\nto see how adjustments are made.\n}\n\\examples{\n# Example 1: Visualize imputation by na_mean\nimp_mean <- na_mean(tsAirgap)\nggplot_na_imputations(tsAirgap, imp_mean)\n\n\n# Example 2: Visualize imputation by na_locf and added ground truth \nimp_locf <- na_locf(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap, \n                      x_with_imputations = imp_locf,\n                      x_with_truth = tsAirgapComplete\n                      )\n\n\n# Example 3: Visualize imputation by na_kalman\nimp_kalman <- na_kalman(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap, x_with_imputations = imp_kalman)\n\n\n# Example 4: Same as example 1, just written with pipe operator\ntsAirgap \\%>\\%\n  na_mean() \\%>\\%\n  ggplot_na_imputations(x_with_na = tsAirgap)\n  \n\n# Example 5: Visualize imputation by na_seadec - different color for imputed points\n# Plot adjustments via ggplot_na_imputations function parameters\nimp_seadec <- na_seadec(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap, \n                      x_with_imputations = imp_seadec,\n                      color_imputations = \"gold\")\n\n\n# Example 6: Visualize imputation - different theme, point size imputations\n# Plot adjustments via ggplot_na_imputations function parameters\nimp_seadec <- na_seadec(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap, \n                      x_with_imputations = imp_seadec,\n                      theme = ggplot2::theme_classic(),\n                      size_imputations = 5)\n\n                 \n# Example 7: Visualize imputation - title, subtitle in center\n# Plot adjustments via ggplot2 syntax\nimp_seadec <- na_seadec(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap,  x_with_imputations = imp_seadec) + \n    ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n    ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5))   \n\n\n# Example 8: Visualize imputation - title in center, no subtitle\n# Plot adjustments via ggplot2 syntax and function parameters\nimp_mean <- na_mean(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap,  \n                      x_with_imputations = imp_mean,\n                      subtitle = NULL) +\n     ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5))\n  \n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_distribution}},\n\\code{\\link[imputeTS]{ggplot_na_distribution2}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize2}}\n}\n\\author{\nSteffen Moritz, Sebastian Gatscha\n}\n"
  },
  {
    "path": "man/ggplot_na_intervals.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{ggplot_na_intervals}\n\\alias{ggplot_na_intervals}\n\\title{Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution2}} instead.}\n\\usage{\nggplot_na_intervals(x, ...)\n}\n\\description{\nplotNA.distributionBar was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution2}}.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/imputeTS-package.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/imputeTS-package.R\n\\docType{package}\n\\name{imputeTS-package}\n\\alias{imputeTS}\n\\alias{imputeTS-package}\n\\title{imputeTS: Time Series Missing Value Imputation}\n\\description{\n\\if{html}{\\figure{logo.png}{options: style='float: right' alt='logo' width='120'}}\n\nImputation (replacement) of missing values in univariate time series. Offers several imputation functions and missing data plots. Available imputation algorithms include: 'Mean', 'LOCF', 'Interpolation', 'Moving Average', 'Seasonal Decomposition', 'Kalman Smoothing on Structural Time Series models', 'Kalman Smoothing on ARIMA models'. Published in Moritz and Bartz-Beielstein (2017) \\doi{10.32614/RJ-2017-009}.\n\nThe imputeTS package is a collection of algorithms and tools for univariate time series imputation.\n}\n\\details{\nThe imputeTS package specializes on (univariate) time series imputation.\nIt offers several different imputation algorithm implementations. Beyond the imputation algorithms\nthe package also provides plotting and printing functions of missing data statistics.\n\nThe package is easy to use:\n\\itemize{\n\\item To impute (fill all missing values) in a time series \\code{x}, run:\\cr\n\\code{na_interpolation(x)} \\cr\n\\item To plot missing data statistics for a time series \\code{x}, run:\\cr\n\\code{ggplot_na_distribution(x)}\\cr\n\\item To print missing data statistics for a time series \\code{x}, run:\\cr\n\\code{statsNA(x)}\\cr\n}\n\nEvery other imputation function (starting with na_'algorithm name') and plotting\nfunction (starting with plotNA_'plot name') work the same way as in this example.\n}\n\\references{\nMoritz, Steffen, and Thomas Bartz-Beielstein. \"imputeTS: Time Series Missing Value Imputation in R.\" R Journal 9.1 (2017). doi:10.32614/RJ-2017-009.\n}\n\\seealso{\nUseful links:\n\\itemize{\n  \\item \\url{https://github.com/SteffenMoritz/imputeTS}\n  \\item \\url{https://steffenmoritz.github.io/imputeTS/}\n  \\item Report bugs at \\url{https://github.com/SteffenMoritz/imputeTS/issues}\n}\n\n}\n\\author{\n\\strong{Maintainer}: Steffen Moritz \\email{steffen.moritz10@gmail.com} (\\href{https://orcid.org/0000-0002-0085-1804}{ORCID}) [copyright holder]\n\nAuthors:\n\\itemize{\n  \\item Sebastian Gatscha \\email{sebastian_gatscha@gmx.at}\n}\n\nOther contributors:\n\\itemize{\n  \\item Earo Wang \\email{earo.wang@gmail.com} (\\href{https://orcid.org/0000-0001-6448-5260}{ORCID}) [contributor]\n  \\item Ron Hause \\email{ronaldhause@gmail.com} (\\href{https://orcid.org/0000-0002-5229-7366}{ORCID}) [contributor]\n}\n\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.interpolation.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.interpolation}\n\\alias{na.interpolation}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_interpolation}} instead.}\n\\usage{\nna.interpolation(x, option = \"linear\", maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"linear\" - for linear interpolation using \\link{approx} } (default choice)\n\\item{\"spline\" - for spline interpolation using \\link{spline}}\n\\item{\"stine\" - for Stineman interpolation using \\link[stinepack]{stinterp}}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters to be passed through to \\link{approx} or\n\\link{spline} interpolation functions}\n}\n\\description{\nna.interpolation is replaced by \\code{\\link[imputeTS]{na_interpolation}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.kalman.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.kalman}\n\\alias{na.kalman}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_kalman}} instead.}\n\\usage{\nna.kalman(x, model = \"StructTS\", smooth = TRUE, nit = -1, maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{model}{Model to be used. With this parameter the State Space Model\n(on which KalmanSmooth is performed) can be chosen. Accepts the following input:\n\n\\itemize{\n\n\\item{\"StructTS\" - For using a structural model fitted by maximum\nlikelihood (using \\link[stats]{StructTS}) } (default choice)\n\n\\item{\"auto.arima\" - For using the state space representation of\narima model (using \\link[forecast]{auto.arima})}\n\n}\n\nFor both auto.arima and StructTS additional parameters for model building can\nbe given with the \\dots parameter\n\nAdditionally it is also possible to use a user created state space model\n(See code Example 5). This state space model could for example be\nobtained from another R package for structural time series modeling.\nFurthermore providing the state space representation of a arima model\nfrom \\link[stats]{arima} is also possible. But it is important to note,\nthat user created state space models must meet the requirements specified\nunder \\link[stats]{KalmanLike}. This means the user supplied state space\nmodel has to be in form of a list with at least components T, Z, h , V, a, P, Pn.\n(more details under \\link[stats]{KalmanLike})}\n\n\\item{smooth}{if \\code{TRUE} - \\code{\\link[stats]{KalmanSmooth}} is used for\nestimation, if \\code{FALSE} - \\code{\\link[stats]{KalmanRun}} is used.\nSince KalmanRun is often considered extrapolation KalmanSmooth is usually\nthe better choice for imputation.}\n\n\\item{nit}{Parameter from Kalman Filtering (see \\link[stats]{KalmanLike}).\nUsually no need to change from default.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters to be passed through to the functions that\nbuild the State Space Models (\\link[stats]{StructTS} or \\link[forecast]{auto.arima}).}\n}\n\\description{\nna.kalman is replaced by \\code{\\link[imputeTS]{na_kalman}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.locf.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.locf}\n\\alias{na.locf}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_locf}} instead.}\n\\usage{\nna.locf(x, option = \"locf\", na.remaining = \"rev\", maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"locf\" - for Last Observation Carried Forward} (default choice)\n\\item{\"nocb\" - for Next Observation Carried Backward}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\description{\nna.locf is replaced by \\code{\\link[imputeTS]{na_locf}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.ma.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.ma}\n\\alias{na.ma}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_ma}} instead.}\n\\usage{\nna.ma(x, k = 4, weighting = \"exponential\", maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{k}{integer width of the moving average window. Expands to both sides\nof the center element e.g. k=2 means 4 observations (2 left, 2 right) are\ntaken into account. If all observations in the current window are NA, the\nwindow size is automatically increased until there are at least 2 non-NA\nvalues present.}\n\n\\item{weighting}{Weighting to be used. Accepts the following input:\n\\itemize{\n\\item{\"simple\" - Simple Moving Average (SMA)}\n\\item{\"linear\" - Linear Weighted Moving Average (LWMA)}\n\\item{\"exponential\" - Exponential Weighted Moving Average (EWMA)} (default choice)\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\description{\nna.ma is replaced by \\code{\\link[imputeTS]{na_ma}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.mean.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.mean}\n\\alias{na.mean}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_mean}} instead.}\n\\usage{\nna.mean(x, option = \"mean\", maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"mean\" - take the mean for imputation (default choice)}\n\\item{\"median\" - take the median for imputation}\n\\item{\"mode\" - take the mode for imputation}\n\\item{\"harmonic\" - take the harmonic mean}\n\\item{\"geometric\" - take the geometric mean}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\description{\nna.mean is replaced by \\code{\\link[imputeTS]{na_mean}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.random.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.random}\n\\alias{na.random}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_random}} instead.}\n\\usage{\nna.random(x, lower_bound = NULL, upper_bound = NULL, maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{lower_bound}{Lower bound for the random samples.\nIf nothing or NULL is set min(x) will be used.}\n\n\\item{upper_bound}{Upper bound for the random samples.\nIf nothing or NULL is set man(x) will be used.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\description{\nna.random is replaced by \\code{\\link[imputeTS]{na_random}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.remove.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.remove}\n\\alias{na.remove}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_remove}} instead.}\n\\usage{\nna.remove(x, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n}\n\\description{\nna.remove is replaced by \\code{\\link[imputeTS]{na_remove}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.replace.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.replace}\n\\alias{na.replace}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_replace}} instead.}\n\\usage{\nna.replace(x, fill = 0, maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{fill}{Value used to replace the missing values}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\description{\nna.replace is replaced by \\code{\\link[imputeTS]{na_replace}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.seadec.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.seadec}\n\\alias{na.seadec}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_seadec}} instead.}\n\\usage{\nna.seadec(\n  x,\n  algorithm = \"interpolation\",\n  find_frequency = FALSE,\n  maxgap = Inf,\n  ...\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{algorithm}{Algorithm to be used after decomposition.\nAccepts the following input:\n\\itemize{\n\\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n\\item{\"locf\" - Imputation by Last Observation Carried Forward}\n\\item{\"mean\" - Imputation by Mean Value}\n\\item{\"random\" - Imputation by Random Sample}\n\\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n\\item{\"ma\" - Imputation by Weighted Moving Average}\n}}\n\n\\item{find_frequency}{If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters for these algorithms that can be passed\nthrough. Look at \\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n\\code{\\link[imputeTS]{na_mean}} for parameter options.}\n}\n\\description{\nna.seadec is replaced by \\code{\\link[imputeTS]{na_seadec}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na.seasplit.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{na.seasplit}\n\\alias{na.seasplit}\n\\title{Deprecated use \\code{\\link[imputeTS]{na_seasplit}} instead.}\n\\usage{\nna.seasplit(\n  x,\n  algorithm = \"interpolation\",\n  find_frequency = FALSE,\n  maxgap = Inf,\n  ...\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{algorithm}{Algorithm to be used after splits.\nAccepts the following input:\n\\itemize{\n\\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n\\item{\"locf\" - Imputation by Last Observation Carried Forward}\n\\item{\"mean\" - Imputation by Mean Value}\n\\item{\"random\" - Imputation by Random Sample}\n\\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n\\item{\"ma\" - Imputation by Weighted Moving Average}\n}}\n\n\\item{find_frequency}{If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters for these algorithms that can be\npassed through. Look at \\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n\\code{\\link[imputeTS]{na_mean}} for parameter options.}\n}\n\\description{\nna.seasplit is replaced by \\code{\\link[imputeTS]{na_seasplit}}.\nThe functionality stays the same. The new name better fits modern R code\nstyle guidelines (which prefer _ over . in function names).\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/na_interpolation.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_interpolation.R\n\\name{na_interpolation}\n\\alias{na_interpolation}\n\\title{Missing Value Imputation by Interpolation}\n\\usage{\nna_interpolation(x, option = \"linear\", maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"linear\" - for linear interpolation using \\link{approx} } (default choice)\n\\item{\"spline\" - for spline interpolation using \\link{spline}}\n\\item{\"stine\" - for Stineman interpolation using \\link[stinepack]{stinterp}}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters to be passed through to \\link{approx} or\n\\link{spline} interpolation functions}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nUses either linear, spline or stineman interpolation\nto replace missing values.\n}\n\\details{\nMissing values get replaced by values of \\link{approx}, \\link{spline}\nor \\link[stinepack]{stinterp} interpolation.\n\nThe na_interpolation function also supports the use of additional parameters from the respective\nunderlying interpolation functions. While usually not really needed, it is useful to know that\nthis advanced use is in principle possible. These additional parameters are not specified explicitly\nin the na_interpolation function documentation. Take a look into the documentation of the \\link[stinepack]{stinterp}, \\link{approx} and \\link{spline} functions to get an overview about these additional parameters.\n\nAn example for such a parameter is the 'method' argument of spline, which can be used to\nfurther specify the type of spline to be used. Possible values are \"fmm\", \"natural\",\n\"periodic\", \"monoH.FC\" and \"hyman\" (as can be seen in the \\link{spline}\ndocumentation). The respective function call using this additional parameter would\nlook like this:\n\\code{na_interpolation(x, option =\"spline\", method =\"natural\")}\n\nLike in this example other additional detail parameters (gained from \\link{approx},\n\\link{spline}, \\link[stinepack]{stinterp} documentation) can be used by just including\nthem in the na_interpolation function call. As already mentioned, these advanced possibilities\nfor settings parameters are only helpful for specific use cases. For regular use\nthe standard parameters provided directly in the na_interpolation documentation should be\nmore than enough.\n}\n\\examples{\n# Prerequisite: Create Time series with missing values\nx <- ts(c(2, 3, 4, 5, 6, NA, 7, 8))\n\n# Example 1: Perform linear interpolation\nna_interpolation(x)\n\n# Example 2: Perform spline interpolation\nna_interpolation(x, option = \"spline\")\n\n# Example 3: Perform stine interpolation\nna_interpolation(x, option = \"stine\")\n\n# Example 4: Perform linear interpolation, with additional parameter pass through from spline()\n# Take a look at the 'Details' section of the na_interpolation documentation \n# for more information about advanced parameter pass through options\nna_interpolation(x, option =\"spline\", method =\"natural\")\n\n# Example 5: Same as example 1, just written with pipe operator\nx \\%>\\% na_interpolation()\n\n# Example 6: Same as example 2, just written with pipe operator\nx \\%>\\% na_interpolation(option = \"spline\")\n}\n\\references{\nJohannesson, Tomas, et al. (2015). \"Package stinepack\".\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz, Ron Hause\n}\n"
  },
  {
    "path": "man/na_kalman.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_kalman.R\n\\name{na_kalman}\n\\alias{na_kalman}\n\\title{Missing Value Imputation by Kalman Smoothing and State Space Models}\n\\usage{\nna_kalman(x, model = \"StructTS\", smooth = TRUE, nit = -1, maxgap = Inf, ...)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{model}{Model to be used. With this parameter the State Space Model\n(on which KalmanSmooth is performed) can be chosen. Accepts the following input:\n\n\\itemize{\n\n\\item{\"StructTS\" - For using a structural model fitted by maximum\nlikelihood (using \\link[stats]{StructTS}) } (default choice)\n\n\\item{\"auto.arima\" - For using the state space representation of\narima model (using \\link[forecast]{auto.arima})}\n\n}\n\nFor both auto.arima and StructTS additional parameters for model building can\nbe given with the \\dots parameter\n\nAdditionally it is also possible to use a user created state space model\n(See code Example 5). This state space model could for example be\nobtained from another R package for structural time series modeling.\nFurthermore providing the state space representation of a arima model\nfrom \\link[stats]{arima} is also possible. But it is important to note,\nthat user created state space models must meet the requirements specified\nunder \\link[stats]{KalmanLike}. This means the user supplied state space\nmodel has to be in form of a list with at least components T, Z, h , V, a, P, Pn.\n(more details under \\link[stats]{KalmanLike})}\n\n\\item{smooth}{if \\code{TRUE} - \\code{\\link[stats]{KalmanSmooth}} is used for\nestimation, if \\code{FALSE} - \\code{\\link[stats]{KalmanRun}} is used.\nSince KalmanRun is often considered extrapolation KalmanSmooth is usually\nthe better choice for imputation.}\n\n\\item{nit}{Parameter from Kalman Filtering (see \\link[stats]{KalmanLike}).\nUsually no need to change from default.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters to be passed through to the functions that\nbuild the State Space Models (\\link[stats]{StructTS} or \\link[forecast]{auto.arima}).}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nUses Kalman Smoothing on structural time series models\n(or on the state space representation of an arima model) for imputation.\n}\n\\details{\nThe KalmanSmoother used in this function is \\code{\\link[stats]{KalmanSmooth}}.\nIt operates either on a \\code{Basic Structural Model} obtained by\n\\code{\\link[stats]{StructTS}} or the state space representation of a ARMA model\nobtained by \\code{\\link[forecast]{auto.arima}}.\n\nFor an detailed explanation of Kalman Filtering and Space Space Models the\nfollowing literature is a good starting point:\n\\itemize{\n\\item{\\cite{G. Welch, G. Bishop, An Introduction to the Kalman Filter. SIGGRAPH 2001 Course 8, 1995}}\n\\item{\\cite{Harvey, Andrew C. Forecasting, structural time series models and the Kalman filter. Cambridge university press, 1990} }\n\\item{\\cite{Grewal, Mohinder S. Kalman filtering. Springer Berlin Heidelberg, 2011}}\n}\n}\n\\examples{\n# Example 1: Perform imputation with KalmanSmoother and state space representation of arima model\nna_kalman(tsAirgap)\n\n# Example 2: Perform imputation with KalmanRun and state space representation of arima model\nna_kalman(tsAirgap, smooth = FALSE)\n\n# Example 3: Perform imputation with KalmanSmooth and StructTS model\nna_kalman(tsAirgap, model = \"StructTS\", smooth = TRUE)\n\n# Example 4: Perform imputation with KalmanSmooth and StructTS model with additional parameters\nna_kalman(tsAirgap, model = \"StructTS\", smooth = TRUE, type = \"trend\")\n\n# Example 5:  Perform imputation with KalmanSmooth and user created model\nusermodel <- arima(tsAirgap, order = c(1, 0, 1))$model\nna_kalman(tsAirgap, model = usermodel)\n\n# Example 6: Same as example 1, just written with pipe operator\ntsAirgap \\%>\\% na_kalman()\n}\n\\references{\nHyndman RJ and Khandakar Y (2008). \"Automatic time series forecasting: the forecast package for R\". Journal of Statistical Software, 26(3).\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_locf.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_locf.R\n\\name{na_locf}\n\\alias{na_locf}\n\\title{Missing Value Imputation by Last Observation Carried Forward}\n\\usage{\nna_locf(x, option = \"locf\", na_remaining = \"rev\", maxgap = Inf)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"locf\" - for Last Observation Carried Forward} (default choice)\n\\item{\"nocb\" - for Next Observation Carried Backward}\n}}\n\n\\item{na_remaining}{Method to be used for remaining NAs.\n\\itemize{\n\\item{\"rev\" - to perform nocb / locf from the reverse direction} (default choice)\n\\item{\"keep\" - to return the series with NAs}\n\\item{\"rm\" - to remove remaining NAs}\n\\item{\"mean\" - to replace remaining NAs by overall mean}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nReplaces each missing value with the most recent present value\nprior to it (Last Observation Carried Forward- LOCF). Optionally this can\nalso be done starting from the back of the series (Next Observation Carried\nBackward - NOCB).\n}\n\\details{\n\\subsection{General Functionality}{\n\nReplaces each missing value with the most recent present value\nprior to it (Last Observation Carried Forward - LOCF). This can also be\ndone in reverse direction, starting from the end of the series (then\ncalled Next Observation Carried Backward - NOCB).\n}\n\n\\subsection{Handling for NAs at the beginning of the series}{\n\nIn case one or more successive observations directly at the start of the\ntime series are NA, there exists no 'last value' yet, that can be carried\nforward. Thus, no LOCF imputation can be performed for these NAs. As soon\nas the first non-NA value appears, LOCF can be performed as expected. The\nsame applies to NOCB, but from the opposite direction.\n\nWhile this problem might appear seldom and will only affect a very small\namount of values at the beginning, it is something to consider.\nThe \\code{na_remaining} parameter helps to define, what should happen\nwith these values at the start, that would remain NA after pure LOCF.\n\nDefault setting is \\code{na_remaining = \"rev\"}, which performs\nnocb / locf from the other direction to fill these NAs. So a NA\nat the beginning will be filled with the next non-NA value appearing\nin the series.\n\nWith \\code{na_remaining = \"keep\"} NAs at the beginning (that can not\nbe imputed with pure LOCF) are just left as remaining NAs.\n\nWith \\code{na_remaining = \"rm\"} NAs at the beginning of the series are\ncompletely removed. Thus, the time series is basically shortened.\n\nAlso available is \\code{na_remaining = \"mean\"}, which uses the overall\nmean of the time series to replace these remaining NAs. (but beware,\nmean is usually not a good imputation choice - even if it  only affects\nthe values at the beginning)\n}\n}\n\\examples{\n# Prerequisite: Create Time series with missing values\nx <- ts(c(NA, 3, 4, 5, 6, NA, 7, 8))\n\n# Example 1: Perform LOCF\nna_locf(x)\n\n# Example 2: Perform NOCF\nna_locf(x, option = \"nocb\")\n\n# Example 3: Perform LOCF and remove remaining NAs\nna_locf(x, na_remaining = \"rm\")\n\n# Example 4: Same as example 1, just written with pipe operator\nx \\%>\\% na_locf()\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_ma.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_ma.R\n\\name{na_ma}\n\\alias{na_ma}\n\\title{Missing Value Imputation by Weighted Moving Average}\n\\usage{\nna_ma(x, k = 4, weighting = \"exponential\", maxgap = Inf)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{k}{integer width of the moving average window. Expands to both sides\nof the center element e.g. k=2 means 4 observations (2 left, 2 right) are\ntaken into account. If all observations in the current window are NA, the\nwindow size is automatically increased until there are at least 2 non-NA\nvalues present.}\n\n\\item{weighting}{Weighting to be used. Accepts the following input:\n\\itemize{\n\\item{\"simple\" - Simple Moving Average (SMA)}\n\\item{\"linear\" - Linear Weighted Moving Average (LWMA)}\n\\item{\"exponential\" - Exponential Weighted Moving Average (EWMA)} (default choice)\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nMissing value replacement by weighted moving average.\nUses semi-adaptive window size to ensure all NAs are replaced.\n}\n\\details{\nIn this function missing values get replaced by moving average\nvalues. Moving Averages are also sometimes referred to as \"moving mean\",\n\"rolling mean\", \"rolling average\" or \"running average\".\n\nThe mean in this implementation taken from an equal number of observations\non either side of a central value. This means for an NA value at position\n\\code{i} of a time series, the observations i-1,i+1 and i+1, i+2 (assuming\na window size of k=2) are used to calculate the mean.\n\nSince it can in case of long NA gaps also occur, that all values next to the\ncentral value are also NA, the algorithm has a semi-adaptive window size.\nWhenever there are less than 2 non-NA values in the complete window available,\nthe window size is incrementally increased, till at least 2 non-NA values are\nthere. In all other cases the algorithm sticks to the pre-set window size.\n\nThere are options for using Simple Moving Average (SMA), Linear Weighted\nMoving Average (LWMA) and Exponential Weighted Moving Average (EWMA).\n\nSMA: all observations in the window are equally weighted for calculating the mean.\n\nLWMA: weights decrease in arithmetical progression. The observations\ndirectly next to a central value i, have weight 1/2, the observations\none further away (i-2,i+2) have weight 1/3, the next (i-3,i+3) have\nweight 1/4, ...\n\nEWMA: uses weighting factors which decrease exponentially. The observations\ndirectly next to a central value i, have weight 1/2^1, the observations one\nfurther away (i-2,i+2) have weight 1/2^2, the next (i-3,i+3) have weight 1/2^3, ...\n}\n\\examples{\n# Example 1: Perform imputation with simple moving average\nna_ma(tsAirgap, weighting = \"simple\")\n\n# Example 2: Perform imputation with exponential weighted moving average\nna_ma(tsAirgap)\n\n# Example 3: Perform imputation with exponential weighted moving average, window size 6\nna_ma(tsAirgap, k = 6)\n\n# Example 4: Same as example 1, just written with pipe operator\ntsAirgap \\%>\\% na_ma(weighting = \"simple\")\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_mean.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_mean.R\n\\name{na_mean}\n\\alias{na_mean}\n\\title{Missing Value Imputation by Mean Value}\n\\usage{\nna_mean(x, option = \"mean\", maxgap = Inf)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{option}{Algorithm to be used. Accepts the following input:\n\\itemize{\n\\item{\"mean\" - take the mean for imputation (default choice)}\n\\item{\"median\" - take the median for imputation}\n\\item{\"mode\" - take the mode for imputation}\n\\item{\"harmonic\" - take the harmonic mean}\n\\item{\"geometric\" - take the geometric mean}\n}}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nMissing value replacement by mean values. Different means\nlike median, mean, mode possible.\n}\n\\details{\nMissing values get replaced by overall mean values. The function\ncalculates the mean, median, mode, harmonic or geometric mean over all the non-NA\nvalues and replaces all NAs with this value. Option 'mode' replaces NAs with\nthe most frequent value in the time series. If two or more values occur equally frequent,\nthe function imputes the lower value. Due to their calculation formula geometric and harmonic\nmean are not well defined for negative values or zero values in the input series.\n\nIn general using the mean for imputation imputation is mostly a suboptimal choice and should\nbe handled with great caution.\n}\n\\examples{\n# Prerequisite: Create Time series with missing values\nx <- ts(c(2, 3, 4, 5, 6, NA, 7, 8))\n\n# Example 1: Perform imputation with the overall mean\nna_mean(x)\n\n# Example 2: Perform imputation with overall median\nna_mean(x, option = \"median\")\n\n# Example 3: Same as example 1, just written with pipe operator\nx \\%>\\% na_mean()\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_random.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_random.R\n\\name{na_random}\n\\alias{na_random}\n\\title{Missing Value Imputation by Random Sample}\n\\usage{\nna_random(x, lower_bound = NULL, upper_bound = NULL, maxgap = Inf)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{lower_bound}{Lower bound for the random samples.\nIf nothing or NULL is set min(x) will be used.}\n\n\\item{upper_bound}{Upper bound for the random samples.\nIf nothing or NULL is set man(x) will be used.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nReplaces each missing value by drawing a random sample\nbetween two given bounds.\n}\n\\details{\nReplaces each missing value by drawing a random sample between two\ngiven bounds. The default bounds are the minimum and the maximum value in\nthe non-NAs from the time series. Function uses \\link{runif} function to get\nthe random values.\n}\n\\examples{\n# Prerequisite: Create Time series with missing values\nx <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n\n# Example 1: Replace all NAs by random values that are between min and max of the input time series\nna_random(x)\n\n# Example 2: Replace all NAs by random values between 1 and 10\nna_random(x, lower_bound = 1, upper_bound = 10)\n\n# Example 3: Same as example 1, just written with pipe operator\nx \\%>\\% na_random()\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_remove.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_remove.R\n\\name{na_remove}\n\\alias{na_remove}\n\\title{Remove Missing Values}\n\\usage{\nna_remove(x)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n}\n\\value{\nVector (\\code{\\link{vector}})\n}\n\\description{\nRemoves all missing values from a time series.\n}\n\\details{\nRemoves all missing values from a input time series. This shortens\nthe time series by the number of missing values in the series. Should be\nhandled with care, because this can affect the seasonality of the time\nseries. Seasonal patterns might be destroyed. Independent from the input,\nthis function only returns a vector. (the time information of a resulting\ntime series object wouldn't be correct any more).\n}\n\\examples{\n# Example 1: Remove all NAs\n# Create Time series with missing values\nx <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n\n# Example 1: Remove all NAs\nna_remove(x)\n\n# Example 2: Remove all NAs in tsAirgap\nna_remove(tsAirgap)\n\n# Example 3: Same as example 1, just written with pipe operator\nx \\%>\\% na_remove()\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_replace.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_replace.R\n\\name{na_replace}\n\\alias{na_replace}\n\\title{Replace Missing Values by a Defined Value}\n\\usage{\nna_replace(x, fill = 0, maxgap = Inf)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{fill}{Value used to replace the missing values}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nReplaces all missing values with a given value.\n}\n\\examples{\n# Prerequisite: Create Time series with missing values\nx <- ts(c(2, 3, NA, 5, 6, NA, 7, 8))\n\n# Example 1: Replace all NAs with 3.5\nna_replace(x, fill = 3.5)\n\n# Example 2: Replace all NAs with 0\nna_replace(x, fill = 0)\n\n# Example 3: Same as example 1, just written with pipe operator\nx \\%>\\% na_replace(fill = 3.5)\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}},\n\\code{\\link[imputeTS]{na_seadec}}, \\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_seadec.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_seadec.R\n\\name{na_seadec}\n\\alias{na_seadec}\n\\title{Seasonally Decomposed Missing Value Imputation}\n\\usage{\nna_seadec(\n  x,\n  algorithm = \"interpolation\",\n  find_frequency = FALSE,\n  maxgap = Inf,\n  ...\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{algorithm}{Algorithm to be used after decomposition.\nAccepts the following input:\n\\itemize{\n\\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n\\item{\"locf\" - Imputation by Last Observation Carried Forward}\n\\item{\"mean\" - Imputation by Mean Value}\n\\item{\"random\" - Imputation by Random Sample}\n\\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n\\item{\"ma\" - Imputation by Weighted Moving Average}\n}}\n\n\\item{find_frequency}{If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters for these algorithms that can be passed\nthrough. Look at \\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n\\code{\\link[imputeTS]{na_mean}} for parameter options.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nRemoves the seasonal component from the time series,\nperforms imputation on the deseasonalized series and afterwards adds\nthe seasonal component again.\n}\n\\details{\nThe algorithm first performs a Seasonal Decomposition of Time Series by Loess\nvia \\code{\\link[stats]{stl}}. Decomposing the time series into seasonal, trend and irregular\ncomponents. The seasonal component gets then removed (subtracted) from the original series.\nAs a second step the selected imputation algorithm e.g. na_locf, na_ma, ...  is applied\non the deseasonalized series. Thus, the algorithm can work without being affected by seasonal\npatterns. After filling the NA gaps, the seasonal component is added to the deseasonalized\nseries again.\n\nImplementation details:\nA paper about the STL Decomposition procedure is linked in the references.\nSince the function only works with complete data, the initial NA data is temporarily filled\nvia linear interpolation in order to perform the decomposition. These temporarily imputed\nvalues are replaced with NAs again after obtaining the decomposition for the non-NA\nobservations. STL decomposition is run with robust = TRUE and s.window = 11. Additionally,\napplying STL decomposition needs a preset frequency. This can be passed by the frequency\nset in the input ts object or by setting 'find_frequency=TRUE' in order to find\nan appropriate frequency for the time series. The find_frequency parameter internally uses\n\\code{\\link[forecast]{findfrequency}}, which does a spectral analysis of the time series\nfor identifying a suitable frequency. Using find_frequency will update the previously set\nfrequency of a ts object to the newly found frequency. The default is 'find_frequency = FALSE',\nwhich gives a warning if no seasonality is set for the supplied time series object.\nIf neither seasonality is set nor find_frequency is set to TRUE, the function goes on without\ndecomposition and just applies the selected secondary algorithm to the original time series\nthat still includes seasonality.\n}\n\\examples{\n# Example 1: Perform seasonal imputation using algorithm = \"interpolation\"\nna_seadec(tsAirgap, algorithm = \"interpolation\")\n\n# Example 2: Perform seasonal imputation using algorithm = \"mean\"\nna_seadec(tsAirgap, algorithm = \"mean\")\n\n# Example 3: Same as example 1, just written with pipe operator\ntsAirgap \\%>\\% na_seadec(algorithm = \"interpolation\")\n}\n\\references{\nR. B. Cleveland, W. S. Cleveland, J.E. McRae, and I.\nTerpenning (1990) STL: A Seasonal-Trend Decomposition Procedure\nBased on Loess. Journal of Official Statistics, 6, 3–73.\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seasplit}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/na_seasplit.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/na_seasplit.R\n\\name{na_seasplit}\n\\alias{na_seasplit}\n\\title{Seasonally Splitted Missing Value Imputation}\n\\usage{\nna_seasplit(\n  x,\n  algorithm = \"interpolation\",\n  find_frequency = FALSE,\n  maxgap = Inf,\n  ...\n)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject in which missing values shall be replaced}\n\n\\item{algorithm}{Algorithm to be used after splits.\nAccepts the following input:\n\\itemize{\n\\item{\"interpolation\" - Imputation by Interpolation} (default choice)\n\\item{\"locf\" - Imputation by Last Observation Carried Forward}\n\\item{\"mean\" - Imputation by Mean Value}\n\\item{\"random\" - Imputation by Random Sample}\n\\item{\"kalman\" - Imputation by Kalman Smoothing and State Space Models}\n\\item{\"ma\" - Imputation by Weighted Moving Average}\n}}\n\n\\item{find_frequency}{If TRUE the algorithm will try to estimate the frequency\nof the time-series automatically.}\n\n\\item{maxgap}{Maximum number of successive NAs to still perform imputation on.\nDefault setting is to replace all NAs without restrictions. With this\noption set, consecutive NAs runs, that are longer than 'maxgap' will\nbe left NA. This option mostly makes sense if you want to\ntreat long runs of NA afterwards separately.}\n\n\\item{...}{Additional parameters for these algorithms that can be\npassed through. Look at \\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_locf}}, \\code{\\link[imputeTS]{na_random}},\n\\code{\\link[imputeTS]{na_mean}} for parameter options.}\n}\n\\value{\nVector (\\code{\\link{vector}}) or Time Series (\\code{\\link{ts}})\nobject (dependent on given input at parameter x)\n}\n\\description{\nSplits the times series into seasons and afterwards performs\nimputation separately for each of the resulting time series datasets\n(each containing the data for one specific season).\n}\n\\examples{\n# Example 1: Perform seasonal splitted imputation using algorithm = \"interpolation\"\nna_seasplit(tsAirgap, algorithm = \"interpolation\")\n\n# Example 2: Perform seasonal splitted imputation using algorithm = \"mean\"\nna_seasplit(tsAirgap, algorithm = \"mean\")\n\n# Example 3: Same as example 1, just written with pipe operator\ntsAirgap \\%>\\% na_seasplit(algorithm = \"interpolation\")\n}\n\\seealso{\n\\code{\\link[imputeTS]{na_interpolation}},\n\\code{\\link[imputeTS]{na_kalman}}, \\code{\\link[imputeTS]{na_locf}},\n\\code{\\link[imputeTS]{na_ma}}, \\code{\\link[imputeTS]{na_mean}},\n\\code{\\link[imputeTS]{na_random}}, \\code{\\link[imputeTS]{na_replace}},\n\\code{\\link[imputeTS]{na_seadec}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/plotNA.distribution.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{plotNA.distribution}\n\\alias{plotNA.distribution}\n\\title{Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution}} instead.}\n\\usage{\nplotNA.distribution(x, ...)\n}\n\\description{\nplotNA.distribution was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution}}.\nThe new plotting function provides an improved version of the old plot, e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/plotNA.distributionBar.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{plotNA.distributionBar}\n\\alias{plotNA.distributionBar}\n\\title{Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_distribution2}} instead.}\n\\usage{\nplotNA.distributionBar(x, ...)\n}\n\\description{\nplotNA.distributionBar was replaced by \\code{\\link[imputeTS]{ggplot_na_distribution2}}.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/plotNA.gapsize.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{plotNA.gapsize}\n\\alias{plotNA.gapsize}\n\\title{Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_gapsize}} instead.}\n\\usage{\nplotNA.gapsize(x, ...)\n}\n\\description{\nplotNA.gapsize was replaced by \\code{\\link[imputeTS]{ggplot_na_gapsize}}.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/plotNA.imputations.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/deprecated_defunct.R\n\\name{plotNA.imputations}\n\\alias{plotNA.imputations}\n\\title{Discontinued - Use \\code{\\link[imputeTS]{ggplot_na_imputations}} instead.}\n\\usage{\nplotNA.imputations(x, ...)\n}\n\\description{\nplotNA.imputations was replaced by \\code{\\link[imputeTS]{ggplot_na_imputations}}.\nThe new plotting function provides an improved version of the old plot e.g. it looks better now and is better adjustable,\nbecause it is based on ggplot2. If you absolutely want to use the old function,\nyou need to download an older package version. Versions 3.0 and below still have the old functions.\n}\n\\keyword{internal}\n"
  },
  {
    "path": "man/reexports.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/imputeTS-package.R\n\\docType{import}\n\\name{reexports}\n\\alias{reexports}\n\\alias{\\%>\\%}\n\\title{Objects exported from other packages}\n\\keyword{internal}\n\\description{\nThese objects are imported from other packages. Follow the links\nbelow to see their documentation.\n\n\\describe{\n  \\item{magrittr}{\\code{\\link[magrittr:pipe]{\\%>\\%}}}\n}}\n\n"
  },
  {
    "path": "man/statsNA.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/statsNA.R\n\\name{statsNA}\n\\alias{statsNA}\n\\title{Print Statistics about Missing Values}\n\\usage{\nstatsNA(x, bins = 4, print_only = TRUE)\n}\n\\arguments{\n\\item{x}{Numeric Vector (\\code{\\link{vector}}) or\nTime Series (\\code{\\link{ts}}) object containing NAs}\n\n\\item{bins}{Split number for bin stats. Number of bins the time series gets\ndivided into. For each bin information about amount/percentage of missing\nvalues is printed. Default value is 4 - what means stats about the\n1st,2nd,3rd,4th quarter of the time series are shown.}\n\n\\item{print_only}{Choose if the function Prints or Returns.\nFor print_only = TRUE the function has no return value and just prints out\nmissing value stats. If print_only is changed to FALSE, nothing is printed\nand the function returns a list.Print gives a little bit more information,\nsince the returned list does not include \"Stats for Bins\"\nand \"overview NA series\"}\n}\n\\value{\nA \\code{\\link{list}} containing the stats. Beware: Function gives\nonly a return value if print_only = FALSE.\n}\n\\description{\nPrint summary stats about the distribution of\nmissing values in a univariate time series.\n}\n\\details{\nPrints the following information about the missing values in the time series:\n\\itemize{\n\\item{\"Length of time series\" - Number of observations in the time series (including NAs)}\n\\item{\"Number of Missing Values\" - Number of missing values in the time series}\n\\item{\"Percentage of Missing Values\" - Percentage of missing values in the time series}\n\\item{\"Number of Gaps\" - Number of NA gaps (consisting of one or more consecutive NAs) in the time series}\n\\item{\"Average Gap Size\" - Average size of consecutive NAs for the NA gaps in the time series}\n\\item{\"Stats for Bins\" - Number/percentage of missing values for the split into bins }\n\\item{\"Longest NA gap\" - Longest series of consecutive missing values (NAs in a row) in the time series }\n\\item{\"Most frequent gap size\" - Most frequent occurring series of missing values in the time series}\n\\item{\"Gap size accounting for most NAs\" - The series of consecutive missing values that accounts for most missing values overall in the time series}\n\\item{\"Overview NA series\" - Overview about how often each series of consecutive missing values occurs. Series occurring 0 times are skipped}\n}\nIt is furthermore, important to note, that you are able to choose whether\nthe function returns a list or prints the information only.\n(see description of parameter \"print_only\")\n}\n\\examples{\n# Example 1: Print stats about the missing data in tsNH4\nstatsNA(tsNH4)\n\n# Example 2: Return list with stats about the missing data in tsAirgap\nstatsNA(tsAirgap, print_only = FALSE)\n\n# Example 3: Same as example 1, just written with pipe operator\ntsNH4 \\%>\\% statsNA()\n}\n\\seealso{\n\\code{\\link[imputeTS]{ggplot_na_distribution}},\n\\code{\\link[imputeTS]{ggplot_na_distribution2}},\n\\code{\\link[imputeTS]{ggplot_na_gapsize}}\n}\n\\author{\nSteffen Moritz\n}\n"
  },
  {
    "path": "man/tsAirgap.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsAirgap.R\n\\docType{data}\n\\name{tsAirgap}\n\\alias{tsAirgap}\n\\title{Time series of monthly airline passengers (with NAs)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 144 rows including 13 NAs.\n}\n\\source{\n\\cite{Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.}\n}\n\\usage{\ntsAirgap\n}\n\\description{\nMonthly totals of international airline passengers, 1949 to 1960.\nThis time series contains missing values. In the package included is also the \\code{\\link{tsAirgapComplete}} time series providing the true values for the\nmissing values.\n}\n\\details{\nThe dataset originates from Box and Jenkins (see citation) and is a commonly used example in\ntime series analysis literature.\n\nIt characteristics (strong trend, strong seasonal behavior) make it also a great\nexample for time series imputation.\nThus the version with inserted NA gaps was created under the name tsAirgap.\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied.\n\nThere are the two time series:\n\\itemize{\n\\item tsAirgap - The time series with NAs.\n\n\\item tsAirgapComplete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsHeating}}, \\code{\\link[imputeTS]{tsNH4}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "man/tsAirgapComplete.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsAirgapComplete.R\n\\docType{data}\n\\name{tsAirgapComplete}\n\\alias{tsAirgapComplete}\n\\title{Time series of monthly airline passengers (complete)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 144 rows.\n}\n\\source{\n\\cite{Box, G. E. P., Jenkins, G. M., Reinsel, G. C. and Ljung, G. M. (2015). Time series analysis: forecasting and control. Fifth Edition. John Wiley and Sons.}\n}\n\\usage{\ntsAirgapComplete\n}\n\\description{\nMonthly totals of international airline passengers, 1949 to 1960.\nThis time series provides the truth for the missing values of the \\code{\\link{tsAirgap}} time series. Thus it is identical\nto the tsAirgap time series except that no value is missing.\n}\n\\details{\nThe dataset originates from Box and Jenkins (see citation) and is a commonly used example in\ntime series analysis literature.\n\nIt characteristics (strong trend, strong seasonal behavior) make it also a great\nexample for time series imputation.\nThus the version with inserted NA gaps was created under the name tsAirgap.\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied.\n\nThere are the two time series:\n\\itemize{\n\\item tsAirgap - The time series with NAs.\n\n\\item tsAirgapComplete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsHeating}}, \\code{\\link[imputeTS]{tsNH4}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "man/tsHeating.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsHeating.R\n\\docType{data}\n\\name{tsHeating}\n\\alias{tsHeating}\n\\title{Time series of a heating systems supply temperature (with NAs)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 606837 rows including 57391 NAs.\n}\n\\source{\n\\cite{Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt,\nChristopher, and Bartz-Beielstein, Thomas. (2015, May 1).\nGECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering\nmissing information in heating system operating data' competition at the\nGenetic and Evolutionary Computation Conference 2015, Madrid, Spain.\nhttp://doi.org/10.5281/zenodo.3884899 }\n}\n\\usage{\ntsHeating\n}\n\\description{\nTime series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series contains missing values. In the package included is also the \\code{\\link{tsHeatingComplete}} time series providing the true values for the\nmissing values.\n}\n\\details{\nThe time series originates from the GECCO Industrial Challenge 2015.\nThis Challenge was about \"Recovering missing information in heating system operating data\".\nGoal was to impute missing values in heating system sensor data as accurate as possible.\n(\\doi{10.5281/zenodo.3884899})\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.\n\nThere are the two time series:\n\\itemize{\n\\item tsHeating - The time series with NAs.\n\n\\item tsHeatingComplete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsAirgap}}, \\code{\\link[imputeTS]{tsNH4}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "man/tsHeatingComplete.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsHeatingComplete.R\n\\docType{data}\n\\name{tsHeatingComplete}\n\\alias{tsHeatingComplete}\n\\title{Time series of a heating systems supply temperature (complete)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 606837 rows.\n}\n\\source{\n\\cite{Moritz, Steffen, Friese, Martina, Fischbach, Andreas, Schlitt,\nChristopher, and Bartz-Beielstein, Thomas. (2015, May 1).\nGECCO Industrial Challenge 2015 Dataset: A heating system dataset for the 'Recovering\nmissing information in heating system operating data' competition at the\nGenetic and Evolutionary Computation Conference 2015, Madrid, Spain.\nhttp://doi.org/10.5281/zenodo.3884899 }\n}\n\\usage{\ntsHeatingComplete\n}\n\\description{\nTime series of a heating systems supply temperature. Measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThis time series provides the truth for the missing values of the \\code{\\link{tsHeating}} time series. Thus it is identical\nto the heating time series except that no value is missing.\n}\n\\details{\nThe time series originates from the GECCO Industrial Challenge 2015.\nThis Challenge was about \"Recovering missing information in heating system operating data\".\nGoal was to impute missing values in heating system sensor data as accurate as possible.\n(\\doi{10.5281/zenodo.3884899})\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.\n\nThere are the two time series:\n\\itemize{\n\\item tsHeating - The time series with NAs.\n\n\\item tsHeatingComplete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsAirgap}}, \\code{\\link[imputeTS]{tsNH4}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "man/tsNH4.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsNH4.R\n\\docType{data}\n\\name{tsNH4}\n\\alias{tsNH4}\n\\title{Time series of NH4 concentration in a wastewater system (with NAs)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 4552 rows including 883 NAs.\n}\n\\source{\n\\cite{Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\nBartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16).\nGECCO Industrial Challenge 2014 Dataset: A water quality dataset for the\n'Active protection against pollution of the surface water' competition at the\nGenetic and Evolutionary Computation Conference 2015, Vancouver, Canada.\nhttp://www.spotseven.de/gecco-challenge/gecco-challenge-2014}\n}\n\\usage{\ntsNH4\n}\n\\description{\nTime series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series contains missing values. In the package included is also the \\code{\\link{tsNH4Complete}} time series providing the true values for the\nmissing values.\n}\n\\details{\nThe time series is derived from the dataset of the  GECCO Industrial Challenge 2014.\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.\n\nThere are the two time series:\n\\itemize{\n\\item tsNH4 - The time series with NAs.\n\n\\item tsNH4Complete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsAirgap}},\\code{\\link[imputeTS]{tsHeating}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "man/tsNH4Complete.Rd",
    "content": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/tsNH4Complete.R\n\\docType{data}\n\\name{tsNH4Complete}\n\\alias{tsNH4Complete}\n\\title{Time series of NH4 concentration in a wastewater system (complete)}\n\\format{\nTime Series (\\code{\\link{ts}}) with 4552 rows.\n}\n\\source{\n\\cite{Friese, Martina, Fischbach, Andreas, Flasch, Oliver, Mersmann, Olaf,\nBartz-Beielstein, Thomas, and Walbeck, Klaus. (2014, July 16).\nGECCO Industrial Challenge 2014 Dataset: A water quality dataset for the\n'Active protection against pollution of the surface water' competition at the\nGenetic and Evolutionary Computation Conference 2015, Vancouver, Canada.\nhttp://www.spotseven.de/gecco-challenge/gecco-challenge-2014}#'\n}\n\\usage{\ntsNH4Complete\n}\n\\description{\nTime series of NH4 concentration in a wastewater system. Measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThis time series provides the truth for the missing values of the \\code{\\link{tsNH4}} time series. Thus it is identical\nto the heating time series except that no value is missing.\n}\n\\details{\nThe time series is derived from the dataset of the  GECCO Industrial Challenge 2014.\n\nIn order to use this series for comparing imputation algorithm results,\nthere are two time series provided. One series without missing values, which can\nbe used as ground truth. Another series with NAs, on which the imputation\nalgorithms can be applied. The NAs thereby were inserted according to patterns\nfound in similar time series.\n\nThere are the two time series:\n\\itemize{\n\\item tsNH4 - The time series with NAs.\n\n\\item tsNH4Complete - Time series without NAs.\n}\n}\n\\seealso{\n\\code{\\link[imputeTS]{tsAirgap}},\\code{\\link[imputeTS]{tsHeating}}\n}\n\\keyword{datasets}\n"
  },
  {
    "path": "src/RcppExports.cpp",
    "content": "// Generated by using Rcpp::compileAttributes() -> do not edit by hand\n// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393\n\n#include <Rcpp.h>\n\nusing namespace Rcpp;\n\n#ifdef RCPP_USE_GLOBAL_ROSTREAM\nRcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();\nRcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();\n#endif\n\n// locf\nRcpp::NumericVector locf(NumericVector x, bool reverse);\nRcppExport SEXP _imputeTS_locf(SEXP xSEXP, SEXP reverseSEXP) {\nBEGIN_RCPP\n    Rcpp::RObject rcpp_result_gen;\n    Rcpp::RNGScope rcpp_rngScope_gen;\n    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);\n    Rcpp::traits::input_parameter< bool >::type reverse(reverseSEXP);\n    rcpp_result_gen = Rcpp::wrap(locf(x, reverse));\n    return rcpp_result_gen;\nEND_RCPP\n}\n// ma\nRcpp::NumericVector ma(NumericVector x, int k, String weighting);\nRcppExport SEXP _imputeTS_ma(SEXP xSEXP, SEXP kSEXP, SEXP weightingSEXP) {\nBEGIN_RCPP\n    Rcpp::RObject rcpp_result_gen;\n    Rcpp::RNGScope rcpp_rngScope_gen;\n    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);\n    Rcpp::traits::input_parameter< int >::type k(kSEXP);\n    Rcpp::traits::input_parameter< String >::type weighting(weightingSEXP);\n    rcpp_result_gen = Rcpp::wrap(ma(x, k, weighting));\n    return rcpp_result_gen;\nEND_RCPP\n}\n\nstatic const R_CallMethodDef CallEntries[] = {\n    {\"_imputeTS_locf\", (DL_FUNC) &_imputeTS_locf, 2},\n    {\"_imputeTS_ma\", (DL_FUNC) &_imputeTS_ma, 3},\n    {NULL, NULL, 0}\n};\n\nRcppExport void R_init_imputeTS(DllInfo *dll) {\n    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);\n    R_useDynamicSymbols(dll, FALSE);\n}\n"
  },
  {
    "path": "src/locf.cpp",
    "content": "#include <Rcpp.h>\nusing namespace Rcpp;\n\n\n// [[Rcpp::export]]\nRcpp::NumericVector locf(NumericVector x, bool reverse) \n{\n\n  Rcpp::NumericVector z = clone(x);\n  \n  long n = z.size();\n  \n  if (!reverse) {\n    for(long i = 0; i < n; i++ ) {\n      \n      if (i % 1024 == 0) {Rcpp::checkUserInterrupt();}\n      \n      \n      if(i > 0 && !R_finite(z[i]) && R_finite(z[i-1])) \n      {\n        z[i] = z[i-1];\n      }\n    }\n  }\n  else {\n    for(long i = n-1; i >= 0; i-- ) {\n      \n      if (i % 1024 == 0) {Rcpp::checkUserInterrupt();}\n        \n        \n      if(i < n-1 && !R_finite(z[i]) && R_finite(z[i+1])) \n      {\n        z[i] = z[i+1];\n      }\n    }\n    \n  }\nreturn z;\n \n}\n\n\n"
  },
  {
    "path": "src/ma.cpp",
    "content": "#include <Rcpp.h>\nusing namespace Rcpp;\n\n\nstruct pow_wrapper {\n  public: double operator()(double a, double b) {\n    return ::pow(a, b);\n  }\n};\n\nNumericVector vecpow(const IntegerVector base, const NumericVector exp) {\n  NumericVector out(base.size());\n  std::transform(base.cbegin(), base.cend(), exp.cbegin(), out.begin(), pow_wrapper());\n  return out;\n}\n\n\n\n// [[Rcpp::export]]\nRcpp::NumericVector ma(NumericVector x, int k, String weighting) {\n  Rcpp::NumericVector tempdata = clone(x);\n  Rcpp::NumericVector out = clone(x);\n  \n  int n = tempdata.size();\n  \n  for (int i = 0; i < n; i++ ) {\n    // check for interrupt every 1024 iterations\n    if (i % 1024 == 0) {Rcpp::checkUserInterrupt();}\n    \n    // If Value is NA -> impute it based on selected method\n    if (ISNAN(tempdata[i])) {\n      int ktemp = k;\n      IntegerVector usedIndices = seq(i - ktemp, i + ktemp);\n      usedIndices = usedIndices[usedIndices >= 0];\n      usedIndices = usedIndices[usedIndices < n];\n      NumericVector t = tempdata[usedIndices];\n      \n      // Search for at least 2 NA-values\n      while (sum(!is_na(t)) < 2) {\n        ktemp = ktemp + 1;\n        usedIndices = seq(i - ktemp, i + ktemp);\n        usedIndices = usedIndices[usedIndices >= 0];\n        usedIndices = usedIndices[usedIndices < n];\n        t = tempdata[usedIndices];\n      }\n      \n      if (weighting ==\"simple\") {\n        // Calculate mean value\n        NumericVector noNAs = wrap(na_omit(t));\n        out[i] = mean(noNAs);\n      } \n      else if(weighting == \"linear\") {\n        // Calculate weights based on indices 1/(distance from current index+1)\n        // Set weights where data is NA to 0\n        // Sum up all weights (needed later) to norm it\n        // Create weighted data (weights*data)\n        // Sum up\n        NumericVector weightsData = 1 / (abs(usedIndices - i) + 1);\n        LogicalVector naCheck = !is_na(t);\n        weightsData = weightsData * as<NumericVector>(naCheck);\n        double sumWeights = sum(weightsData);\n        NumericVector weightedData = (t * weightsData) / sumWeights;\n        NumericVector noNAs = wrap(na_omit(weightedData));\n        out[i] = sum(noNAs);\n      } \n      else if (weighting == \"exponential\") {\n        // Calculate weights based on indices 1/ 2 ^ (distance from current index)\n        // Set weights where data is NA to 0\n        // Sum up all weights (needed later) to norm it\n        // Create weighted data (weights*data)\n        // Sum up\n        NumericVector expo = abs(usedIndices - i);\n        IntegerVector base = Rcpp::rep(2, expo.size());\n        NumericVector weightsData = 1 / (vecpow(base, expo));\n        LogicalVector naCheck = !is_na(t);\n        weightsData = weightsData * as<NumericVector>(naCheck);\n        double sumWeights = sum(weightsData);\n        NumericVector weightedData = (t * weightsData) / sumWeights;\n        NumericVector noNAs = wrap(na_omit(weightedData));\n        out[i] = sum(noNAs);\n      } else {\n        stop(\"Wrong input for parameter weighting. Has to be \\\"simple\\\",\\\"linear\\\" or \\\"exponential\\\".\" );\n      }\n    }\n  }\n  \n  return out;\n}\n\n"
  },
  {
    "path": "tests/testthat/test-apply_base_algorithm.R",
    "content": "context(\"apply_base_algorithm\")\n\ntest_that(\"Warning for wrong algorithm choice\", {\n  expect_error(\n    apply_base_algorithm(tsAirgap, algorithm = \"wrongAlgorithm\")\n  )\n})\n"
  },
  {
    "path": "tests/testthat/test-depreciated_defunct.R",
    "content": "context(\"Defunct and Depreciated Functions\")\n\n\n\ntest_that(\"Correct error for old, defunct plotting functions\", {\n  expect_error(plotNA.distribution(tsAirgap), class = \"defunctError\")\n  expect_error(plotNA.distributionBar(tsAirgap), class = \"defunctError\")\n  expect_error(plotNA.gapsize(tsAirgap), class = \"defunctError\")\n  expect_error(plotNA.imputations(tsAirgap), class = \"defunctError\")\n})\n\n\ntest_that(\"Correct warning for old, deprieciated imputation functions\", {\n  expect_warning(na.interpolation(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.kalman(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.locf(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.ma(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.mean(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.random(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.remove(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.replace(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.seadec(tsAirgap), regexp = \"replaced by\")\n  expect_warning(na.seasplit(tsAirgap), regexp = \"replaced by\")\n})\n"
  },
  {
    "path": "tests/testthat/test-error_handling.R",
    "content": "\ncontext(\"error-handling\")\n# These test are to make sure, the right errors / warnings are given \n# for wrong input data or wrong parameter inputs\n# Especially important is the error handling for multivariate inputs like data.frames\n\ntest_that(\"Too few non-NA data points\", {\n  x <- c(NA, NA, NA, NA, NA, NA, NA)\n  expect_error(na_seasplit(x), regexp = \"At least\")\n  expect_error(na_seadec(x), regexp = \"At least\")\n  expect_error(na_random(x), regexp = \"At least\")\n  expect_error(na_mean(x), regexp = \"At least\")\n  expect_error(na_ma(x), regexp = \"At least\")\n  expect_error(na_locf(x), regexp = \"At least\")\n  expect_error(na_kalman(x), regexp = \"At least\")\n  expect_error(na_interpolation(x), regexp = \"At least\")\n})\n\ntest_that(\"Data not numeric\", {\n  x1 <- rep(\"string\",144)\n  x1[3:15] <- NA\n  expect_error(na_seasplit(x1), regexp = \"not numeric\")\n  expect_error(na_seadec(x1), regexp = \"not numeric\")\n  expect_error(na_random(x1), regexp = \"not numeric\")\n  expect_error(na_mean(x1), regexp = \"not numeric\")\n  expect_error(na_ma(x1), regexp = \"not numeric\")\n  expect_error(na_locf(x1), regexp = \"not numeric\")\n  expect_error(na_kalman(x1), regexp = \"not numeric\")\n  expect_error(na_interpolation(x1), regexp = \"not numeric\")\n})\n\ntest_that(\"Correct error messages for multiveriate inputs\", {\n  x1 <- rep(\"string\",144)\n  x1[3:15] <- NA\n  x2 <- rep(3,144)\n  x2[3] <- NA\n  xyz <- data.frame(tsAirgap, x1, tsAirgap, x2)\n  expect_warning(na_seasplit(xyz), regexp = \"na_seasplit: No imputation performed for column 2\")\n  expect_warning(na_seasplit(xyz), regexp = \"No seasonality information for dataset could be found\")\n  expect_warning(na_seadec(xyz), regexp = \"na_seadec: No imputation performed for column 2\")\n  expect_warning(na_seadec(xyz), regexp = \"No seasonality information for dataset could be found\")\n  expect_warning(na_random(xyz), regexp = \"na_random: No imputation performed for column 2\")\n  expect_warning(na_mean(xyz), regexp = \"na_mean: No imputation performed for column 2\")\n  expect_warning(na_ma(xyz), regexp = \"na_ma: No imputation performed for column 2\")\n  expect_warning(na_locf(xyz), regexp = \"na_locf: No imputation performed for column 2\")\n  expect_warning(na_kalman(xyz), regexp = \"na_kalman: No imputation performed for column 2\")\n  expect_warning(na_interpolation(xyz), regexp = \"na_interpolation: No imputation performed for column 2\")\n})\n"
  },
  {
    "path": "tests/testthat/test-ggplot_na_distribution.R",
    "content": "context(\"ggplot_na_distribution\")\n\ntest_that(\"Old functions give error\", {\n  expect_error(plotNA.distribution(tsAirgap))\n})\n\ntest_that(\"Check that all parameters of plot run without error\", {\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  }\n  {\n    require(\"ggplot2\")\n    expect_true(is_ggplot(ggplot_na_distribution(tsAirgap)))\n    expect_true(is_ggplot(ggplot_na_distribution(tsAirgap,\n      color_points = \"blue\",\n      color_lines = \"gold\",\n      color_missing = \"darkgreen\",\n      color_missing_border = \"green\",\n      alpha_missing = 0.1,\n      title = \"test\",\n      subtitle = \"test\",\n      xlab = \"test\",\n      ylab = \"test\",\n      shape_points = 15,\n      size_points = 2,\n      theme = ggplot2::theme_classic()\n    )))\n  }\n})\n\ntest_that(\"Errors for wrong input\", {\n  ## input not univariate\n  x <- data.frame(\n    x = runif(10, 0, 10),\n    y = runif(10, 0, 10)\n  )\n  expect_error(ggplot_na_distribution(x))\n\n  ## input not numeric\n  x <- c(\"a\", 1, 2, 3)\n  expect_error(ggplot_na_distribution(x))\n\n  # input only NA\n  all_na <- as.numeric(c(NA, NA, NA, NA, NA, NA, NA, NA))\n  expect_error(ggplot_na_distribution(all_na))\n})\n\ntest_that(\"Works with tsNH4\", {\n  expect_true(is_ggplot(\n    ggplot_na_distribution(tsNH4)\n  ))\n})\n\ntest_that(\"Plot with x_axis_labels works and yearly data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    # Yearly data\n    nh <- structure(c(\n      NA, NA, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3,\n      51.9, 50.8, 49.6, 49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8,\n      51.8, 51.1, 49.8, 50.2, 50.4, 51.6, 51.8, 50.9, 48.8, 51.7, 51,\n      50.6, 51.7, 51.5, 52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6,\n      52, 52, 50.9, 52.6, 50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7,\n      51.4, 51.7, 50.8, 51.9, 51.8, NA, NA\n    ), .Tsp = c(\n      1912, 1971,\n      1\n    ), class = \"ts\")\n\n    # Use zoo to change ts time information to yearmon vector\n    # Afterwards create Date vector and from this Date vector POSIXct\n    nh_yearmon <- zoo::as.yearmon(time(nh))\n    nh_date <- zoo::as.Date(nh_yearmon)\n    nh_posix <- as.POSIXct(nh_date)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(nh)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(nh, x_axis_labels = nh_date)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(nh, x_axis_labels = nh_posix)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(nh, x_axis_labels = nh_posix, title = \"test\")\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(nh, x_axis_labels = nh_posix, title = \"test\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n    ))\n  }\n})\n\n\n\n\ntest_that(\"Plot with x_axis_labels works and tsAirgap data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n\n    # Use zoo to change ts time information to yearmon vector\n    # Afterwards create Date vector and from this Date vector POSIXct\n    airgap_yearmon <- zoo::as.yearmon(time(tsAirgap))\n    airgap_date <- zoo::as.Date(airgap_yearmon)\n    airgap_posix <- as.POSIXct(airgap_yearmon)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap)\n    ))\n\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap, x_axis_labels = airgap_date)\n    ))\n\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap, x_axis_labels = airgap_posix)\n    ))\n\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap, x_axis_labels = airgap_date) +\n        ggplot2::scale_x_date(date_breaks = \"6 month\", date_labels = \"%m-%Y\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1)) +\n        ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n        ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5)) +\n        ggtitle(\"hjsdhs\")\n    ))\n  }\n})\n\n\n\ntest_that(\"Non standard input - data.frame, tsibble, tibble, zoo\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    require(\"tibble\")\n    require(\"tsibble\")\n    # data.frame\n    tsAirgap_df <- data.frame(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_df)\n    ))\n\n\n\n    # data.frame - multivariate - supposed to give Error\n    tsAirgap_df2 <- data.frame(tsAirgap, tsAirgap)\n\n    expect_error(\n      ggplot_na_distribution(tsAirgap_df2)\n    )\n\n\n    # zoo and theme adjustment\n    tsAirgap_zoo <- zoo::as.zoo(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_zoo) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # zoo - multivariate - supposed to give Error\n    tsAirgap_zoo2 <- zoo(cbind(tsAirgap, tsAirgap), zoo::as.Date(zoo::as.yearmon(time(tsAirgap))))\n\n    expect_error(\n      ggplot_na_distribution(tsAirgap_zoo2)\n    )\n\n\n\n\n    # tsibble\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_tsibble)\n    ))\n\n\n\n    # tsibble just value, theme adjustment\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_tsibble$value) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # tsibble multivariate - plots first non index variable (maybe error would be better)\n    tsAirgap_tsibble2 <- tsibble::as_tsibble(tsAirgap)\n    tsAirgap_tsibble2$var2 <- tsAirgap\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_tsibble2)\n    ))\n\n\n\n    # tibble\n    tsAirgap_tibble <- tibble::as_tibble(tsAirgap)\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_tibble)\n    ))\n\n\n\n    # tibble multivariate -  plots first variable (maybe error would be better)\n    tsAirgap_tibble2 <- tibble::as_tibble(data.frame(tsAirgap, tsAirgap))\n    expect_true(is_ggplot(\n      ggplot_na_distribution(tsAirgap_tibble2)\n    ))\n  }\n})\n"
  },
  {
    "path": "tests/testthat/test-ggplot_na_distribution2.R",
    "content": "context(\"ggplot_na_distribution2\")\n\n\ntest_that(\"Old functions give error\", {\n  expect_error(plotNA.distributionBar(tsAirgap))\n})\n\ntest_that(\"Old name of function gives error\", {\n  expect_error(ggplot_na_intervals(tsAirgap))\n})\n\ntest_that(\"Check that all parameters of plot  run without error\", {\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap)))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap, number_intervals = 8)))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap, interval_size = 25)))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsNH4, measure = \"count\")))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap,\n      color_missing = \"blue\",\n      color_existing = \"yellow\"\n    )))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap,\n      alpha_missing = 1,\n      alpha_existing = 1\n    )))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap,\n      title = \"Test\",\n      subtitle = \"test\",\n      ylab = \"test\", xlab = \"test\"\n    )))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap, color_border = \"black\")))\n    expect_true(is_ggplot(ggplot_na_distribution2(tsAirgap, theme = ggplot2::theme_classic())))\n  }\n})\n\ntest_that(\"Errors for wrong input\", {\n  ## input not univariate\n  x <- data.frame(\n    x = runif(10, 0, 10),\n    y = runif(10, 0, 10)\n  )\n  expect_error(ggplot_na_distribution2(x))\n\n  ## input not numeric\n  x <- c(\"a\", 1, NA, 3)\n  expect_error(ggplot_na_distribution2(x))\n\n  all_na <- as.numeric(c(NA, NA, NA, NA, NA, NA, NA, NA))\n  expect_error(ggplot_na_distribution2(all_na))\n})\n\n\n\n\ntest_that(\"Plot works with test ts\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    # Yearly data\n    nh <- structure(c(\n      NA, NA, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3,\n      51.9, 50.8, 49.6, 49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8,\n      51.8, 51.1, 49.8, 50.2, 50.4, 51.6, 51.8, 50.9, 48.8, 51.7, 51,\n      50.6, 51.7, 51.5, 52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6,\n      52, 52, 50.9, 52.6, 50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7,\n      51.4, 51.7, 50.8, 51.9, 51.8, NA, NA\n    ), .Tsp = c(\n      1912, 1971,\n      1\n    ), class = \"ts\")\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(nh)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(nh, title = \"test\")\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(nh, title = \"test\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n    ))\n  }\n})\n\n\n\n\ntest_that(\" tsNH4 data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsNH4)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsNH4) +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1)) +\n        ggplot2::ggtitle(\"hjsdhs\")\n    ))\n  }\n})\n\n\ntest_that(\"Non standard input - data.frame, tsibble, tibble, zoo\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    require(\"tibble\")\n    require(\"tsibble\")\n    # data.frame\n    tsAirgap_df <- data.frame(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_df)\n    ))\n\n\n\n    # data.frame - multivariate - supposed to give Error\n    tsAirgap_df2 <- data.frame(tsAirgap, tsAirgap)\n\n    expect_error(\n      ggplot_na_distribution2(tsAirgap_df2)\n    )\n\n\n    # zoo and theme adjustment\n    tsAirgap_zoo <- zoo::as.zoo(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_zoo) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # zoo - multivariate - supposed to give Error\n    tsAirgap_zoo2 <- zoo(cbind(tsAirgap, tsAirgap), zoo::as.Date(zoo::as.yearmon(time(tsAirgap))))\n\n    expect_error(\n      ggplot_na_distribution2(tsAirgap_zoo2)\n    )\n\n\n\n\n    # tsibble\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_tsibble)\n    ))\n\n\n\n    # tsibble just value, theme adjustment\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_tsibble$value) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # tsibble multivariate - plots first non index variable (maybe error would be better)\n    tsAirgap_tsibble2 <- tsibble::as_tsibble(tsAirgap)\n    tsAirgap_tsibble2$var2 <- tsAirgap\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_tsibble2)\n    ))\n\n\n\n    # tibble\n    tsAirgap_tibble <- tibble::as_tibble(tsAirgap)\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_tibble)\n    ))\n\n\n\n    # tibble multivariate -  plots first variable (maybe error would be better)\n    tsAirgap_tibble2 <- tibble::as_tibble(data.frame(tsAirgap, tsAirgap))\n    expect_true(is_ggplot(\n      ggplot_na_distribution2(tsAirgap_tibble2)\n    ))\n  }\n})\n"
  },
  {
    "path": "tests/testthat/test-ggplot_na_gapsize.R",
    "content": "context(\"ggplot_na_gapsize\")\n\n\ntest_that(\"Old functions give error\", {\n  expect_error(plotNA.gapsize(tsAirgap))\n})\n\ntest_that(\"Check that all parameters of plot  run without error\", {\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, ranked_by = \"total\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsNH4, limit = 2)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, legend = F)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, orientation = \"horizontal\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, include_total = F)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, color_occurrence = \"blue\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, limit = 1)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, include_total = F)))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, ranked_by = \"total\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, color_occurrence = \"gold\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, color_total = \"green\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, title = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, subtitle = \"test2\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, xlab = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, ylab = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, orientation = \"vertical\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, label_occurrence = \"occ\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, label_total = \"total\")))\n    expect_true(is_ggplot(ggplot_na_gapsize(tsAirgap, theme = ggplot2::theme_classic())))\n  }\n})\n\ntest_that(\"Errors for wrong input\", {\n  ## input not univariate\n  x <- data.frame(\n    x = runif(10, 0, 10),\n    y = runif(10, 0, 10)\n  )\n  expect_error(ggplot_na_gapsize(x))\n\n  ## input not numeric\n  x <- c(\"a\", 1, NA, 3)\n  expect_error(ggplot_na_gapsize(x))\n\n  ## No NA values\n  x <- 1:10\n  expect_error(ggplot_na_gapsize(x))\n\n\n  all_na <- as.numeric(c(NA, NA, NA, NA, NA, NA, NA, NA))\n  expect_error(ggplot_na_gapsize(all_na))\n})\n\n\n\n\ntest_that(\"Plot works with test ts\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    # Yearly data\n    nh <- structure(c(\n      NA, NA, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3,\n      51.9, 50.8, 49.6, 49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8,\n      51.8, 51.1, 49.8, 50.2, 50.4, 51.6, 51.8, 50.9, 48.8, 51.7, 51,\n      50.6, 51.7, 51.5, 52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6,\n      52, 52, 50.9, 52.6, 50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7,\n      51.4, 51.7, 50.8, 51.9, 51.8, NA, NA\n    ), .Tsp = c(\n      1912, 1971,\n      1\n    ), class = \"ts\")\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(nh)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(nh, title = \"test\")\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(nh, title = \"test\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n    ))\n  }\n})\n\n\n\n\ntest_that(\" tsAirgap data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap) +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1)) +\n        ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n        ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5)) +\n        ggplot2::ggtitle(\"hjsdhs\")\n    ))\n  }\n})\n\n\ntest_that(\"Non standard input - data.frame, tsibble, tibble, zoo\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    require(\"tibble\")\n    require(\"tsibble\")\n    # data.frame\n    tsAirgap_df <- data.frame(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_df)\n    ))\n\n\n\n    # data.frame - multivariate - supposed to give Error\n    tsAirgap_df2 <- data.frame(tsAirgap, tsAirgap)\n\n    expect_error(\n      ggplot_na_gapsize(tsAirgap_df2)\n    )\n\n\n    # zoo and theme adjustment\n    tsAirgap_zoo <- zoo::as.zoo(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_zoo) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # zoo - multivariate - supposed to give Error\n    tsAirgap_zoo2 <- zoo(cbind(tsAirgap, tsAirgap), zoo::as.Date(zoo::as.yearmon(time(tsAirgap))))\n\n    expect_error(\n      ggplot_na_gapsize(tsAirgap_zoo2)\n    )\n\n\n\n\n    # tsibble\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_tsibble)\n    ))\n\n\n\n    # tsibble just value, theme adjustment\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_tsibble$value) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # tsibble multivariate - plots first non index variable (maybe error would be better)\n    tsAirgap_tsibble2 <- tsibble::as_tsibble(tsAirgap)\n    tsAirgap_tsibble2$var2 <- tsAirgap\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_tsibble2)\n    ))\n\n\n\n    # tibble\n    tsAirgap_tibble <- tibble::as_tibble(tsAirgap)\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_tibble)\n    ))\n\n\n\n    # tibble multivariate -  plots first variable (maybe error would be better)\n    tsAirgap_tibble2 <- tibble::as_tibble(data.frame(tsAirgap, tsAirgap))\n    expect_true(is_ggplot(\n      ggplot_na_gapsize(tsAirgap_tibble2)\n    ))\n  }\n})\n"
  },
  {
    "path": "tests/testthat/test-ggplot_na_gapsize2.R",
    "content": "context(\"ggplot_na_gapsize2\")\n\n\ntest_that(\"Check that all parameters of plot  run without error\", {\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, colors_bubbles = c(\"#FCFBFF\", \"#EFEEFA\", \"#DDDAEF\", \"#C8C3E2\"))))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, color_border = \"red\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, alpha_bubbles = 0.1)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, labels_bubbles = \"gap-occurrence\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, labels_bubbles = \"gap\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, labels_bubbles = \"total\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, labels_bubbles = \"none\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, labels_bubbles = \"occurrence\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, size_bubbles = 50)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, size_bubbles = 3)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, min_totals = 50)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, min_occurrence = 10)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, min_gap = 10)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsNH4, max_gap = 200)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, title = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, subtitle = \"test2\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_breaks = 4)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_breaks = 10)))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_point_sizes = \"default\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_point_sizes = \"actual\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_point_sizes = c(1, 2, 3, 4))))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_title = \"Legend\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, legend_position = \"left\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, ylab = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, xlab = \"test\")))\n    expect_true(is_ggplot(ggplot_na_gapsize2(tsAirgap, theme = ggplot2::theme_classic())))\n  }\n})\n\ntest_that(\"Errors for wrong input\", {\n  ## input not univariate\n  x <- data.frame(\n    x = runif(10, 0, 10),\n    y = runif(10, 0, 10)\n  )\n  expect_error(ggplot_na_gapsize2(x))\n\n  ## input not numeric\n  x <- c(\"a\", 1, NA, 3)\n  expect_error(ggplot_na_gapsize2(x))\n\n  ## No NA values\n  x <- 1:10\n  expect_error(ggplot_na_gapsize2(x))\n\n\n  all_na <- as.numeric(c(NA, NA, NA, NA, NA, NA, NA, NA))\n  expect_error(ggplot_na_gapsize2(all_na))\n\n  ## Empty plot because of too restrictive filters\n  expect_error(ggplot_na_gapsize2(tsAirgap, min_totals = 400))\n  expect_error(ggplot_na_gapsize2(tsAirgap, max_gapsize = 0))\n  expect_error(ggplot_na_gapsize2(tsAirgap, min_occurrence = 11))\n  expect_error(ggplot_na_gapsize2(tsAirgap, max_gapsize = 0))\n\n\n\n\n  ## Wrong legend input for custom legend_point_sizes\n  expect_error(ggplot_na_gapsize2(tsAirgap, legend_point_sizes = c(1, 2)))\n\n\n  ## Wrong legend input for custom legend_point_sizes\n  expect_error(ggplot_na_gapsize2(tsAirgap, legend_point_sizes = \"falsch\"))\n})\n\n\n\n\ntest_that(\"Plot works with test ts\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n    # Yearly data\n    nh <- structure(c(\n      NA, NA, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3,\n      51.9, 50.8, 49.6, 49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8,\n      51.8, 51.1, 49.8, 50.2, 50.4, 51.6, 51.8, 50.9, 48.8, 51.7, 51,\n      50.6, 51.7, 51.5, 52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6,\n      52, 52, 50.9, 52.6, 50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7,\n      51.4, 51.7, 50.8, 51.9, 51.8, NA, NA\n    ), .Tsp = c(\n      1912, 1971,\n      1\n    ), class = \"ts\")\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(nh)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(nh, title = \"test\")\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(nh, title = \"test\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n    ))\n  }\n})\n\n\n\n\ntest_that(\" tsAirgap data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"ggplot2\")\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap) +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1)) +\n        ggplot2::theme(plot.title = ggplot2::element_text(hjust = 0.5)) +\n        ggplot2::theme(plot.subtitle = ggplot2::element_text(hjust = 0.5)) +\n        ggplot2::ggtitle(\"hjsdhs\")\n    ))\n  }\n})\n\n\ntest_that(\"Non standard input - data.frame, tsibble, tibble, zoo\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    require(\"tibble\")\n    require(\"tsibble\")\n    # data.frame\n    tsAirgap_df <- data.frame(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_df)\n    ))\n\n\n\n    # data.frame - multivariate - supposed to give Error\n    tsAirgap_df2 <- data.frame(tsAirgap, tsAirgap)\n\n    expect_error(\n      ggplot_na_gapsize2(tsAirgap_df2)\n    )\n\n\n    # zoo and theme adjustment\n    tsAirgap_zoo <- zoo::as.zoo(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_zoo) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # zoo - multivariate - supposed to give Error\n    tsAirgap_zoo2 <- zoo(cbind(tsAirgap, tsAirgap), zoo::as.Date(zoo::as.yearmon(time(tsAirgap))))\n\n    expect_error(\n      ggplot_na_gapsize2(tsAirgap_zoo2)\n    )\n\n\n\n\n    # tsibble\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_tsibble)\n    ))\n\n\n\n    # tsibble just value, theme adjustment\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_tsibble$value) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # tsibble multivariate - plots first non index variable (maybe error would be better)\n    tsAirgap_tsibble2 <- tsibble::as_tsibble(tsAirgap)\n    tsAirgap_tsibble2$var2 <- tsAirgap\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_tsibble2)\n    ))\n\n\n\n    # tibble\n    tsAirgap_tibble <- tibble::as_tibble(tsAirgap)\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_tibble)\n    ))\n\n\n\n    # tibble multivariate -  plots first variable (maybe error would be better)\n    tsAirgap_tibble2 <- tibble::as_tibble(data.frame(tsAirgap, tsAirgap))\n    expect_true(is_ggplot(\n      ggplot_na_gapsize2(tsAirgap_tibble2)\n    ))\n  }\n})\n"
  },
  {
    "path": "tests/testthat/test-ggplot_na_imputations.R",
    "content": "context(\"ggplot_na_imputations\")\n\ntest_that(\"Old functions give error\", {\n  imp_mean <- na_mean(tsAirgap)\n  expect_error(plotNA.imputations(tsAirgap, imp_mean))\n})\n\ntest_that(\"Check that all parameters of plot run without error\", {\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  }\n\n  {\n    require(\"ggplot2\")\n    imp_mean <- na_mean(tsAirgap)\n    expect_true(is_ggplot(ggplot_na_imputations(tsAirgap, imp_mean)))\n    expect_true(is_ggplot(ggplot_na_imputations(tsAirgap, imp_mean, tsAirgapComplete)))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean\n    )))\n\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      title = \"test\",\n      subtitle = \"test\",\n      xlab = \"test\",\n      ylab = \"test\"\n    )))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      color_points = \"gold\",\n      color_imputations = \"blue\",\n      color_truth = \"yellow\"\n    )))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      shape_points = 15,\n      shape_imputations = 15,\n      shape_truth = 15\n    )))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      size_points = 2,\n      size_imputations = 2.2,\n      size_truth = 2\n    )))\n\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      width_lines = 0.6,\n      linetype = \"dotted\"\n    )))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      connect_na = FALSE,\n      legend = FALSE\n    )))\n\n    expect_true(is_ggplot(ggplot_na_imputations(\n      x_with_na = tsAirgap,\n      x_with_imputations = imp_mean,\n      x_with_truth = tsAirgapComplete,\n      legend_size = 6,\n      label_known = \"known\",\n      label_imputations = \"imputed\",\n      label_truth = \"truth\",\n      theme = ggplot2::theme_classic()\n    )))\n  }\n})\n\n\ntest_that(\"Errors for wrong input\", {\n  ## input not univariate\n  x <- data.frame(\n    x = runif(10, 0, 10),\n    y = runif(10, 0, 10)\n  )\n  expect_error(ggplot_na_imputations(x, tsAirgapComplete))\n  expect_error(ggplot_na_imputations(tsAirgapComplete, x))\n  expect_error(ggplot_na_imputations(tsAirgap, tsAirgapComplete, x))\n\n  ## input not numeric\n  x <- c(\"a\", 1, 2, 3)\n  expect_error(ggplot_na_imputations(x, tsAirgapComplete))\n  expect_error(ggplot_na_imputations(tsAirgapComplete, x))\n  expect_error(ggplot_na_imputations(tsAirgap, tsAirgapComplete, x))\n\n  # input only NA\n  all_na <- as.numeric(rep(NA, 144))\n  expect_error(ggplot_na_imputations(all_na, tsAirgapComplete))\n  expect_error(ggplot_na_imputations(tsAirgapComplete, all_na))\n\n  # Input datasets do not belong together / length of input data different\n\n  ## No NA values for x_with_na\n  x <- 1:144\n  expect_error(ggplot_na_imputations(x, tsAirgapComplete))\n})\n\ntest_that(\"Works with tsNH4\", {\n  expect_true(is_ggplot(\n    ggplot_na_imputations(tsNH4, na_mean(tsNH4), tsNH4Complete)\n  ))\n})\n\ntest_that(\"Plot with x_axis_labels works and yearly data works\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    # Yearly data\n    nh <- structure(c(\n      NA, NA, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3,\n      51.9, 50.8, 49.6, 49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8,\n      51.8, 51.1, 49.8, 50.2, 50.4, 51.6, 51.8, 50.9, 48.8, 51.7, 51,\n      50.6, 51.7, 51.5, 52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6,\n      52, 52, 50.9, 52.6, 50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7,\n      51.4, 51.7, 50.8, 51.9, 51.8, NA, NA\n    ), .Tsp = c(\n      1912, 1971,\n      1\n    ), class = \"ts\")\n\n    # Use zoo to change ts time information to yearmon vector\n    # Afterwards create Date vector and from this Date vector POSIXct\n    nh_yearmon <- zoo::as.yearmon(time(nh))\n    nh_date <- zoo::as.Date(nh_yearmon)\n    nh_posix <- as.POSIXct(nh_date)\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(nh, na_mean(nh))\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(nh, na_mean(nh), x_axis_labels = nh_date)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(nh, na_mean(nh), x_axis_labels = nh_posix)\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(nh, na_mean(nh), x_axis_labels = nh_posix, title = \"test\")\n    ))\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(nh, na_mean(nh), x_axis_labels = nh_posix, title = \"test\") +\n        ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 60, hjust = 1))\n    ))\n  }\n})\n\n\n\n\ntest_that(\"Non standard input - data.frame, tsibble, tibble, zoo\", {\n  skip_on_cran()\n  if (!requireNamespace(\"ggplot2\", quietly = TRUE)) {\n    warning(\"Pkg ggplot2 needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  } else if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  } else {\n    require(\"zoo\")\n    require(\"ggplot2\")\n    require(\"tibble\")\n    require(\"tsibble\")\n    # data.frame\n    tsAirgap_df <- data.frame(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_df, na_mean(tsAirgap_df))\n    ))\n\n\n\n    # data.frame - multivariate - supposed to give Error\n    tsAirgap_df2 <- data.frame(tsAirgap, tsAirgap)\n\n    expect_error(\n      ggplot_na_imputations(tsAirgap_df2, na_mean(tsAirgap_df2))\n    )\n\n\n    # zoo and theme adjustment\n    tsAirgap_zoo <- zoo::as.zoo(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_zoo, na_mean(tsAirgap_zoo)) + ggplot2::theme_minimal()\n    ))\n\n\n\n    # zoo - multivariate - supposed to give Error\n    tsAirgap_zoo2 <- zoo(cbind(tsAirgap, tsAirgap), zoo::as.Date(zoo::as.yearmon(time(tsAirgap))))\n\n    expect_error(\n      ggplot_na_imputations(tsAirgap_zoo2, na_mean(tsAirgap_zoo2))\n    )\n\n\n\n\n    # tsibble\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_tsibble, na_mean(tsAirgap_tsibble))\n    ))\n\n\n\n    # tsibble just value, theme adjustment\n    tsAirgap_tsibble <- tsibble::as_tsibble(tsAirgap)\n\n\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_tsibble$value, na_mean(tsAirgap_tsibble$value)) +\n        ggplot2::theme_minimal()\n    ))\n\n\n\n    # tsibble multivariate - plots first non index variable (maybe error would be better)\n    tsAirgap_tsibble2 <- tsibble::as_tsibble(tsAirgap)\n    tsAirgap_tsibble2$var2 <- tsAirgap\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_tsibble2, na_mean(tsAirgap_tsibble2))\n    ))\n\n\n\n    # tibble\n    tsAirgap_tibble <- tibble::as_tibble(tsAirgap)\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_tibble, na_mean(tsAirgap_tibble))\n    ))\n\n\n\n    # tibble multivariate -  plots first variable (maybe error would be better)\n    tsAirgap_tibble2 <- tibble::as_tibble(data.frame(tsAirgap, tsAirgap))\n    expect_true(is_ggplot(\n      ggplot_na_imputations(tsAirgap_tibble2, na_mean(tsAirgap_tibble2))\n    ))\n  }\n})\n"
  },
  {
    "path": "tests/testthat/test-input-na_advanced-tsObjects.R",
    "content": "context(\"Advanced Time Series Objects Input\")\n\n\ntest_that(\"tsibble objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tsibble\")\n    x <- as_tsibble(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\ntest_that(\"Multivariate tsibble \", {\n  skip_on_cran()\n  if (!requireNamespace(\"tsibble\", quietly = TRUE)) {\n    warning(\"Pkg tsibble needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tsibble\")\n    x <- data.frame(tsAirgap, tsAirgap)\n    x <- as.ts(x)\n    x <- as_tsibble(x)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\ntest_that(\"tibble objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tibble\")\n    x <- as_tibble(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\n\ntest_that(\"multivariate tibble objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tibble\")\n\n    x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n    z <- as_tibble(x)\n\n    expect_false(anyNA(na_mean(z)))\n    expect_false(anyNA(na_kalman(z)))\n    expect_false(anyNA(na_interpolation(z)))\n    expect_false(anyNA(na_locf(z)))\n    expect_false(anyNA(na_ma(z)))\n    expect_false(anyNA(na_random(z)))\n    expect_false(anyNA(na_seadec(z)))\n    expect_false(anyNA(na_seasplit(z)))\n    expect_false(anyNA(na_replace(z)))\n  }\n})\n\n\ntest_that(\"multivariate tibble objects - non-numeric input\", {\n  skip_on_cran()\n  if (!requireNamespace(\"tibble\", quietly = TRUE)) {\n    warning(\"Pkg tibble needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tibble\")\n\n    x <- data.frame(rep(\"x\", 144), tsAirgap, tsAirgap, rep(\"qq\", 144), tsAirgapComplete)\n    z <- as_tibble(x)\n\n    expect_false(anyNA(na_mean(z)))\n    expect_false(anyNA(na_kalman(z)))\n    expect_false(anyNA(na_interpolation(z)))\n    expect_false(anyNA(na_locf(z)))\n    expect_false(anyNA(na_ma(z)))\n    expect_false(anyNA(na_random(z)))\n    expect_false(anyNA(na_seadec(z)))\n    expect_false(anyNA(na_seasplit(z)))\n    expect_false(anyNA(na_replace(z)))\n  }\n})\n\n\n\ntest_that(\"zoo objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"zoo\")\n    x <- as.zoo(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\ntest_that(\"multivariate zoo objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"zoo\", quietly = TRUE)) {\n    warning(\"Pkg zoo needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"zoo\")\n    require(\"stats\")\n    time <- base::seq(\n      from = zoo::as.Date(zoo::as.yearmon(stats::start(tsAirgap)))[1], by = \"month\",\n      length.out = length(tsAirgap)\n    )\n    x <- data.frame(time, zoo::coredata(tsAirgap), zoo::coredata(tsAirgap), zoo::coredata(tsAirgapComplete))\n\n    z <- zoo::read.zoo(x, format = \"%Y-%m-%d\")\n\n    expect_false(anyNA(na_mean(z)))\n    expect_false(anyNA(na_kalman(z)))\n    expect_false(anyNA(na_interpolation(z)))\n    expect_false(anyNA(na_locf(z)))\n    expect_false(anyNA(na_ma(z)))\n    expect_false(anyNA(na_random(z)))\n    expect_false(anyNA(na_seadec(z)))\n    expect_false(anyNA(na_seasplit(z)))\n    expect_false(anyNA(na_replace(z)))\n  }\n})\n\n\ntest_that(\"xts objects\", {\n  skip_on_cran()\n  if (!requireNamespace(\"xts\", quietly = TRUE)) {\n    warning(\"Pkg xts needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"xts\")\n    x <- as.xts(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\n\ntest_that(\"timeSeries objects\", {\n  skip_on_cran()\n\n  if (!requireNamespace(\"timeSeries\", quietly = TRUE)) {\n    warning(\"Pkg timeSeries needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"timeSeries\")\n    x <- as.timeSeries(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\n\n\ntest_that(\"tis objects\", {\n  skip_on_cran()\n\n  if (!requireNamespace(\"tis\", quietly = TRUE)) {\n    warning(\"Pkg timeSeries needed for this test.\",\n      call. = FALSE\n    )\n  }\n  else {\n    require(\"tis\")\n    x <- as.tis(tsAirgap)\n    expect_false(anyNA(na_mean(x)))\n    expect_false(anyNA(na_kalman(x)))\n    expect_false(anyNA(na_interpolation(x)))\n    expect_false(anyNA(na_locf(x)))\n    expect_false(anyNA(na_ma(x)))\n    expect_false(anyNA(na_random(x)))\n    expect_false(anyNA(na_seadec(x)))\n    #     expect_false(anyNA(na_seasplit(x)))\n    expect_false(anyNA(na_replace(x)))\n  }\n})\n\ntest_that(\"Imputation works for mts\", {\n  skip_on_cran()\n\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  x <- ts(x)\n  expect_false(anyNA(na_mean(x)))\n  expect_false(anyNA(na_kalman(x)))\n  expect_false(anyNA(na_interpolation(x)))\n  expect_false(anyNA(na_locf(x)))\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_random(x)))\n  expect_false(anyNA(na_seadec(x)))\n  expect_false(anyNA(na_seasplit(x)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  skip_on_cran()\n\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_mean(x)))\n  expect_false(anyNA(na_kalman(x)))\n  expect_false(anyNA(na_interpolation(x)))\n  expect_false(anyNA(na_locf(x)))\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_random(x)))\n  expect_false(anyNA(na_seadec(x)))\n  expect_false(anyNA(na_seasplit(x)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Imputation works for data.frame univariate\", {\n  skip_on_cran()\n\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap)\n  expect_false(anyNA(na_mean(x)))\n  expect_false(anyNA(na_kalman(x)))\n  expect_false(anyNA(na_interpolation(x)))\n  expect_false(anyNA(na_locf(x)))\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_random(x)))\n  expect_false(anyNA(na_seadec(x)))\n  expect_false(anyNA(na_seasplit(x)))\n  expect_false(anyNA(na_replace(x)))\n})\n\n\ntest_that(\"Imputation works for matrix\", {\n  skip_on_cran()\n\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  x <- as.matrix(x)\n  expect_false(anyNA(na_mean(x)))\n  expect_false(anyNA(na_kalman(x)))\n  expect_false(anyNA(na_interpolation(x)))\n  expect_false(anyNA(na_locf(x)))\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_random(x)))\n  expect_false(anyNA(na_seadec(x)))\n  expect_false(anyNA(na_seasplit(x)))\n  expect_false(anyNA(na_replace(x)))\n})\n\n\ntest_that(\"Imputation works for matrix univariate\", {\n  skip_on_cran()\n\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap)\n  x <- as.matrix(x)\n  expect_false(anyNA(na_mean(x)))\n  expect_false(anyNA(na_kalman(x)))\n  expect_false(anyNA(na_interpolation(x)))\n  expect_false(anyNA(na_locf(x)))\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_random(x)))\n  expect_false(anyNA(na_seadec(x)))\n  expect_false(anyNA(na_seasplit(x)))\n  expect_false(anyNA(na_replace(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_interpolation.R",
    "content": "context(\"na_interpolation\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_interpolation(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\", rule = 1), na.rm = T), digits = 1), 264.9)\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\")), digits = 1), 273.6)\n  expect_equal(round(mean(na_interpolation(x, option = \"spline\")), digits = 1), 276.2)\n  expect_equal(round(mean(na_interpolation(x, option = \"stine\")), digits = 1), 273.4)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\", rule = 1), na.rm = T), digits = 1), 286.4)\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\")), digits = 1), 281.1)\n  expect_equal(round(mean(na_interpolation(x, option = \"spline\")), digits = 1), 283.0)\n  expect_equal(round(mean(na_interpolation(x, option = \"stine\")), digits = 1), 280.8)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\", rule = 1), na.rm = T), digits = 1), 280.7)\n  expect_equal(round(mean(na_interpolation(x, option = \"linear\")), digits = 1), 280.7)\n  expect_equal(round(mean(na_interpolation(x, option = \"spline\")), digits = 1), 280.1)\n  expect_equal(round(mean(na_interpolation(x, option = \"stine\")), digits = 1), 280.5)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_interpolation(x, option = \"linear\", rule = 1)))\n  expect_false(anyNA(na_interpolation(x, option = \"linear\")))\n  expect_false(anyNA(na_interpolation(x, option = \"spline\")))\n  expect_false(anyNA(na_interpolation(x, option = \"stine\")))\n})\n\ntest_that(\"Warning for wrong input for option parameter\", {\n  expect_error(na_interpolation(tsAirgap, option = \"wrongOption\"))\n})\n\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_equal(length(na.omit(na_interpolation(x, option = \"linear\", rule = 1))), 142)\n  expect_false(anyNA(na_interpolation(x, option = \"linear\")))\n  expect_false(anyNA(na_interpolation(x, option = \"spline\")))\n  expect_false(anyNA(na_interpolation(x, option = \"stine\")))\n  expect_false(anyNA(na_interpolation(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_equal(length(na.omit(na_interpolation(x, option = \"linear\", rule = 1))), 142)\n  expect_false(anyNA(na_interpolation(x, option = \"linear\")))\n  expect_false(anyNA(na_interpolation(x, option = \"spline\")))\n  expect_false(anyNA(na_interpolation(x, option = \"stine\")))\n  expect_false(anyNA(na_interpolation(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_equal(length(na.omit(na_interpolation(x, option = \"linear\", rule = 1))), 144)\n  expect_false(anyNA(na_interpolation(x, option = \"linear\")))\n  expect_false(anyNA(na_interpolation(x, option = \"spline\")))\n  expect_false(anyNA(na_interpolation(x, option = \"stine\")))\n  expect_false(anyNA(na_interpolation(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_equal(length(na.omit(na_interpolation(x, option = \"linear\", rule = 1))), 144)\n  expect_false(anyNA(na_interpolation(x, option = \"linear\")))\n  expect_false(anyNA(na_interpolation(x, option = \"spline\")))\n  expect_false(anyNA(na_interpolation(x, option = \"stine\")))\n  expect_false(anyNA(na_interpolation(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_kalman.R",
    "content": "context(\"na_kalman\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_kalman(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Workaround solution for constant values for StructTS works\", {\n  x <- c(4,4,4,4,NA,4,4,4)\n  expect_equal(round(mean(na_kalman(x, model = \"StructTS\", smooth = T)), digits = 1), 4)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = T)), digits = 1), 280.3)\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = F)), digits = 1), 279.2)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = T)), digits = 1), 284.8)\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = F)), digits = 1), 291.6)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = T)), digits = 1), 280.2)\n  expect_equal(round(mean(na_kalman(x, model = \"auto.arima\", smooth = F)), digits = 1), 279.8)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = F)))\n})\n\ntest_that(\"Warning for wrong input for model parameter\", {\n  expect_error(na_kalman(tsAirgap, model = \"wrongModel\"))\n})\n\ntest_that(\"Warning for wrong input for smooth parameter\", {\n  expect_error(na_kalman(tsAirgap, smooth = \"Wrong\"))\n})\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = F)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = F)))\n  expect_false(anyNA(na_kalman(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = F)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = F)))\n  expect_false(anyNA(na_kalman(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = F)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = F)))\n  expect_false(anyNA(na_kalman(x)))\n})\n\ntest_that(\"Over 50% NAs\", {\n  x <- tsAirgap\n  x[30:100] <- NA\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"auto.arima\", smooth = F)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = T)))\n  expect_false(anyNA(na_kalman(x, model = \"StructTS\", smooth = F)))\n  expect_false(anyNA(na_kalman(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_locf.R",
    "content": "context(\"na_locf\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_locf(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"mean\")), digits = 1), 271.9)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"mean\")), digits = 1), 266.7)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rev\")), digits = 1), 271.9)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rev\")), digits = 1), 275.3)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rm\")), digits = 1), 271.9)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), digits = 1), 266.7)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"keep\"), na.rm = T), digits = 1), 271.9)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"keep\"), na.rm = T), digits = 1), 266.7)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"mean\")), digits = 1), 284.3)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"mean\")), digits = 1), 283.0)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rev\")), digits = 1), 279.2)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rev\")), digits = 1), 283.0)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rm\")), digits = 1), 284.3)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), digits = 1), 283.0)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"keep\"), na.rm = T), digits = 1), 284.3)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"keep\"), na.rm = T), digits = 1), 283.0)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"mean\")), digits = 1), 278.8)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"mean\")), digits = 1), 282.7)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rev\")), digits = 1), 278.8)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rev\")), digits = 1), 282.7)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"rm\")), digits = 1), 278.8)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), digits = 1), 282.7)\n  expect_equal(round(mean(na_locf(x, option = \"locf\", na_remaining = \"keep\"), na.rm = T), digits = 1), 278.8)\n  expect_equal(round(mean(na_locf(x, option = \"nocb\", na_remaining = \"keep\"), na.rm = T), digits = 1), 282.7)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rm\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rm\")))\n})\n\n\n\ntest_that(\"Warning for wrong input for option parameter\", {\n  expect_error(na_locf(tsAirgap, option = \"wrongOption\"))\n})\n\ntest_that(\"Warning for wrong input for na_remaining parameter\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_error(na_locf(x, na_remaining = \"Wrong\"))\n})\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rev\")))\n  expect_equal(length(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), 144)\n  expect_equal(length(na_locf(x, option = \"locf\", na_remaining = \"rm\")), 142)\n  expect_equal(length(na_locf(x, option = \"nocb\", na_remaining = \"keep\")), 144)\n\n  expect_false(anyNA(na_locf(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rev\")))\n  expect_equal(length(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), 142)\n  expect_equal(length(na_locf(x, option = \"locf\", na_remaining = \"rm\")), 144)\n  expect_false(anyNA(na_locf(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rev\")))\n  expect_equal(length(na_locf(x, option = \"nocb\", na_remaining = \"rm\")), 144)\n  expect_equal(length(na_locf(x, option = \"locf\", na_remaining = \"rm\")), 144)\n  expect_false(anyNA(na_locf(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"locf\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"mean\")))\n  expect_false(anyNA(na_locf(x, option = \"nocb\", na_remaining = \"rev\")))\n  expect_false(anyNA(na_locf(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_ma.R",
    "content": "context(\"na_ma\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_ma(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 4)), digits = 1), 275.2)\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 20)), digits = 1), 276.1)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 4)), digits = 1), 275.0)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 20)), digits = 1), 276.1)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 4)), digits = 1), 274.6)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 20)), digits = 1), 274.7)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 4)), digits = 1), 282.1)\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 20)), digits = 1), 281.1)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 4)), digits = 1), 281.9)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 20)), digits = 1), 281.3)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 4)), digits = 1), 281.7)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 20)), digits = 1), 281.6)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 4)), digits = 1), 281.5)\n  expect_equal(round(mean(na_ma(x, weighting = \"simple\", k = 20)), digits = 1), 280.7)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 4)), digits = 1), 281.3)\n  expect_equal(round(mean(na_ma(x, weighting = \"linear\", k = 20)), digits = 1), 280.9)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 4)), digits = 1), 281.2)\n  expect_equal(round(mean(na_ma(x, weighting = \"exponential\", k = 20)), digits = 1), 281.1)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_ma(x)))\n  expect_false(anyNA(na_ma(x, weighting = \"simple\", k = 4)))\n  expect_false(anyNA(na_ma(x, weighting = \"simple\", k = 20)))\n  expect_false(anyNA(na_ma(x, weighting = \"linear\", k = 4)))\n  expect_false(anyNA(na_ma(x, weighting = \"linear\", k = 20)))\n  expect_false(anyNA(na_ma(x, weighting = \"exponential\", k = 4)))\n  expect_false(anyNA(na_ma(x, weighting = \"exponential\", k = 20)))\n})\n\n\ntest_that(\"Warning for wrong input for k parameter\", {\n  expect_error(na_ma(tsAirgap, k = -1))\n})\n\ntest_that(\"Warning for wrong input for weighting parameter\", {\n  expect_error(na_ma(tsAirgap, weighting = \"Wrong\"))\n})\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"simple\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"linear\")))\n  expect_false(anyNA(na_ma(x, k = 4, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 1, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x, k = 20, weighting = \"exponential\")))\n  expect_false(anyNA(na_ma(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_mean.R",
    "content": "context(\"na_mean\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_mean(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_mean(x, option = \"median\")), digits = 1), 260.0)\n  expect_equal(round(mean(na_mean(x, option = \"mean\")), digits = 1), 264.1)\n  expect_equal(round(mean(na_mean(x, option = \"mode\")), digits = 1), 258.8)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_mean(x, option = \"median\")), digits = 1), 282.7)\n  expect_equal(round(mean(na_mean(x, option = \"mean\")), digits = 1), 284.8)\n  expect_equal(round(mean(na_mean(x, option = \"mode\")), digits = 1), 278.2)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_mean(x, option = \"median\")), digits = 1), 277.9)\n  expect_equal(round(mean(na_mean(x, option = \"mean\")), digits = 1), 279.8)\n  expect_equal(round(mean(na_mean(x, option = \"mode\")), digits = 1), 275.2)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_mean(x, option = \"mean\")))\n  expect_false(anyNA(na_mean(x, option = \"mode\")))\n  expect_false(anyNA(na_mean(x, option = \"median\")))\n})\n\ntest_that(\"Warning for wrong input for option parameter\", {\n  expect_error(na_mean(tsAirgap, option = \"Wrong\"))\n})\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:4] <- NA\n  expect_false(anyNA(na_mean(x, option = \"mean\")))\n  expect_false(anyNA(na_mean(x, option = \"mode\")))\n  expect_false(anyNA(na_mean(x, option = \"median\")))\n  expect_false(anyNA(na_mean(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[140:144] <- NA\n  expect_false(anyNA(na_mean(x, option = \"mean\")))\n  expect_false(anyNA(na_mean(x, option = \"mode\")))\n  expect_false(anyNA(na_mean(x, option = \"median\")))\n  expect_false(anyNA(na_mean(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_mean(x, option = \"mean\")))\n  expect_false(anyNA(na_mean(x, option = \"mode\")))\n  expect_false(anyNA(na_mean(x, option = \"median\")))\n  expect_false(anyNA(na_mean(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_mean(x, option = \"mean\")))\n  expect_false(anyNA(na_mean(x, option = \"mode\")))\n  expect_false(anyNA(na_mean(x, option = \"median\")))\n  expect_false(anyNA(na_mean(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_random.R",
    "content": "context(\"na_random\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_random(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Wrong input\", {\n  x <- data.frame(tsAirgap)\n  expect_error(na_random(x, lower_bound = 1, upper_bound = -1))\n\n  x <- rep(\"string\", 144)\n  x[3] <- NA\n  expect_error(na_random(x))\n\n  x <- rep(NA, 144)\n  expect_error(na_random(x))\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_random(x)))\n})\n\n\ntest_that(\"Error for lower_bound > upper_bound\", {\n  expect_error(na_random(tsAirgap, lower_bound = 300, upper_bound = 100))\n})\n\n\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_random(x, lower_bound = 100, upper_bound = 200)))\n  expect_false(anyNA(na_random(x, lower_bound = -10, upper_bound = 5000)))\n  expect_false(anyNA(na_random(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_random(x, lower_bound = 100, upper_bound = 200)))\n  expect_false(anyNA(na_random(x, lower_bound = -10, upper_bound = 5000)))\n  expect_false(anyNA(na_random(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_random(x, lower_bound = 100, upper_bound = 200)))\n  expect_false(anyNA(na_random(x, lower_bound = -10, upper_bound = 5000)))\n  expect_false(anyNA(na_random(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_random(x, lower_bound = 100, upper_bound = 200)))\n  expect_false(anyNA(na_random(x, lower_bound = -10, upper_bound = 5000)))\n  expect_false(anyNA(na_random(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_remove.R",
    "content": "context(\"na_remove\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_remove(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Wrong input\", {\n  x <- data.frame(tsAirgap, tsAirgap)\n  expect_error(na_remove(x))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_remove(x)), digits = 1), 264.1)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_remove(x)), digits = 1), 284.8)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_remove(x)), digits = 1), 279.8)\n})\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgapComplete\n  x[1:2] <- NA\n  expect_equal(length(na_remove(x)), 142)\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgapComplete\n  x[143:144] <- NA\n  expect_equal(length(na_remove(x)), 142)\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgapComplete\n  x[40:80] <- NA\n  expect_equal(length(na_remove(x)), 103)\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgapComplete\n  x[10:140] <- NA\n  expect_equal(length(na_remove(x)), 13)\n})\n"
  },
  {
    "path": "tests/testthat/test-na_replace.R",
    "content": "context(\"na_replace\")\n\n\ntest_that(\"All NA vector throws no error\", {\n  expect_equal(sum(na_replace(c(NA, NA, NA, NA, NA), fill = 2.0)), 10.0)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_replace(x, fill = -1)), digits = 1), 223.6)\n  expect_equal(round(mean(na_replace(x, fill = 200)), digits = 1), 254.3)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_replace(x, fill = -1)), digits = 1), 251.0)\n  expect_equal(round(mean(na_replace(x, fill = 200)), digits = 1), 274.8)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_replace(x, fill = -1)), digits = 1), 254.5)\n  expect_equal(round(mean(na_replace(x, fill = 200)), digits = 1), 272.6)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_replace(x, fill = -1)))\n  expect_false(anyNA(na_replace(x, fill = 200)))\n})\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_replace(x, fill = -5)))\n  expect_false(anyNA(na_replace(x, fill = 1000)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_replace(x, fill = -5)))\n  expect_false(anyNA(na_replace(x, fill = 1000)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_replace(x, fill = -5)))\n  expect_false(anyNA(na_replace(x, fill = 1000)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_replace(x, fill = -5)))\n  expect_false(anyNA(na_replace(x, fill = 1000)))\n  expect_false(anyNA(na_replace(x)))\n})\n\ntest_that(\"Handling for no NAs\", {\n  x <- tsAirgapComplete\n  expect_false(anyNA(na_replace(x)))\n})\n"
  },
  {
    "path": "tests/testthat/test-na_seadec.R",
    "content": "context(\"na_seadec\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_seadec(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_seadec(x, algorithm = \"interpolation\")), digits = 1), 276.7)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"locf\")), digits = 1), 276.0)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"mean\")), digits = 1), 264.3)\n  expect_true(round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 277 &\n    round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 283)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"ma\")), digits = 1), 277.1)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_seadec(x, algorithm = \"interpolation\")), digits = 1), 279.9)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"locf\")), digits = 1), 279.2)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"mean\")), digits = 1), 284.1)\n  expect_true(round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 282 &\n    round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 288)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"ma\")), digits = 1), 280.0)\n})\n\ntest_that(\"Given frequency is  overwritten by findFrequency=T\", {\n  x <- ts(data = c(1,1,99,99,1,1,99,99,1,NA,99,99,1,1,99,99,1,1,99,99,1,1,99,99,1,1), frequency = 12)\n  imp <- na_seadec(x, find_frequency = TRUE) # new detected frequency = 4\n  expect_equal(frequency(imp),4)\n})\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_seadec(x, algorithm = \"interpolation\")), digits = 1), 280.4)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"locf\")), digits = 1), 279.7)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"mean\")), digits = 1), 279.5)\n  expect_true(round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 277 &\n    round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 283)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"ma\")), digits = 1), 280.6)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n})\n\n\ntest_that(\"Warning for wrong input for algorithm parameter\", {\n  expect_error(na_seadec(tsAirgap, algorithm = \"wrong\"))\n})\n\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x)))\n})\n\ntest_that(\"Over 90% NAs\", {\n  x <- tsAirgap\n  x[10:140] <- NA\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x)))\n})\ntest_that(\"No Seasonality in series\", {\n  x <- ts(c(3, 5, 6, 7, 8, 4, 5, 6, NA, NA, 5, 7, 4, 2, NA, NA, 5, 7, 8))\n  expect_false(anyNA(na_seadec(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seadec(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seadec(x)))\n})\n\ntest_that(\"Handling for no NAs\", {\n  x <- tsAirgapComplete\n  expect_false(anyNA(na_seadec(x)))\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset with find frequency\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- as.vector(tsAirgap)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"interpolation\", find_frequency = TRUE)), digits = 1), 280.4)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"interpolation\", find_frequency = FALSE)), digits = 1), 280.7)\n\n  # Test if set frequencys are accepted as expected for find_frequency= F\n  expect_equal(round(mean(na_seadec(ts(x, frequency = 2), algorithm = \"interpolation\", find_frequency = FALSE)), digits = 1), 280.8)\n\n  # Test if find_frequency works\n  expect_equal(round(mean(na_seadec(ts(x, frequency = 2), algorithm = \"interpolation\", find_frequency = TRUE)), digits = 1), 280.4)\n\n\n  expect_equal(round(mean(na_seadec(x, algorithm = \"locf\", find_frequency = TRUE)), digits = 1), 279.7)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"locf\", find_frequency = FALSE)), digits = 1), 278.8)\n\n  expect_equal(round(mean(na_seadec(x, algorithm = \"mean\", find_frequency = TRUE)), digits = 1), 279.5)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"mean\", find_frequency = FALSE)), digits = 1), 279.8)\n\n  expect_true(round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\", find_frequency = TRUE)), digits = 1) > 277 &\n    round(mean(na_seadec(x, algorithm = \"kalman\", model = \"auto.arima\", find_frequency = TRUE)), digits = 1) < 283)\n\n  expect_equal(round(mean(na_seadec(x, algorithm = \"ma\", find_frequency = TRUE)), digits = 1), 280.6)\n  expect_equal(round(mean(na_seadec(x, algorithm = \"ma\", find_frequency = FALSE)), digits = 1), 281.2)\n})\n"
  },
  {
    "path": "tests/testthat/test-na_seasplit.R",
    "content": "context(\"na_seasplit\")\n\ntest_that(\"All NA vector throws error\", {\n  expect_error(na_seasplit(c(NA, NA, NA, NA, NA)))\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at end)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[135:144] <- NA\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"interpolation\")), digits = 1), 276.6)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"locf\")), digits = 1), 274.8)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"mean\")), digits = 1), 264.0)\n  expect_true(round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 273 &\n    round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 277)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"ma\")), digits = 1), 275.0)\n})\n\ntest_that(\"Correct results for all options with a modifed tsAirgap dataset (additionalNAs at start)\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  x[1:5] <- NA\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"interpolation\")), digits = 1), 280.5)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"locf\")), digits = 1), 278.4)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"mean\")), digits = 1), 283.4)\n  expect_true(round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 276 &\n    round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 280)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"ma\")), digits = 1), 281.1)\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- tsAirgap\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"interpolation\")), digits = 1), 280.3)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"locf\")), digits = 1), 278.2)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"mean\")), digits = 1), 279.3)\n  expect_true(round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) > 277 &\n    round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\")), digits = 1) < 281)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"ma\")), digits = 1), 280.3)\n})\n\ntest_that(\"Imputation works for data.frame\", {\n  # Checking if NAs remain in data.frame\n  x <- data.frame(tsAirgap, tsAirgap, tsAirgapComplete)\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n})\n\n\n\ntest_that(\"Warning for wrong input for algorithm parameter\", {\n  expect_error(na_seasplit(tsAirgap, algorithm = \"wrong\"))\n})\n\n\n\ntest_that(\"Test NA at beginning\", {\n  x <- tsAirgap\n  x[1:2] <- NA\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x)))\n})\n\ntest_that(\"Test NA at end\", {\n  x <- tsAirgap\n  x[143:144] <- NA\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x)))\n})\n\ntest_that(\"Multiple NAs in a row\", {\n  x <- tsAirgap\n  x[40:80] <- NA\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x)))\n})\n\ntest_that(\"Over 50% NAs\", {\n  x <- tsAirgap\n  x[30:100] <- NA\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x)))\n})\n\ntest_that(\"No Seasonality in series\", {\n  x <- ts(c(3, 5, 6, 7, 8, 4, 5, 6, NA, NA, 5, 7, 4, 2, NA, NA, 5, 7, 8))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"interpolation\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"kalman\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"locf\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"ma\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"mean\")))\n  expect_false(anyNA(na_seasplit(x, algorithm = \"random\")))\n  expect_false(anyNA(na_seasplit(x)))\n})\n\ntest_that(\"Handling for no NAs\", {\n  x <- tsAirgapComplete\n  expect_false(anyNA(na_seasplit(x)))\n})\n\n\ntest_that(\"Correct results for all options with the tsAirgap dataset for find_frequency\", {\n  skip_on_cran()\n  # Using mean over resulting vector to check correctness\n  # In order to avoid writing down the complete resulting vector\n  # Using rounded version in order to avoid writing down all decimals\n  x <- as.vector(tsAirgap)\n\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"interpolation\", find_frequency = TRUE)), digits = 1), 280.3)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"interpolation\", find_frequency = FALSE)), digits = 1), 280.7)\n\n  # Check that other frequencys lead to different result if find_frequency is FALSE\n  expect_equal(round(mean(na_seasplit(ts(x, frequency = 2), algorithm = \"interpolation\", find_frequency = FALSE)), digits = 1), 281.7)\n\n  # Check that find_frequency overrides frequency for find_frequency = T\n  expect_equal(round(mean(na_seasplit(ts(x, frequency = 2), algorithm = \"interpolation\", find_frequency = TRUE)), digits = 1), 280.3)\n\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"locf\", find_frequency = TRUE)), digits = 1), 278.2)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"locf\", find_frequency = FALSE)), digits = 1), 278.8)\n\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"mean\", find_frequency = TRUE)), digits = 1), 279.3)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"mean\", find_frequency = FALSE)), digits = 1), 279.8)\n\n\n  expect_true(round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\", find_frequency = TRUE)), digits = 1) > 277 &\n    round(mean(na_seasplit(x, algorithm = \"kalman\", model = \"auto.arima\", find_frequency = TRUE)), digits = 1) < 281)\n\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"ma\", find_frequency = TRUE)), digits = 1), 280.3)\n  expect_equal(round(mean(na_seasplit(x, algorithm = \"ma\", find_frequency = FALSE)), digits = 1), 281.2)\n})\n"
  },
  {
    "path": "tests/testthat/test-parameter-maxgap.R",
    "content": "context(\"maxgap\")\n\n\ntest_that(\"Test that function works and prints output\", {\n  x <- tsAirgap\n  x[4] <- NA\n  x[144] <- NA\n  x[143] <- NA\n  expect_equal(sum(is.na(na_mean(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_mean(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_mean(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_mean(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_mean(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_locf(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_locf(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_locf(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_locf(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_locf(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_random(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_random(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_random(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_random(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_random(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_ma(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_ma(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_ma(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_ma(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_ma(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_seadec(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_seadec(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_seadec(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_seadec(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_seadec(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_seasplit(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_seasplit(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_seasplit(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_seasplit(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_seasplit(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_kalman(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_kalman(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_kalman(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_kalman(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_kalman(x, maxgap = 3))), 0)\n\n  expect_equal(sum(is.na(na_interpolation(x, maxgap = 1))), 7)\n  expect_equal(sum(is.na(na_interpolation(x, maxgap = 0))), 16)\n  expect_equal(sum(is.na(na_interpolation(x, maxgap = -1))), 0)\n  expect_equal(sum(is.na(na_interpolation(x, maxgap = 2))), 3)\n  expect_equal(sum(is.na(na_interpolation(x, maxgap = 3))), 0)\n})\n"
  },
  {
    "path": "tests/testthat/test-statsNA.R",
    "content": "context(\"statsNA\")\n\n\ntest_that(\"Test that function works and prints output\", {\n  expect_output(statsNA(tsAirgap, print_only = T))\n})\n\n\ntest_that(\"Test results of function\", {\n  expect_equal(statsNA(tsAirgap, print_only = F)$number_NAs, 13)\n  expect_equal(statsNA(tsAirgap, print_only = F)$longest_na_gap, 3)\n  expect_equal(statsNA(tsAirgap, print_only = F)$most_weighty_na_gap, 1)\n  expect_equal(statsNA(tsAirgap, print_only = F)$most_frequent_na_gap, 1)\n  expect_equal(statsNA(tsAirgap, print_only = F)$length_series, 144)\n  expect_equal(statsNA(tsAirgap, print_only = F)$number_na_gaps, 11)\n  expect_true(statsNA(tsNH4, print_only = F)$average_size_na_gaps > 5)\n})\n"
  },
  {
    "path": "tests/testthat.R",
    "content": "library(testthat)\ntest_check(\"imputeTS\")\n"
  },
  {
    "path": "vignettes/Cheat_Sheet_imputeTS.pdf.asis",
    "content": "%\\VignetteIndexEntry{Cheat Sheet imputeTS}\n%\\VignetteEngine{R.rsp::asis}\n%\\VignetteKeyword{PDF}\n%\\VignetteKeyword{HTML}\n%\\VignetteKeyword{vignette}\n%\\VignetteKeyword{package}"
  },
  {
    "path": "vignettes/RJournal.sty",
    "content": "% Package `RJournal' to use with LaTeX2e\n% Copyright (C) 2010 by the R Foundation\n% Copyright (C) 2013 by the R Journal\n%\n% Originally written by Kurt Hornik and Friedrich Leisch with subsequent \n% edits by the editorial board\n\n\\NeedsTeXFormat{LaTeX2e}[1995/12/01]\n\\ProvidesPackage{RJournal}[2013/08/27 v0.13 RJournal package]\n\n\\RequirePackage{tikz}\n\n% Overall page layout, fonts etc -----------------------------------------------\n\n% Issues of of \\emph{The R Journal} are created from the standard \\LaTeX{}\n% document class \\pkg{report}. \n\n\\RequirePackage{geometry}\n\\geometry{a4paper, \n   textwidth=14cm, top=1cm, bottom=1cm,\n   includehead,includefoot,centering,\n   footskip=1.5cm}\n\\raggedbottom\n\n\\RequirePackage{fancyhdr}\n\\fancyhead{}\n\\fancyheadoffset{2cm} \n\\fancyhead[L]{\\textsc{\\RJ@sectionhead}}\n\\fancyhead[R]{\\thepage}\n\\fancyfoot{}\n\\fancyfoot[L]{The R Journal Vol. \\RJ@volume/\\RJ@number, \\RJ@month~\\RJ@year}\n\\fancyfoot[R]{ISSN 2073-4859}\n\\pagestyle{fancy}\n\n% We use the following fonts (all with T1 encoding):\n% \n%   rm   & palatino\n%   tt   & inconsolata\n%   sf   & helvetica\n%   math & palatino\n\n\\RequirePackage{microtype}\n\n\\RequirePackage[scaled=0.92]{helvet}\n\\RequirePackage{palatino,mathpazo}\n\\RequirePackage[scaled=1.02]{inconsolata}\n\\RequirePackage[T1]{fontenc}\n\n\\RequirePackage[hyphens]{url}\n\\RequirePackage[pagebackref]{hyperref}\n\\renewcommand{\\backref}[1]{[p#1]}\n\n% Dark blue colour for all links\n\\RequirePackage{color}\n\\definecolor{link}{rgb}{0.45,0.51,0.67}\n\\hypersetup{\n  colorlinks,%\n  citecolor=link,%\n  filecolor=link,%\n  linkcolor=link,%\n  urlcolor=link\n}\n\n% Give the text a little room to breath\n\\setlength{\\parskip}{3pt}\n\\RequirePackage{setspace}\n\\setstretch{1.05}\n\n% Issue and article metadata ---------------------------------------------------\n\n% Basic front matter information about the issue: volume, number, and\n% date.\n\n\\newcommand{\\volume}[1]{\\def\\RJ@volume{#1}}\n\\newcommand{\\volnumber}[1]{\\def\\RJ@number{#1}}\n\\renewcommand{\\month}[1]{\\def\\RJ@month{#1}}\n\\renewcommand{\\year}[1]{\\def\\RJ@year{#1}}\n\n\n% Individual articles correspond to\n% chapters, and are contained in |article| environments.  This makes it\n% easy to have figures counted within articles and hence hyperlinked\n% correctly.\n\n% An article has an author, a title, and optionally a subtitle.  We use\n% the obvious commands for specifying these. Articles will be put in certain\n% journal sections, named by \\sectionhead.\n\n\\newcommand  {\\sectionhead}  [1]{\\def\\RJ@sectionhead{#1}}\n\\renewcommand{\\author}       [1]{\\def\\RJ@author{#1}}\n\\renewcommand{\\title}        [1]{\\def\\RJ@title{#1}}\n\\newcommand  {\\subtitle}     [1]{\\def\\RJ@subtitle{#1}}\n\n% Control appearance of titles: make slightly smaller than usual, and \n% suppress section numbering. See http://tex.stackexchange.com/questions/69749\n% for why we don't use \\setcounter{secnumdepth}{-1} \n\n\\usepackage[medium]{titlesec}\n\\usepackage{titletoc}\n\\titleformat{\\section}   {\\normalfont\\large\\bfseries}{}{0em}{}\n\\titleformat{\\subsection}{\\normalfont\\normalsize\\bfseries}{}{0em}{}\n\\titlecontents{chapter}   [0em]{}{}{}{\\titlerule*[1em]{.}\\contentspage}\n\n% Article layout ---------------------------------------------------------------\n\n% Environment |article| clears the article header information at its beginning. \n% We use |\\FloatBarrier| from the placeins package to keep floats within\n% the article.\n\\RequirePackage{placeins}\n\\newenvironment{article}{\\author{}\\title{}\\subtitle{}\\FloatBarrier}{\\FloatBarrier}\n\n% Refereed articles should have an abstract, so we redefine |\\abstract| to\n% give the desired style\n\n\\renewcommand{\\abstract}[1]{%\n\\setstretch{1}%\n\\noindent%\n\\small%\n\\textbf{Abstract} #1 \n}\n\n% The real work is done by a redefined version of |\\maketitle|.  Note\n% that even though we do not want chapters (articles) numbered, we\n% need to increment the chapter counter, so that figures get correct\n% labelling.\n\n\\renewcommand{\\maketitle}{%\n\\noindent\n  \\chapter{\\RJ@title}\\refstepcounter{chapter}\n  \\ifx\\empty\\RJ@subtitle\n  \\else\n    \\noindent\\textbf{\\RJ@subtitle}\n    \\par\\nobreak\\addvspace{\\baselineskip}\n  \\fi\n  \\ifx\\empty\\RJ@author\n  \\else\n    \\noindent\\textit{\\RJ@author}\n    \\par\\nobreak\\addvspace{\\baselineskip}\n  \\fi\n  \\@afterindentfalse\\@nobreaktrue\\@afterheading\n}\n\n% Now for some ugly redefinitions.  We do not want articles to start a\n% new page. (Actually, we do, but this is handled via explicit\n% \\newpage\n%\n% The name@of@eq is a hack to get hyperlinks to equations to work\n% within each article, even though there may be multiple eq.(1)\n%    \\begin{macrocode}\n\\renewcommand\\chapter{\\secdef\\RJ@chapter\\@schapter}\n\\providecommand{\\nohyphens}{%\n  \\hyphenpenalty=10000\\exhyphenpenalty=10000\\relax}\n\\newcommand{\\RJ@chapter}{%\n  \\edef\\name@of@eq{equation.\\@arabic{\\c@chapter}}%\n  \\renewcommand{\\@seccntformat}[1]{}%\n  \\@startsection{chapter}{0}{0mm}{%\n    -2\\baselineskip \\@plus -\\baselineskip \\@minus -.2ex}{\\p@}{%\n    \\phantomsection\\normalfont\\huge\\bfseries\\raggedright}}\n\n% Book reviews should appear as sections in the text and in the pdf bookmarks,\n% however we wish them to appear as chapters in the TOC. Thus we define an\n% alternative to |\\maketitle| for reviews.\n\\newcommand{\\review}[1]{\n  \\pdfbookmark[1]{#1}{#1}\n  \\section*{#1}\n  \\addtocontents{toc}{\\protect\\contentsline{chapter}{#1}{\\thepage}{#1.1}}\n}\n\n% We want bibliographies as starred sections within articles.\n% \n\\RequirePackage[sectionbib,round]{natbib}\n\\bibliographystyle{abbrvnat}\n\n% Equations, figures and tables are counted within articles, but we do\n% not show the article number. For equations it becomes a bit messy to avoid\n% having hyperref getting it wrong. \n\n% \\numberwithin{equation}{chapter}\n\\renewcommand{\\theequation}{\\@arabic\\c@equation}\n\\renewcommand{\\thefigure}{\\@arabic\\c@figure}\n\\renewcommand{\\thetable}{\\@arabic\\c@table}\n\n% Issue layout -----------------------------------------------------------------\n\n% Need to provide our own version of |\\tableofcontents|. We use the\n% tikz package to get the rounded rectangle. Notice that |\\section*|\n% is really the same as |\\chapter*|.\n\\renewcommand{\\contentsname}{Contents}\n\\renewcommand\\tableofcontents{%\n   \\vspace{1cm}\n   \\section*{\\contentsname}\n   { \\@starttoc{toc} }\n}\n\n\\renewcommand{\\titlepage}{%\n  \\thispagestyle{empty}\n  \\hypersetup{\n    pdftitle={The R Journal Volume \\RJ@volume/\\RJ@number, \\RJ@month \\RJ@year},%\n    pdfauthor={R Foundation for Statistical Computing},%\n  }\n  \\noindent\n  \\begin{center}\n    \\fontsize{50pt}{50pt}\\selectfont\n    The \\raisebox{-8pt}{\\includegraphics[height=77pt]{Rlogo-5}}\\hspace{10pt}\n    Journal\n  \n  \\end{center}\n  {\\large \\hfill Volume \\RJ@volume/\\RJ@number, \\RJ@month{} \\RJ@year \\quad}\n\n  \\rule{\\textwidth}{1pt}\n  \\begin{center}\n    {\\Large A peer-reviewed, open-access publication of the \\\\\n    R Foundation for Statistical Computing}\n  \\end{center}\n\n  % And finally, put in the TOC box. Note the way |tocdepth| is adjusted\n  % before and after producing the TOC: thus, we can ensure that only\n  % articles show up in the printed TOC, but that in the PDF version,\n  % bookmarks are created for sections and subsections as well (provided\n  % that the non-starred forms are used).\n  \\setcounter{tocdepth}{0}\n  \\tableofcontents\n  \\setcounter{tocdepth}{2}\n  \\clearpage\n}\n\n% Text formatting --------------------------------------------------------------\n\n\\newcommand{\\R}{R}\n\\newcommand{\\address}[1]{\\addvspace{\\baselineskip}\\noindent\\emph{#1}}\n\\newcommand{\\email}[1]{\\href{mailto:#1}{\\normalfont\\texttt{#1}}}\n\n% Simple font selection is not good enough.  For example, |\\texttt{--}|\n% gives `\\texttt{--}', i.e., an endash in typewriter font.  Hence, we\n% need to turn off ligatures, which currently only happens for commands\n% |\\code| and |\\samp| and the ones derived from them.  Hyphenation is\n% another issue; it should really be turned off inside |\\samp|.  And\n% most importantly, \\LaTeX{} special characters are a nightmare.  E.g.,\n% one needs |\\~{}| to produce a tilde in a file name marked by |\\file|.\n% Perhaps a few years ago, most users would have agreed that this may be\n% unfortunate but should not be changed to ensure consistency.  But with\n% the advent of the WWW and the need for getting `|~|' and `|#|' into\n% URLs, commands which only treat the escape and grouping characters\n% specially have gained acceptance\n\n\\DeclareRobustCommand\\code{\\bgroup\\@noligs\\@codex}\n\\def\\@codex#1{\\texorpdfstring%\n{{\\normalfont\\ttfamily\\hyphenchar\\font=-1 #1}}%\n{#1}\\egroup}\n\\newcommand{\\kbd}[1]{{\\normalfont\\texttt{#1}}}\n\\newcommand{\\key}[1]{{\\normalfont\\texttt{\\uppercase{#1}}}}\n\\DeclareRobustCommand\\samp{`\\bgroup\\@noligs\\@sampx}\n\\def\\@sampx#1{{\\normalfont\\texttt{#1}}\\egroup'}\n\\newcommand{\\var}[1]{{\\normalfont\\textsl{#1}}}\n\\let\\env=\\code\n\\newcommand{\\file}[1]{{`\\normalfont\\textsf{#1}'}}\n\\let\\command=\\code\n\\let\\option=\\samp\n\\newcommand{\\dfn}[1]{{\\normalfont\\textsl{#1}}}\n% \\acronym is effectively disabled since not used consistently\n\\newcommand{\\acronym}[1]{#1}\n\\newcommand{\\strong}[1]{\\texorpdfstring%\n{{\\normalfont\\fontseries{b}\\selectfont #1}}%\n{#1}}\n\\let\\pkg=\\strong\n\\newcommand{\\CRANpkg}[1]{\\href{https://CRAN.R-project.org/package=#1}{\\pkg{#1}}}%\n\\let\\cpkg=\\CRANpkg\n\\newcommand{\\ctv}[1]{\\href{https://CRAN.R-project.org/view=#1}{\\emph{#1}}}\n\\newcommand{\\BIOpkg}[1]{\\href{https://www.bioconductor.org/packages/release/bioc/html/#1.html}{\\pkg{#1}}}\n\n% Example environments ---------------------------------------------------------\n\\RequirePackage{fancyvrb}\n\\RequirePackage{alltt}\n\n\\DefineVerbatimEnvironment{example}{Verbatim}{}\n\\renewenvironment{example*}{\\begin{alltt}}{\\end{alltt}}\n\n% Support for output from Sweave, and generic session style code\n% These used to have fontshape=sl for Sinput/Scode/Sin, but pslatex\n% won't use a condensed font in that case.\n\n% Update (2015-05-28 by DS): remove fontsize=\\small to match example environment\n\n\\DefineVerbatimEnvironment{Sinput}{Verbatim}{}\n\\DefineVerbatimEnvironment{Soutput}{Verbatim}{}\n\\DefineVerbatimEnvironment{Scode}{Verbatim}{}\n\\DefineVerbatimEnvironment{Sin}{Verbatim}{}\n\\DefineVerbatimEnvironment{Sout}{Verbatim}{}\n\\newenvironment{Schunk}{}{}\n\n% Mathematics ------------------------------------------------------------------\n\n% The implementation of |\\operatorname| is similar to the mechanism\n% \\LaTeXe{} uses for functions like sin and cos, and simpler than the\n% one of \\AmSLaTeX{}.  We use |\\providecommand| for the definition in\n% order to keep the one of the \\pkg{amstex} if this package has\n% already been loaded.\n%    \\begin{macrocode}\n\\providecommand{\\operatorname}[1]{%\n  \\mathop{\\operator@font#1}\\nolimits}\n\\RequirePackage{amsfonts}\n\n\\renewcommand{\\P}{%\n  \\mathop{\\operator@font I\\hspace{-1.5pt}P\\hspace{.13pt}}}\n\\newcommand{\\E}{%\n  \\mathop{\\operator@font I\\hspace{-1.5pt}E\\hspace{.13pt}}}\n\\newcommand{\\VAR}{\\operatorname{var}}\n\\newcommand{\\COV}{\\operatorname{cov}}\n\\newcommand{\\COR}{\\operatorname{cor}}\n\n% Figures ----------------------------------------------------------------------\n\n\\RequirePackage[font=small,labelfont=bf]{caption}\n\n% Wide environments for figures and tables -------------------------------------\n\\RequirePackage{environ}\n\n% An easy way to make a figure span the full width of the page\n\\NewEnviron{widefigure}[1][]{\n\\begin{figure}[#1]\n\\advance\\leftskip-2cm\n\\begin{minipage}{\\dimexpr\\textwidth+4cm\\relax}%\n  \\captionsetup{margin=2cm}\n  \\BODY\n\\end{minipage}%\n\\end{figure}\n}\n\n\\NewEnviron{widetable}[1][]{\n\\begin{table}[#1]\n\\advance\\leftskip-2cm\n\\begin{minipage}{\\dimexpr\\textwidth+4cm\\relax}%\n  \\captionsetup{margin=2cm}\n  \\BODY\n\\end{minipage}%\n\\end{table}\n}\n"
  },
  {
    "path": "vignettes/gallery_visualizations.Rmd",
    "content": "---\ntitle: \"Gallery: Times Series Missing Data Visualizations\"\nauthor: \"Steffen Moritz\"\ndate: \"`r Sys.Date()`\"\noutput: rmarkdown::html_vignette\nvignette: >\n  %\\VignetteIndexEntry{Gallery: Times Series Missing Data Visualizations}\n  %\\VignetteEngine{knitr::rmarkdown}\n  %\\VignetteEncoding{UTF-8}\n---\n\n```{r knitr-setup, include = FALSE}\nknitr::opts_chunk$set(fig.align = \"center\",\n                      fig.width = 6,\n                      fig.height = 4,\n                      dpi = 100)\n```\n\nThere are multiple different plots for (univarate) time series missing data available in the imputeTS package. These can be grouped in the following three categories:\n\n- Getting an Overview (`ggplot_na_distribution`)\n- Deeper insights and missing data patterns (`ggplot_na_distribution2`, `ggplot_na_gapsize`)\n- Assessing/Exploring imputation results (`ggplot_na_imputations`)\n\n\n*This vignette showcases all of the available visualizations in the imputeTS package. More information on time series imputation and the imputeTS package in general can be found in this paper: [imputeTS: Time Series Missing Value Imputation in R](https://journal.r-project.org/archive/2017/RJ-2017-009/index.html).*\n\n\n\n## Getting a first overview  (`ggplot_na_distribution`)\n\nThe best starting point for getting an overview about the missing data in your (univariate) time series is the `ggplot_na_distribution()` plot. It gives a nice first overview where in the time series the missing values occur and how they are distributed. It also already gives a rough impression on how many missing data are in different intervals of the time series.\n\nUsage is easy: just supply the (univariate) time series to the function call. Only the time series is needed as input - all additional parameters are only needed to alter the appearance of the plot.\n\n```{r ggplot-na-distribution-example1, message=FALSE}\nlibrary(\"imputeTS\")\nggplot_na_distribution(tsAirgap)\n```\n\nIt is important to note, that the input itself needs to be univariate. For data types with multiple variables/columns only use the column you want to plot as input parameter `x`. The x-axis time information can be added with the `x_axis_labels` parameter - otherwise the consecutive index of observations in the series is used as x-axis tick label.\n\nThus for a data.frame `df` with multiple columns `df$date`, `df$value`, `df$another_value`, `df$yet_another_value` where we want to plot `df$value` with Dates on the x-axis the required function call would look like this:\n\n```{r create-df, results=F, echo = F, warning=FALSE, fig.show='hide'}\ndf <- structure(list(date = structure(c(-21185, -20819, -20454, -20089, \n-19724, -19358, -18993, -18628, -18263, -17897, -17532, -17167, \n-16802, -16436, -16071, -15706, -15341, -14975, -14610, -14245, \n-13880, -13514, -13149, -12784, -12419, -12053, -11688, -11323, \n-10958, -10592, -10227, -9862, -9497, -9131, -8766, -8401, -8036, \n-7670, -7305, -6940, -6575, -6209, -5844, -5479, -5114, -4748, \n-4383, -4018, -3653, -3287, -2922, -2557, -2192, -1826, -1461, \n-1096, -731, -365, 0, 365), class = \"Date\"), value = structure(c(48.2, \n50.5, 49.4, 51.1, 49.4, 47.9, 49.8, 50.9, 49.3, 51.9, 50.8, 49.6, \n49.3, 50.6, 48.4, 50.7, 50.9, 50.6, 51.5, 52.8, 51.8, 51.1, 49.8, \n50.2, 50.4, NA, NA, NA, 48.8, 51.7, 51, 50.6, 51.7, 51.5, \n52.1, 51.3, 51, 54, 51.4, 52.7, 53.1, 54.6, NA, 52, 50.9, 52.6, \n50.2, 52.6, 51.6, 51.9, 50.5, 50.9, 51.7, 51.4, 51.7, 50.8, 51.9, \n51.8, 50.0, 49.1 ), .Tsp = c(1912, 1971, 1), class = \"ts\")), class = \"data.frame\", row.names = c(NA, \n-60L))\n```\n\n```{r ggplot-na-distribution-example2}\nggplot_na_distribution(x = df$value, x_axis_labels = df$date)\n```\n\n## Detailed information about certain intervals (`ggplot_na_distribution2`)\n\nWhen a summary for certain time intervals (e. g. weeks) is needed, the `ggplot_na_distribution2()` plot is useful. It shows the missing data percentage for each interval as a bar. This kind of summary plot is also quite useful for very long time series, which would not fit into the plot window as a lineplot. \n\nLike for `ggplot_na_distribution()` only parameter `x` (the univariate time series) is mandatory for creating a plot with `ggplot_na_distribution2()`. With the parameter `interval_size` the size of the interval can be changed (default is a auto calculated interval size that gives a good overall overview). All other parameters are mostly needed for changing the appearance of the plot.\n\n```{r ggplot-na-distribution2-example1}\nggplot_na_distribution2(tsNH4)\n```\n\nAlternatively the missing data count for the interval (instead of the percentages) can be shown. Below is an example with a custom interval size of 144 and a custom color for the missing data bars. Since the example data is recorded in 10 minute time steps, a interval_size of 144 means that we are using daily intervals (6 measurements per hour, 24 hours per day, 6*24 = 144).\n\n```{r ggplot-na-distribution2-example2}\nggplot_na_distribution2(tsNH4, measure = \"count\", interval_size = 144, color_missing = \"gold3\")\n```\n\n\n\n\n## Insights about missing data patterns (`ggplot_na_gapsize`)\n\nOften deeper insights about the missing data are quite useful. These insights can give hints of possible causes of the missing data and an indication, which imputation algorithms might give good results. The plot gives an overview about how often different gapsizes (NAs in a row) occur in the time series.\n\nOnly the parameter `x` (the univariate time series) is needed as mandatory input. By default the plot shows only the 10 most often occurring gapsizes. Use parameter `limit` to increase this number.\n\n```{r ggplot-na-gapsize-example1}\nlibrary(imputeTS)\nggplot_na_gapsize(tsNH4)\n```\n\nThe plot shows both, the number of occurrence and the resulting NAs for the respective gapsizes. Resulting NAs can be explained as the number of NAs a certain gapsize accounts for in total. For example a gapsize of 3 that occurs 5 times results in 15 NAs overall. The parameter `include_total` can be used to change this behavior. Below is a example of the same plot with specific settings for `limit` and `include_total`.\n\n```{r ggplot-na-gapsize-example2}\nlibrary(imputeTS)\nggplot_na_gapsize(tsNH4, include_total = F, limit = 15)\n```\n\n\n\n## Evaluate imputation results (`ggplot_na_imputations`)\n\nAfter using imputation functions like `na_kalman()`, `na_interpolation()`, `na_seadec()` there is often the need to get a first impression on how good the algorithm performs. The `ggplot_na_imputations()` plot gives a good impression on how well the imputed values fit into the original time series.\n\nMandatory inputs for this function are these two parameters: `x_with_na` (the time series as it was before imputation) and `x_with_imputations` (the time series without NAs after imputation).\n\n```{r ggplot-na-imputations-example1}\nlibrary(imputeTS)\nimp <- na_interpolation(tsAirgap)\nggplot_na_imputations(tsAirgap, imp)\n```\n\nIn some cases (mostly when performing imputation experiments and benchmarks) the NAs were only artificially introduced into the original time series. Which means, there exists a ground truth for the NA values (the complete time series before introducing the NAs). In this case you can additionally use the `x_with_truth` parameter to get a plot that displays both, the imputations and the ground truth.\n\n```{r ggplot-na-imputations-example2}\nlibrary(imputeTS)\nimp <- na_mean(tsAirgap)\nggplot_na_imputations(x_with_na = tsAirgap, x_with_imputations = imp, x_with_truth = tsAirgapComplete )\n```\n\n\n## Support\nIf you found a bug or have suggestions, feel free to open an issue on GitHub or get in contact via steffen.moritz10 at gmail.com. \n\n> All feedback is welcome\n\n"
  },
  {
    "path": "vignettes/imputeTS-Time-Series-Missing-Value-Imputation-in-R.ltx",
    "content": "%\\VignetteIndexEntry{imputeTS: Time Series Missing Value Imputation in R}\n%\\VignetteEngine{R.rsp::tex}\n\\documentclass[a4paper]{report}\n\\usepackage{etex}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{RJournal}\n\\usepackage{amsmath,amssymb,array}\n\\usepackage{booktabs}\n\\usepackage{textcomp}\n\n\n\\begin{document}\n\n%% do not edit, for illustration only\n\\sectionhead{Contributed research article}\n\\volume{XX}\n\\volnumber{YY}\n\\year{20ZZ}\n\\month{AAAA}\n\n%% replace RJtemplate with your article\n\\begin{article}\n\n%--------------------------------------\n\n% !TeX root = RJwrapper.tex\n\\title{\\pkg{imputeTS}: Time Series Missing Value Imputation in R}\n\\author{by Steffen Moritz and Thomas Bartz-Beielstein}\n\n\\maketitle\n\n\n\n%================================================================================\n\n\\abstract{\nThe \\pkg{imputeTS} package specializes on univariate time series imputation. It offers multiple state-of-the-art imputation algorithm implementations along with plotting functions for time series missing data statistics.\nWhile imputation in general is a well-known problem and widely covered by R packages, finding packages able to fill missing values in univariate time series is more complicated. The reason for this lies in the fact, that most imputation algorithms rely on \ninter-attribute correlations, while univariate time series imputation instead needs to employ time dependencies. \nThis paper provides an introduction to the \\pkg{imputeTS} package and its provided algorithms and tools. Furthermore, it gives a short overview about univariate time series imputation in R.\n}\n\n%================================================================================\n\n\\section{Introduction}\n\\label{sec:Introduction}\n\nIn almost every domain from  industry \\citep{billinton1996time} to  biology \\citep{bar2003continuous}, finance  \\citep{taylor2007modelling} up to social science \\citep{gottman1981time} different time series data are measured.  While the recorded datasets itself may be different, one common problem are missing values. Many analysis methods  require missing values to be replaced with reasonable values up-front. In statistics this process of replacing missing values is called \\textit{imputation}.\n\n\\noindent\\\\\nTime series imputation thereby is a special sub-field in the imputation research area. Most popular techniques like \nMultiple Imputation \\citep{rubin1987multiple}, Expectation-Maximization  \\citep{dempster1977maximum},  \nNearest Neighbor \\citep{vacek1980examination} and Hot Deck \\citep{ford1983overview} rely on \n inter-attribute correlations to estimate values for the missing data. Since univariate time series do not possess \nmore than one attribute, these algorithms cannot be applied directly. Effective univariate time series imputation \nalgorithms instead need to employ the inter-time correlations. \n\n\\noindent\\\\\nOn CRAN there are several packages \nsolving the problem of imputation of multivariate data. Most popular and mature (among others) are \\CRANpkg{AMELIA} \\citep{AMELIA}, \\CRANpkg{mice} \\citep{mice}, \\CRANpkg{VIM} \\citep{VIM} and \\CRANpkg{missMDA} \\citep{missMDA}. However, since these packages are designed for multivariate data imputation only they do not work for univariate time series.\n\n\\noindent\\\\\nAt the moment \\CRANpkg{imputeTS} \\citep{imputeTS} is the only package on CRAN that is solely dedicated to univariate time series imputation and includes multiple algorithms.  Nevertheless, there are some other packages that include imputation functions as addition to their core package functionality. Most noteworthy being \\CRANpkg{zoo} \\citep{zoo} and \\CRANpkg{forecast} \\citep{forecast}. Both packages offer also some advanced time series imputation functions. The packages \\CRANpkg{spacetime} \\citep{spacetime}, \\CRANpkg{timeSeries} \\citep{timeSeries} and\n\\CRANpkg{xts} \\citep{xts} should also be mentioned, since they contain some very simple but quick time series imputation methods. For a broader overview about available time series imputation packages in R see also \\citep{Moritz15a}. In this  technical report we evaluate the performance of several univariate imputation functions in R on different time series. \n\n\\noindent\\\\\nThis paper is structured as follows: Section~\\nameref{sec:Overview imputeTS package} gives an overview, about all features and functions included in the \\pkg{imputeTS} package. This is followed by~\\nameref{sec:Usage examples} of the different provided functions. The paper ends with a~\\nameref{sec:Conclusions} section.\n\n\n%===============================================================================\n\\section{Overview \\pkg{imputeTS} package}\n\\label{sec:Overview imputeTS package}\n\nThe \\pkg{imputeTS} package can be found on CRAN and is an easy to use package that offers several utilities for \\dfn{'univariate, equi-spaced, numeric time series'}. \n\n\\noindent\nUnivariate means there is just one attribute that is observed over time. Which leads to a sequence of single observations $o_{1}$, $o_{2}$, $o_{3}$, ... $o_{n}$ at successive points $t_{1}$, $t_{2}$, $t_{3}$, ... $t_{n}$ in time. Equi-spaced means, that time increments between successive data points are equal $|t_{1} - t_{2}| = |t_{2} - t_{3}| = ... = |t_{n-1} - t_{n}|$. Numeric means that the observations are measurable quantities that can be described as a number.\n\n\\noindent\nIn the first part of this section, a general overview about all available functions and datasets is given. This is followed by more detailed overviews about the three areas covered by the package:  'Plots \\& Statistics', 'Imputation' and 'Datasets'.\nInformation about how to apply these functions and tools can be found later in the ~\\nameref{sec:Usage examples} section. \n\\noindent\\\\\n\n\\subsection{General overview}\nAs can be seen in Table~\\ref{tab:generaloverview}, beyond several imputation algorithm implementations the package also includes plotting functions and datasets. The imputation algorithms can be divided into rather simple but fast approaches like mean imputation and more advanced algorithms that need more computation time like kalman smoothing on a structural model. \n\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{@{}llll@{}}\n\\toprule\n\\textbf{Simple Imputation} & \\textbf{Imputation} & \\textbf{Plots \\& Statistics} & \\textbf{Datasets} \\\\ \\midrule\nna\\_locf                    & na\\_interpolation    & ggplot\\_na\\_distribution          & tsAirgap          \\\\\nna\\_mean                    & na\\_kalman           & ggplot\\_na\\_distribution2      & tsAirgapComplete  \\\\\nna\\_random                  & na\\_ma               & ggplot\\_na\\_gapsize           & tsHeating             \\\\\nna\\_replace                 & na\\_seadec           & ggplot\\_na\\_imputations      & tsHeatingComplete     \\\\\nna\\_remove                  & na\\_seasplit         & statsNA                      & tsNH4         \\\\\n                           &                     &                              & tsNH4Complete \\\\ \\bottomrule\n\\end{tabular}\n\\caption{General Overview imputeTS package}\n\\label{tab:generaloverview}\n\\end{table}\n\n\\noindent\nAs a whole, the package aims to support the user in the complete process of replacing missing values in time series. This process starts with analyzing the distribution of the missing values using the \\code{statsNA} function and the plots of  \\code{ggplot\\_na\\_distribution}, \\code{ggplot\\_na\\_intervals}, \\code{ggplot\\_na\\_gapsize}. In the next step the actual imputation can take place with one of the several algorithm options. Finally, the imputation results can be visualized with the \\code{ggplot\\_na\\_imputations} function. Additionally, the package contains three datasets, each in a version with and without missing values, that can be used to test imputation algorithms.\n\\noindent \\\\\n\n\\subsection{Plots \\& Statistics functions}\nAn overview about the available plots and statistics functions can be found in Table~\\ref{tab:overviewstatistics}. To get a good impression what the plots look like section ~\\nameref{sec:Usage examples} is recommended. \n\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{@{}ll@{}}\n\\toprule\n\\textbf{Function}      & \\textbf{Description}                               \\\\ \\midrule\nggplot\\_na\\_distribution    & Visualize Distribution of Missing Values           \\\\\nggplot\\_na\\_distribution2 & Visualize Distribution of Missing Values (Barplot) \\\\\nggplot\\_na\\_gapsize         & Visualize Distribution of NA gap sizes              \\\\\nggplot\\_na\\_imputations     & Visualize Imputed Values                           \\\\\nstatsNA                & Print Statistics about the Missing Data            \\\\ \\bottomrule\n\\end{tabular}\n\\caption{Overview Plots \\& Statistics}\n\\label{tab:overviewstatistics}\n\\end{table}\n\n\\noindent\nThe \\code{statsNA} function calculates several missing data statistics of the input data. This includes overall percentage of missing values, absolute amount of missing values, amount of missing value in different sections of the data, longest series of consecutive NAs and occurrence of consecutive NAs.\nThe \\code{ggplot\\_na\\_distribution} function visualizes the distribution of NAs in a time series. This is done using a standard time series plot, in which areas with missing data are colored red. This enables the user to see at first sight where in the series most of the missing values are located. The \\code{ggplot\\_na\\_intervals} function provides the same insights to users, but is designed for very large time series. This is necessary for time series with 1000 and more observations, where it is not possible to plot each observation as a single point.\nThe \\code{ggplot\\_na\\_gapsize} function provides information about consecutive NAs by showing the most common NA gap sizes in the time series. The \\code{ggplot\\_na\\_imputations} function is designated for visual inspection of the results after applying an imputation algorithm. Therefore, newly imputed observations are shown in a different color than the rest of the series.\n\\noindent \\\\\n\n\\subsection{Imputation functions}\nAn overview about all available imputation algorithms can be found in Table~\\ref{tab:overviewimputation}. Even if these functions are really easy applicable, some examples can be found later in section~\\nameref{sec:Usage examples}.\nMore detailed information about the theoretical background of the algorithms can be found in the \\pkg{imputeTS} manual \\citep{imputeTSmanual}.\n\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{@{}lll@{}}\n\\toprule\n\\textbf{Function} & \\textbf{Option} & \\textbf{Description}                                            \\\\ \\midrule\nna\\_interpolation  &                 &                                                                 \\\\\n                  & linear          & Imputation by Linear Interpolation                              \\\\\n                  & spline          & Imputation by Spline Interpolation                              \\\\\n                  & stine           & Imputation by Stineman Interpolation                            \\\\\nna\\_kalman         &                 &                                                                 \\\\\n                  & StructTS        & Imputation by Structural Model \\& Kalman Smoothing              \\\\\n                  & auto.arima      & Imputation by ARIMA State Space Representation \\& Kalman Sm.    \\\\\nna\\_locf           &                 &                                                                 \\\\\n                  & locf            & Imputation by Last Observation Carried Forward                  \\\\\n                  & nocb            & Imputation by Next Observation Carried Backward                 \\\\\nna\\_ma             &                 &                                                                 \\\\\n                  & simple          & Missing Value Imputation by Simple Moving Average               \\\\\n                  & linear          & Missing Value Imputation by Linear Weighted Moving Average      \\\\\n                  & exponential     & Missing Value Imputation by Exponential Weighted Moving Average \\\\\nna\\_mean           &                 &                                                                 \\\\\n                  & mean            & MissingValue Imputation by Mean Value                           \\\\\n                  & median          & Missing Value Imputation by Median Value                        \\\\\n                  & mode            & Missing Value Imputation by Mode Value                          \\\\\nna\\_random         &                 & Missing Value Imputation by Random Sample                       \\\\\nna\\_replace        &                 & Replace Missing Values by a Defined Value                       \\\\ \\midrule\nna\\_seadec         &                 & Seasonally Decomposed Missing Value Imputation                  \\\\\nna\\_seasplit       &                 & Seasonally Splitted Missing Value Imputation                    \\\\ \\midrule\nna\\_remove         &                 & Remove Missing Values                                           \\\\ \\bottomrule\n\\end{tabular}\n\\caption{Overview Imputation Algorithms}\n\\label{tab:overviewimputation}\n\\end{table}\n\\FloatBarrier\n\\noindent\nFor convenience similar algorithms are available under one function name as parameter option.  For example linear, spline and stineman interpolation are all included in the \n\\code{na\\_interpolation} function. The \\code{na\\_mean}, \\code{na\\_locf}, \\code{na\\_replace}, \\code{na\\_random} functions are all simple and fast. In comparison, \\code{na\\_interpolation},\n\\code{na\\_kalman}, \\code{na\\_ma}, \\code{na\\_seasplit}, \\code{na\\_seadec} are more advanced algorithms that need more computation time. The \\code{na\\_remove} function is a special case, since it only deletes all missing values.\nThus, it is not really an imputation function. It should be handled with care since removing observations may corrupt the time information of the series. The \\code{na\\_seasplit} and \\code{na\\_seadec} functions are as well exceptions. These perform seasonal split / decomposition operations as a preprocessing step. For the imputation itself, one out of the other imputation algorithms \ncan be used (which one can be set as option). Looking at all available imputation methods, no single overall best method can be pointed out. Imputation performance is always very dependent on the characteristics of the input time series. Even imputation with mean values can sometimes be an appropriate method. For time series with a strong seasonality usually \\code{na\\_kalman} and \\code{na\\_seadec} / \\code{na\\_seasplit} perform best. In general, for most time series one algorithm out of \\code{na\\_kalman}, \\code{na\\_interpolation} and \\code{na\\_seadec} will yield the best results. Meanwhile, \\code{na\\_random}, \\code{na\\_mean}, \\code{na\\_locf} will be at the lower end accuracy wise for the majority of input time series.\n\\noindent\n\n\\subsection{Datasets}\n\\label{subsec:Datasets}\nAs can be seen in Table~\\ref{tab:overviewdatasets}, all three datasets are available in a version with missing data and in a complete version. The provided time series are designated as benchmark datasets for univariate time series imputation. They shall enable users to quickly compare and test imputation algorithms. Without these datasets the process of testing time series imputation algorithms would require to manually delete certain observations. The benchmark data simplifies this: imputation algorithms can directly be applied to the dataset versions with missing values, which then can be compared to the complete dataset versions afterwards. Since the time series are specified, researchers can use these to compare their algorithms against each other.\n\n\\noindent\\\\\nReached RMSE or MAPE values on these datasets are easily understandable results to quote and compare against. Nevertheless, comparing algorithms using these fixed datasets can only be a first indicator of how well algorithms perform in general.  Especially for the very short \\code{tsAirgap} series (with just 13 NA values) random lucky guesses can considerably influence the results. A complete benchmark would include: 'Different missing data percentages', 'Different datasets', 'Different random seeds for missing data simulation'.\n\n\\noindent\\\\\nOverall there is a relatively small time series provided in \\code{tsAirgap}, a medium one in \\code{tsNH4} and a large time series in \\code{tsHeating}. The \\code{tsHeating} and \\code{tsNH4} are both sensor data, while \\code{tsAirgap} is count data.\n\n\n\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{@{}ll@{}}\n\\toprule\n\\textbf{Dataset}  & \\textbf{Description}                                               \\\\ \\midrule\ntsAirgap          & Time series of monthly airline passengers (with NAs)               \\\\\ntsAirgapComplete  & Time series of monthly airline passengers (complete)               \\\\\ntsHeating         & Time series of a heating systems' supply temperature (with NAs)     \\\\\ntsHeatingComplete & Time series of a heating systems' supply temperature (complete)     \\\\\ntsNH4             & Time series of NH4 concentration in a waste-water system (with NAs) \\\\\ntsNH4Complete     & Time series of NH4 concentration in a waste-water system (complete) \\\\ \\bottomrule\n\\end{tabular}\n\\caption{Overview Datasets}\n\\label{tab:overviewdatasets}\n\\end{table}\n\n\\noindent\n\\strong{tsAirgap}\n\\noindent\\\\\nThe \\code{tsAirgap} time series has 144 rows and the incomplete version includes 14 NA values. It represents the monthly totals of international airline passengers from 1949 to 1960.\nThe time series originates from  \\cite{Box76a} and is a commonly used example in time series analysis literature. Originally known as 'AirPassengers' or 'airpass' this version is renamed to 'tsAirgap' in order improve differentiation from the complete series (gap signifies that NAs were introduced). The characteristics (strong trend, strong seasonal behavior) make the \\code{tsAirgap} series a great example for time series imputation.\n\n\\noindent\nAs already mentioned in order to use this series for comparing imputation algorithm results, there are two time series provided. One series without missing values (\\code{tsAirgapComplete}), which can be used as ground truth. Another series with NAs, on which the imputation algorithms can be applied (\\code{tsAirgap}). While the missing data for \\code{tsNH4} and \\code{tsHeating} were each introduced according to patterns observed in very similar time series from the same source, the missing observations in \\code{tsAirgap} were created based on general missing data patterns.\n\n\n\\noindent\\\\\n\\strong{tsNH4}\n\\noindent\\\\\nThe \\code{tsNH4} time series has 4552 rows and the incomplete version includes 883 NA values.  It represents  the NH4 concentration in a waste-water system measured from 30.11.2010 - 16:10 to 01.01.2011 - 6:40 in 10 minute steps.\nThe time series is derived from the dataset of the Genetic and Evolutionary Computation Conference (GECCO) Industrial Challenge 2014~\\footnote{\\url{http://www.spotseven.de/gecco-challenge/gecco-challenge-2014/}}.\n\n\\noindent\nAs already mentioned in order to use this series for comparing imputation algorithm results, there are two time series provided. One series without missing values (\\code{tsNH4Complete}), which can be used as ground truth. Another series with NAs (\\code{tsNH4}), on which the imputation algorithms can be applied. The pattern for the NA occurrence was derived from the same series / sensors, but from an earlier time interval. Thus, it is a very realistic missing data pattern. Beware, since the time series has a lot of observations, some of the more complex algorithms like \\code{na\\_kalman} will need some time till they are finished.\n\n\n\n\\noindent\\\\\n\\strong{tsHeating}\n\\noindent\\\\\nThe \\code{tsHeating} time series has 606837 rows and the incomplete version includes 57391 NA values.  It represents  a heating systems' supply temperature measured from 18.11.2013 - 05:12:00 to 13.01.2015 - 15:08:00 in 1 minute steps.\nThe time series originates from the GECCO Industrial Challenge 2015~\\footnote{\\url{http://www.spotseven.de/gecco-challenge/gecco-challenge-2015/}}. This was a challenge about 'Recovering missing information in heating system operating data'. Goal was to impute missing values in heating system sensor data as accurate as possible.\n\n\\noindent\nAs already mentioned in order to use this series for comparing imputation algorithm results, there are two time series provided. One series without missing values (\\code{tsHeatingComplete}), which can be used as ground truth. Another series with NAs (\\code{tsHeating}), on which the imputation algorithms can be applied. The NAs thereby were inserted according to patterns found in similar time series. According to patterns found / occurring in other heating systems. Beware, since it is a very large time series, some of the more complex algorithms like \\code{na\\_kalman} may need up to several days to complete on standard hardware.\n\n\n%================================================================================\n\\section{Usage examples}\n\\label{sec:Usage examples}\n\nTo start working with the \\pkg{imputeTS} package, install either the stable version from CRAN or the development version from GitHub (\\url{https://github.com/SteffenMoritz/imputeTS}). The stable version from CRAN is hereby recommended.\n\n\\subsection{Imputation algorithms}\nAll imputation algorithms are used the same way. Input has to be either a numeric time series or a numeric vector. As output, a version of the input data with all missing values replaced by imputed values is returned.\nHere is a small example, to show how to use the imputation algorithms.\n(all imputation functions start with na\\_'algorithm name')\\\\\\\\\n\\noindent\nFor this we first need to create an example input series with missing data.\n\n\\begin{example}\n# Create a short example time series with missing values\n x <- ts(c(1, 2, 3, 4, 5, 6, 7, 8, NA, NA, 11, 12))\n\\end{example}\n\n\\noindent\nOn this time series we can apply different imputation algorithms. We start with using \\code{na\\_mean}, which substitutes the NAs with mean values.\n\n\\begin{example}\n# Impute the missing values with na_mean\n na_mean(x)\n\\end{example}\n[1]~~~~1.0~~~~2.0~~~~3.0~~~~4.0~~~~5.0~~~~6.0~~~~7.0~~~~8.0\n\\textbf{~~~~5.9~~~~5.9}~~~~11.0~~~~12.0\n\n\n\\noindent\\\\\nMost of the functions also have additional options that provide further algorithms (of the same algorithm category). In the example below it can be seen that \\code{na\\_mean} can also be called with \\code{option=\"median\"}, which substitutes the NAs with median values.\n\n\\begin{example}\n# Impute the missing values with na_mean using option median\n na_mean(x, option=\"median\")\n\\end{example}\n [1]~~~~1.0~~~~2.0~~~~3.0~~~~4.0~~~~5.0~~~~6.0~~~~7.0\n ~~~~8.0~~~~\\textbf{5.5~~~~5.5}~~~~11.0~~~~12.0\n \n\\noindent\\\\\nWhile \\code{na\\_interpolation} and all other imputation functions are used the same way, the results produced may be different. As can be seen below, for this series linear interpolation gives more reasonable results.\n \n \n\\begin{example}\n# Impute the missing values with na_interpolation\nna_interpolation(x)\n\\end{example}\n[1]~~~~1~~~~2~~~~3~~~~4~~~~5~~~~6~~~~7\n ~~~~8~~~~\\textbf{9~~~~10}~~~~11~~~~12\n \n \\noindent\\\\\nFor longer and more complex time series (with trend and seasonality) than in this example it is always a good idea to try \\code{na\\_kalman} and \\code{na\\_seadec}, since these functions very often produce the best results. These functions are called the same easy way as all other imputation functions. \n\n \\noindent\nHere is a usage example for the \\code{na\\_kalman} function applied on the \\code{tsAirgap} (described in ~\\ref{subsec:Datasets}) time series. As can be seen in Figure~\\ref{fig:imputations2}, \\code{na\\_kalman} provides really good results for this series, which contains a strong seasonality and a strong trend. \n\n\\begin{example}\n# Impute the missing values with na_kalman\n# (tsAirgap is an example time series provided by the imputeTS package)\nimp <- na_kalman(tsAirgap)\n\n#Code for visualization\nggplot_na_imputations(tsAirgap, imp, tsAirgapComplete)\n\\end{example}\n\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5.7in]{Figures.d/imputations2.png}\n\\caption{Results of imputation with na\\_kalman compared to real values}\n\\label{fig:imputations2}\n\\end{figure}\n\\noindent\n\\FloatBarrier\n\\subsection{ggplot\\_na\\_distribution}\n\nThis function visualizes the distribution of missing values within a time series. Therefore, the time series is plotted and whenever a value is NA the background is colored differently. This gives a nice overview, where in the time series most of the missing values occur. An example usage of the function can be seen below (for the plot see Figure~\\ref{fig:distribution}).\n\\begin{example}\n# Example Code 'ggplot_na_distribution'\n# (tsAirgap is an example time series provided by the imputeTS package)\n\n# Visualize the missing values in this time series\nggplot_na_distribution(tsAirgap)\n\\end{example}\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5.7in]{Figures.d/distribution.png}\n\\caption{Example for ggplot\\_na\\_distribution}\n\\label{fig:distribution}\n\\end{figure}\n\\FloatBarrier\n\\noindent\nAs can be seen in Figure~\\ref{fig:distribution}, in areas with missing data the background is colored red. The whole plot is pretty much self-explanatory. The plotting function itself needs no further configuration parameters, nevertheless it allows passing through of plot parameters (via ...).\n\\FloatBarrier\n\\noindent\\\\\n\n\\subsection{ggplot\\_na\\_distribution2}\nThis function also visualizes the distribution of missing values within a time series. This is done as a barplot, which is especially useful if the time series would otherwise be too large to be plotted. Multiple observations for time intervals are grouped together and represented as bars. For these intervals, information about the amount of missing values are shown. An example usage of the function can be seen below (for the plot see Figure~\\ref{fig:distributionBar}).\n\n\\begin{example}\n# Example Code 'ggplot_na_distribution2'\n# (tsHeating is an example time series provided by the imputeTS package)\n\n# Visualize the missing values in this time series\nggplot_na_distribution2(tsNH4)\n\n\\end{example}\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5.7in]{Figures.d/distributionbar.png}\n\\caption{Example for ggplot\\_na\\_distribution2}\n\\label{fig:distributionBar}\n\\end{figure}\n\\FloatBarrier\n\\noindent\\\\\nAs can be seen in the x-axis of Figure~\\ref{fig:distributionBar}, the \\code{tsHeating} series is with over 600.000 observations a very large time series. While the missing values in the \\code{tsAirgap} series (144 observations) can be visualized with \\code{ggplot\\_na\\_distribution} like in Figure~\\ref{fig:distribution}, this would for sure not work out for \\code{tsHeating}. There just isn't enough space for 600.000 single consecutive observations/points in the plotting area. The \\code{ggplot\\_na\\_intervals} function solves this problem. Multiple observations are grouped together in intervals. The 'breaks' parameter in the example defines that there should be 20 intervals used. This means every interval in Figure~\\ref{fig:distributionBar} represents approximately 30.000 observations. The first five intervals are completely green, which means there are no missing values present. This means from observation 1 up to observation 150.000 there are no missing values in the data. In the middle and at the end of the series there are several intervals each having around 40\\% of missing data. This means in these intervals 12.000 out of 30.000 observation are NA. All in all, the plot is able to give a nice  but rough overview about the  NA distribution in very large time series. \n\\noindent\\\\\n\n\\subsection{ggplot\\_na\\_gapsize}\nThis plotting function can be used to visualize how often different NA gaps (NAs in a row) occur in a time series. The function shows this information as a ranking. This ranking can be ordered by total NAs gap sizes account for (number occurrence gap size * gap length) or just by the number of occurrences of gap sizes. In the end the results can be read like this: In time series x, 3 NAs in a row occur most often with 20 occurrences, 6 NAs in a row occur 2nd most with 5 occurrences, 2 NAs in a row occur 3rd most with 3 occurrences.\nAn example usage of the function can be seen below(for the plot see Figure~\\ref{fig:gapsize}).\n\n\\begin{example}\n\n# Example Code 'ggplot_na_gapsize'\n# (tsNH4 is an example time series provided by the imputeTS package)\n\n# Visualize the top gap sizes / NAs in a row\nggplot_na_gapsize(tsNH4)\n\n\\end{example}\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5.7in]{Figures.d/gapsize.png}\n\\caption{Example for ggplot\\_na\\_gapsize}\n\\label{fig:gapsize}\n\\end{figure}\n \\FloatBarrier\n \\noindent\nThe example plot (Figure~\\ref{fig:gapsize}) reads the following: In the time series \\code{tsNH4} gap size 157 occurs just 1 time, but makes up for most NAs of all gap sizes (157 NAs). A gap size of 91 (91 NAs in a row) also occurs just once, but makes up for 2nd most NAs (91 NAs). A gap size of 42 occurs two times in the time series, which leads to 3rd most overall (84 NAs). A gap size of one (no other NAs before or behind the NA) occurs 68 times, which makes this 4th in overall NAs (68 NAs). \n\\noindent\\\\\n\n\\subsection{ggplot\\_na\\_imputations}\nThis plot can be used, to visualize the imputed values for a time series. Therefore, the imputed values (filled NA gaps) are shown in a different color than the other values. The function is used as below and Figure~\\ref{fig:imputations} shows the output.\n\n\\begin{example}\n\n# Example Code 'ggplot_na_imputations'\n# (tsAirgap is an example time series provided by the imputeTS package)\n\n# Step 1: Perform imputation for x using na_mean\ntsAirgap.imp <- na_mean(tsAirgap)\n\n# Step 2: Visualize the imputed values in the time series\nggplot_na_imputations(tsAirgap, tsAirgap.imp)\n\n\n\\end{example}\n\n\\noindent\nThe visual inspection of Figure~\\ref{fig:imputations} indicates, that the imputed values (red) do not fit very well in the \\code{tsAirgap} series. This is caused by \\code{na\\_mean} being used for imputation of a series with a strong trend. The plotting function enables users to quickly detect such problems in the imputation results. If the ground truth is known for the imputed values, this information can also be added to the plot. The plotting function itself needs no further configuration parameters. Nevertheless, it allows passing through of plot parameters (via ...).\n\\noindent\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5.7in]{Figures.d/imputations.png}\n\\caption{Example for ggplot\\_na\\_imputations}\n\\label{fig:imputations}\n\\end{figure}\n\\FloatBarrier\n\\subsection{statsNA}\nThe \\code{statsNA} function prints summary stats about the distribution of missing values in univariate time series. Here is a short explanation about the information it gives:\n\n\\begin{itemize}\n  \\item Length of time series\\\\\n  Number of observations in the time series (including NAs)\n  \\item Number of Missing Values\\\\\n  Number of missing values in the time series\n  \\item Percentage of Missing Values\n  Percentage of missing values in the time series\n   \\item Stats for Bins\\\\\n  Number/percentage of missing values for the split into bins\n  \\item Longest NA gap\\\\\n  Longest series of consecutive missing values (NAs in a row) in the time  \n  series  \n   \\item Most frequent gap size\\\\\n  Most frequent occurring series of missing values in the time series\n  \\item Gap size accounting for most NAs\\\\\n  he series of consecutive missing values that accounts for most missing\n  values overall in the time series\n   \\item Overview NA series\\\\\n  Overview about how often each series of consecutive missing values\n   occurs. Series occurring 0 times are skipped  \n\\end{itemize}\n\n\\noindent\nThe function is used as below and Figure~\\ref{fig:statsNA} shows the output.\n\\noindent\\\\\n\n\\begin{example}\n# Example Code 'statsNA'\n# (tsNH4 is an example time series provided by the imputeTS package)\n\n# Print stats about the missing data\nstatsNA(tsNH4)\n\\end{example}\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=5in]{Figures.d/statsna.png}\n\\caption{Excerpt of statsNA output}\n\\label{fig:statsNA}\n\\end{figure}\n\\FloatBarrier\n\\subsection{Datasets}\nUsing the datasets is self-explanatory, after the package is loaded they are directly available and usable under their name. No call of data() is needed. For every dataset there is always a complete version (without NAs) and an incomplete version (containing NAs) available.\n\n\\begin{example}\n# Example Code to use tsAirgap dataset\nlibrary(\"imputeTS\")\ntsAirgap\n\\end{example}\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=4in]{Figures.d/tsairgap.png}\n\\caption{Example tsAirgap time series}\n\\label{fig:tsAirgap}\n\\end{figure}\n\\FloatBarrier\n%================================================================================\n\\section{Conclusions}\n\\label{sec:Conclusions}\nMissing data is a very common problem for all kinds of data. However, in case of univariate time series most standard algorithms and existing functions within R packages cannot be applied.\n\\noindent\\\\\nThis paper presented the \\pkg{imputeTS} package that provides a collection of  algorithms and tools especially tailored to this task. Using example time series, we illustrated the ease of use and the advantages of the provided functions. Simple algorithms as well as more complicated ones can be applied in the same simple and user-friendly manner.\n\\noindent\\\\\\\\\nThe functionality provided makes the \\pkg{imputeTS} package a good choice for preprocessing of time series ahead of further analysis steps that require complete absence of missing values.\n\\noindent\\\\\\\\\nFuture research and development plans for forthcoming versions of the package include adding additional time series algorithm options to choose from. \n\n\n%================================================================================\n\\section{Acknowledgment}\n\\label{sec:Acknowlegment}\nParts of this work have been developed in the project '\\textit{IMProvT: Intelligente Messverfahren zur Prozessoptimierung von Trinkwasserbereitstellung und -verteilung}' (reference number: 03ET1387A). Kindly supported by the Federal Ministry of Economic Affairs and Energy of the Federal Republic of Germany.\n\n\\begin{figure} [h]\n\\centering\n\\includegraphics[width=2.5in]{Figures.d/sponsorlogo.jpg}\n\\label{fig:sponsor}\n\\end{figure}\n\\FloatBarrier\n\n%================================================================================\n\n\\begin{thebibliography}{21}\n\\providecommand{\\natexlab}[1]{#1}\n\\providecommand{\\url}[1]{\\texttt{#1}}\n\\expandafter\\ifx\\csname urlstyle\\endcsname\\relax\n  \\providecommand{\\doi}[1]{doi: #1}\\else\n  \\providecommand{\\doi}{doi: \\begingroup \\urlstyle{rm}\\Url}\\fi\n\n\\bibitem[Bar-Joseph et~al.(2003)Bar-Joseph, Gerber, Gifford, Jaakkola, and\n  Simon]{bar2003continuous}\nZ.~Bar-Joseph, G.~K. Gerber, D.~K. Gifford, T.~S. Jaakkola, and I.~Simon.\n\\newblock Continuous representations of time-series gene expression data.\n\\newblock \\emph{Journal of Computational Biology}, 10\\penalty0 (3-4):\\penalty0\n  341--356, 2003.\n\n\\bibitem[Billinton et~al.(1996)Billinton, Chen, and Ghajar]{billinton1996time}\nR.~Billinton, H.~Chen, and R.~Ghajar.\n\\newblock Time-series models for reliability evaluation of power systems\n  including wind energy.\n\\newblock \\emph{Microelectronics Reliability}, 36\\penalty0 (9):\\penalty0\n  1253--1261, 1996.\n\n\\bibitem[Box et~al.(2015)Box, Jenkins, Reinsel, and Ljung]{Box76a}\nG.~E. Box, G.~M. Jenkins, G.~C. Reinsel, and G.~M. Ljung.\n\\newblock \\emph{Time Series Analysis: Forecasting and Control}.\n\\newblock John Wiley \\& Sons, 2015.\n\n\\bibitem[Dempster et~al.(1977)Dempster, Laird, and Rubin]{dempster1977maximum}\nA.~P. Dempster, N.~M. Laird, and D.~B. Rubin.\n\\newblock Maximum likelihood from incomplete data via the {EM} algorithm.\n\\newblock \\emph{Journal of the royal statistical society. Series B\n  (methodological)}, pages 1--38, 1977.\n\n\\bibitem[Ford(1983)]{ford1983overview}\nB.~L. Ford.\n\\newblock {An Overview of Hot-Deck Procedures}.\n\\newblock \\emph{Incomplete data in sample surveys}, 2\\penalty0 (Part\n  IV):\\penalty0 185--207, 1983.\n\n\\bibitem[Gottman(1981)]{gottman1981time}\nJ.~M. Gottman.\n\\newblock \\emph{Time-series analysis: A comprehensive introduction for social\n  scientists}, volume 400.\n\\newblock Cambridge University Press Cambridge, 1981.\n\n\\bibitem[Honaker et~al.(2011)Honaker, King, and Blackwell]{AMELIA}\nJ.~Honaker, G.~King, and M.~Blackwell.\n\\newblock {Amelia II: A Program for Missing Data}.\n\\newblock \\emph{Journal of Statistical Software}, 45\\penalty0 (7):\\penalty0\n  1--47, 2011.\n\\newblock URL \\url{http://www.jstatsoft.org/v45/i07/}.\n\n\\bibitem[Hyndman(2016)]{forecast}\nR.~J. Hyndman.\n\\newblock \\emph{{forecast}: Forecasting functions for time series and linear\n  models}, 2016.\n\\newblock URL \\url{http://github.com/robjhyndman/forecast}.\n\\newblock R package version 7.3.\n\n\\bibitem[Josse and Husson(2016)]{missMDA}\nJ.~Josse and F.~Husson.\n\\newblock {missMDA: A Package for Handling Missing Values in Multivariate Data\n  Analysis}.\n\\newblock \\emph{Journal of Statistical Software}, 70\\penalty0 (1):\\penalty0\n  1--31, 2016.\n\\newblock \\doi{10.18637/jss.v070.i01}.\n\n\\bibitem[Kowarik and Templ(2016)]{VIM}\nA.~Kowarik and M.~Templ.\n\\newblock Imputation with the {R} package {VIM}.\n\\newblock \\emph{Journal of Statistical Software}, 74\\penalty0 (7):\\penalty0\n  1--16, 2016.\n\\newblock \\doi{10.18637/jss.v074.i07}.\n\n\\bibitem[Moritz(2016{\\natexlab{a}})]{imputeTS}\nS.~Moritz.\n\\newblock \\emph{{imputeTS: Time Series Missing Value Imputation}},\n  2016{\\natexlab{a}}.\n\\newblock URL \\url{http://CRAN.R-project.org/package=imputeTS}.\n\\newblock R package version 1.7.\n\n\\bibitem[Moritz(2016{\\natexlab{b}})]{imputeTSmanual}\nS.~Moritz.\n\\newblock \\emph{package imputeTS}, 2016{\\natexlab{b}}.\n\\newblock URL\n  \\url{http://cran.r-project.org/web/packages/imputeTS/imputeTS.pdf}.\n\\newblock R package version 1.7.\n\n\\bibitem[{Moritz} et~al.(2015){Moritz}, {Sard{\\'a}}, {Bartz-Beielstein},\n  {Zaefferer}, and {Stork}]{Moritz15a}\nS.~{Moritz}, A.~{Sard{\\'a}}, T.~{Bartz-Beielstein}, M.~{Zaefferer}, and\n  J.~{Stork}.\n\\newblock {Comparison of different Methods for Univariate Time Series\n  Imputation in R}.\n\\newblock \\emph{ArXiv e-prints}, Oct. 2015.\n\n\\bibitem[Pebesma(2012)]{spacetime}\nE.~Pebesma.\n\\newblock {spacetime: Spatio-Temporal Data in R}.\n\\newblock \\emph{Journal of Statistical Software}, 51\\penalty0 (7):\\penalty0\n  1--30, 2012.\n\\newblock URL \\url{http://www.jstatsoft.org/v51/i07/}.\n\n\\bibitem[{Rmetrics Core Team} et~al.(2015){Rmetrics Core Team}, Wuertz, Setz,\n  and Chalabi]{timeSeries}\n{Rmetrics Core Team}, D.~Wuertz, T.~Setz, and Y.~Chalabi.\n\\newblock \\emph{{timeSeries: Rmetrics - Financial Time Series Objects}}, 2015.\n\\newblock URL \\url{https://CRAN.R-project.org/package=timeSeries}.\n\\newblock R package version 3022.101.2.\n\n\\bibitem[Rubin(1987)]{rubin1987multiple}\nD.~B. Rubin.\n\\newblock \\emph{Multiple imputation for nonresponse in surveys}.\n\\newblock New York: Wiley, 1987.\n\n\\bibitem[Ryan and Ulrich(2014)]{xts}\nJ.~A. Ryan and J.~M. Ulrich.\n\\newblock \\emph{{xts: eXtensible Time Series}}, 2014.\n\\newblock URL \\url{https://CRAN.R-project.org/package=xts}.\n\\newblock R package version 0.9-7.\n\n\\bibitem[Taylor(2007)]{taylor2007modelling}\nS.~J. Taylor.\n\\newblock \\emph{Modelling financial time series (second edition)}.\n\\newblock World Scientific Publishing, 2007.\n\n\\bibitem[Vacek and Ashikaga(1980)]{vacek1980examination}\nP.~Vacek and T.~Ashikaga.\n\\newblock An examination of the nearest neighbor rule for imputing missing\n  values.\n\\newblock \\emph{Proc. Statist. Computing Sect., Amer. Statist. Ass}, pages\n  326--331, 1980.\n\n\\bibitem[{van Buuren} and Groothuis-Oudshoorn(2011)]{mice}\nS.~{van Buuren} and K.~Groothuis-Oudshoorn.\n\\newblock {mice: Multivariate Imputation by Chained Equations in R}.\n\\newblock \\emph{Journal of Statistical Software}, 45\\penalty0 (3):\\penalty0\n  1--67, 2011.\n\\newblock URL \\url{http://www.jstatsoft.org/v45/i03/}.\n\n\\bibitem[Zeileis and Grothendieck(2005)]{zoo}\nA.~Zeileis and G.~Grothendieck.\n\\newblock {zoo: S3 Infrastructure for Regular and Irregular Time Series}.\n\\newblock \\emph{Journal of Statistical Software}, 14\\penalty0 (6):\\penalty0\n  1--27, 2005.\n\\newblock URL \\url{http://www.jstatsoft.org/v14/i06/}.\n\n\\end{thebibliography}\n\n\n\n%================================================================================\n\n\\address{Steffen Moritz\\\\\n  Cologne University of Applied Sciences\\\\\n  Cologne, Germany\\\\}\n\\email{steffen.moritz10@gmail.com}\n\n\n\\address{Thomas Bartz-Beielstein\\\\\n  Cologne University of Applied Sciences\\\\\n  Cologne, Germany\\\\}\n\\email{bartz.beielstein@th-koeln.de}\n\n\n\\end{article}\n\n\\end{document}\n"
  }
]