{"id":22295365,"url":"https://github.com/alkc/apogeereader","last_synced_at":"2025-03-25T22:27:19.208Z","repository":{"id":168941726,"uuid":"91665836","full_name":"alkc/apogeereader","owner":"alkc","description":"An R package for reading Spectrawiz and Spectrovision spectral data files ","archived":false,"fork":false,"pushed_at":"2021-04-20T07:59:37.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T19:47:54.111Z","etag":null,"topics":["apogee","ps-100","r","spectral-data","spectrawiz","spectrawiz-files","spectrovision","spectrovision-files","ss-110","ss-120"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alkc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-18T08:03:23.000Z","updated_at":"2021-04-20T08:01:40.000Z","dependencies_parsed_at":"2023-05-31T16:15:36.103Z","dependency_job_id":null,"html_url":"https://github.com/alkc/apogeereader","commit_stats":null,"previous_names":["alkc/apogeereader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkc%2Fapogeereader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkc%2Fapogeereader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkc%2Fapogeereader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alkc%2Fapogeereader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alkc","download_url":"https://codeload.github.com/alkc/apogeereader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245552722,"owners_count":20634240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apogee","ps-100","r","spectral-data","spectrawiz","spectrawiz-files","spectrovision","spectrovision-files","ss-110","ss-120"],"created_at":"2024-12-03T17:41:52.686Z","updated_at":"2025-03-25T22:27:19.184Z","avatar_url":"https://github.com/alkc.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apogreereader\n\n## Early development!\n\nThis package is still in early development. Function names and such _might_ be \nsubject to change!\n\nThe first stable version of this package will (hopefully) be available via CRAN.\nUntil then, follow the instructions below to install the development version.\n\n## Hello world!\n\napogeereader is a package for reading files containing spectral measurements \nmade using the Stellarnet SpectraWiz® Spectroscopy Software and Apogee Instruments, Inc.\nSpectrovision Spectroradiometer software. It is inspired by the [asdreader](https://github.com/cran/asdreader) package \n(for ASD Fieldspec data) in its basic functionality.\n\n## Installation \n\nTo install this development version of spectrawizreader, please use the \n`install_github()` function from the  \n[devtools package](https://github.com/r-lib/devtools/), like so:\n\n```{r}\ndevtools::install_github(\"alkc/apogeereader\")\n```\n\n## Usage\n\n### Spectrawiz\n\n#### Basic file input\n\n```{r}\n# Get path to demo file included in the package:\npath_to_spectrawiz_file \u003c- trm_file()\n\n# Read the file into a data.frame\nspectral_data \u003c- read_spectrawiz(file)\n\n# Print first five columns:\nprint(spectral_data[,1:5])\n```\n\nThe first column in the `data.frame` returned by `read_spectrawiz` is always\nthe filename associated with the input file. To remove it, just subset away\nthe first column:\n\n```{r}\nspectral_data \u003c- spectral_data[,-1]\n```\n\n#### Getting the wavelengths\n\nThe wavelengths are stored in the column names of the `data.frame` returned by\n`read_spectrawiz()`. \n\nUse the base function `colnames()` to extract the wavelengths, followed by\n`as.numeric()` to convert the wavelength vector from characters to numbers.\n\nHere is an example:\n\n```{r}\npath_to_spectrawiz_file \u003c- trm_file()\nspectral_data \u003c- read_spectrawiz(path_to_spectrawiz_file)\n\n# The first column in spectral_data contains file paths, so we remove it \n# before we extract the colnames\nwavelengths \u003c- colnames(spectral_data[,-1])\n\n# The wavelengths are stored as characters in the column names. To convert them\n# back to numeric format, use as.numeric():\nwavelengths \u003c- as.numeric(wavelengths)\n\n# Done!\n# Preview the first six values:\nhead(wavelengths)\n# [1] 339.0 339.5 340.0 340.5 341.0 341.5\n```\n\n### Spectrovision\n\n#### Basic file input\n\n```{r}\nspectrovision_file \u003c- spectrovision_file()\nspectral_data \u003c- read_spectrovision(spectrovision_file)\n```\nThe first column of the resulting `data.frame` is the timestamp\nassociated with each measurement. If you wish to split the timestamp into\nseparate `Date`, `Time` and `Sensor` for each row them set the `split_timestamp`\nargument to `TRUE` in `read_spectrovision`:\n\n```{r}\nspectrovision_file \u003c- spectrovision_file()\nspectral_data \u003c- read_spectrovision(spectrovision_file, split_timestamp = TRUE)\n```\n\n\n#### Merging multiple spectrovision files into a single `data.frame`\n\n```{r}\nlibrary(purrr)\n\nspectrovision_files \u003c- c(path_to_spectrovision_1, path_to_spectrovision_2, \npath_to_spectrovision_3)\n\nspectral_data \u003c- map_dfr(spectrovision_files, read_spectrovision)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkc%2Fapogeereader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falkc%2Fapogeereader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falkc%2Fapogeereader/lists"}