MyNixOS website logo
Description

NHANES Data Retrieval.

Utility to retrieve data from the National Health and Nutrition Examination Survey (NHANES) website <https://www.cdc.gov/nchs/nhanes/index.htm>.

nhanesA

CRANstatus LICENSE metacrandownloads

nhanesA is an R package for browsing and retrieving data from the National Health And Nutrition Examination Survey (NHANES). This package is designed to be useful for research and instructional purposes.

The functions in the nhanesA package allow for fully customizable selection and import of data directly from the NHANES website thus it is essential to have an active network connection.

Install from CRAN

install.packages("nhanesA")

Install from the dev repo

install.packages("devtools")
devtools::install_github("cjendres1/nhanes")

Use nhanesA in Docker

The Docker container hosts the data, allowing for faster access and manipulation directly from the local Docker environment. The summary of the differences between using the standard nhanesA and using it inside Docker is as follows:

Standard nhanesA:

  • When used outside of Docker, the nhanesA functions scrape data directly from the CDC website each time they are invoked.
  • The advantage is simplicity; users only need to install the nhanesA package without any additional setup.
  • However, the response time is contingent upon internet speed and the size of the requested data.

Docker-enhanced nhanesA:

  • The Docker container locally hosts most of the NHANES data, allowing for significantly faster data access and manipulation.
  • Initial setup requires Docker installation and downloading the Docker image.
  • Pre-pandemic tables, DXA and the youth survey, are also not present in the Docker database and would similarly be fetched from the CDC website.

In essence, while the Docker-enhanced version offers blazing-fast access to a majority of the data, it will fetch data in the standard nhanesA manner for datasets not present in its database.

To use nhanesA inside Docker, you can follow the two steps below: start Docker using the provided command and access RStudio through the given link.

1. Start Docker

Start Docker on Mac or Linux

docker \
    run \
        --rm \
        --platform=linux/amd64 \
        --name nhanes-workbench \
        -v <YOUR LOCAL PATH>:/mnt/ \
        -d \
        -p 8787:8787 \
        -p 2200:22 \
        -p 1433:1433 \
        -e 'CONTAINER_USER_USERNAME=USER' \
        -e 'CONTAINER_USER_PASSWORD=PASSWORD' \
        -e 'ACCEPT_EULA=Y' \
        -e 'SA_PASSWORD=yourStrong(!)Password' \
         hmsccb/nhanes-workbench:version-0.2.0

Start Docker on Windows

docker ^
    run ^
        --rm ^
        --platform=linux/amd64 ^
        --name nhanes-workbench ^
  -v <YOUR LOCAL PATH>:/mnt/ ^
  -p 8787:8787 -p 2200:22 -p 1433:1433 ^
  -e "CONTAINER_USER_USERNAME=USER" ^
  -e "CONTAINER_USER_PASSWORD=PASSWORD" ^
  -e "ACCEPT_EULA=Y" ^
  -e "SA_PASSWORD=yourStrong(!)Password" ^
  hmsccb/nhanes-workbench:version-0.2.0

2. Log into Rstudio

Log into RStudio via: \<http<nolink>://localhost:8787> and using the username set in the command above. In the above command, the username and password are set as USER and PASSWORD,respectively, but you can modify them if you prefer.

More details about NHANES Docker.


Working with nhanesA

Manual

Vignette: Introducing nhanesA.


drawing
Metadata

Version

1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows