{"id":29382379,"url":"https://github.com/adabyt/unitconverter","last_synced_at":"2025-08-04T05:38:57.779Z","repository":{"id":302081579,"uuid":"1011181890","full_name":"adabyt/unitconverter","owner":"adabyt","description":"R package for converting temperature, weight, and length units. Final project for CS50R.","archived":false,"fork":false,"pushed_at":"2025-06-30T13:24:59.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T08:39:57.497Z","etag":null,"topics":["cs50","cs50r","error-handling","length-units","r","r-package","rdocumentation","temperature-units","testthat","unit-conversion","weight-units"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adabyt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-30T12:30:45.000Z","updated_at":"2025-06-30T13:40:05.000Z","dependencies_parsed_at":"2025-06-30T13:47:10.766Z","dependency_job_id":"cb1fa79a-c5c2-4771-ac42-9cd0b765a78d","html_url":"https://github.com/adabyt/unitconverter","commit_stats":null,"previous_names":["adabyt/unitconverter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adabyt/unitconverter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adabyt%2Funitconverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adabyt%2Funitconverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adabyt%2Funitconverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adabyt%2Funitconverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adabyt","download_url":"https://codeload.github.com/adabyt/unitconverter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adabyt%2Funitconverter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268655128,"owners_count":24285128,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cs50","cs50r","error-handling","length-units","r","r-package","rdocumentation","temperature-units","testthat","unit-conversion","weight-units"],"created_at":"2025-07-10T04:01:17.665Z","updated_at":"2025-08-04T05:38:57.749Z","avatar_url":"https://github.com/adabyt.png","language":"R","readme":"# 🔁 Unit Converter (CS50R Final Project)\n\nA lightweight R package for converting between common units of temperature, length, and weight. Designed for clarity, ease of use, and reliability — with unit tests and full documentation.\n\n\u003e 🧪 Final project for [CS50’s Introduction to Programming with R](https://cs50.harvard.edu/r/).\n\n---\n\n## 📦 Functions Provided\n\n| Function       | Description                            | Example       |\n|----------------|----------------------------------------|----------------|\n| `C_to_F()`      | Convert Celsius to Fahrenheit          | `C_to_F(0)` → `32 °F` |\n| `F_to_C()`      | Convert Fahrenheit to Celsius          | `F_to_C(32)` → `0 °C` |\n| `kg_to_lbs()`   | Convert kilograms to pounds            | `kg_to_lbs(1)` → `2.2 lbs` |\n| `lbs_to_kg()`   | Convert pounds to kilograms            | `lbs_to_kg(2.20462)` → `1 kg` |\n| `cm_to_inches()`| Convert centimetres to inches          | `cm_to_inches(2.54)` → `1 inch` |\n| `inches_to_cm()`| Convert inches to centimetres          | `inches_to_cm(1)` → `2.54 cm` |\n\nEach function checks for:\n- Missing or null inputs\n- Non-numeric inputs\n- Precision rounding\n\n---\n\n## 🧪 Testing\n\nUnit tests are provided using the `testthat` framework. Run all tests using:\n\n```r\ndevtools::test()\n```\n\nTest coverage includes:\n- Correct conversions\n- Handling of NA/missing/null inputs\n- Type safety (e.g., strings, lists)\n\n---\n\n## 📁 Project Structure\n```\nunitconverter/\n├── R/                   # Source functions (e.g., C_to_F.R)\n├── man/                 # Manual .Rd documentation files\n├── tests/\n│   ├── testthat.R       # Load test suite\n│   └── testthat/        # Unit tests per function\n├── NAMESPACE            # Export definitions\n└── README.md            # This file\n```\n\n---\n\n## 🚀 How to Use\n\nYou can load the functions into your R session as follows:\n```r\nsource(\"R/C_to_F.R\")\nC_to_F(25)  # Output: 77 °F\n```\n\nOr if packaging via devtools:\n```r\nlibrary(devtools)\nload_all(\"unitconverter\")\nkg_to_lbs(70)\n```\n\n---\n\n## 🔧 Example Output\n```r\n\u003e C_to_F(100)\n[1] \"212 °F\"\n\n\u003e cm_to_inches(10)\n[1] \"3.94 inches\"\n\n\u003e lbs_to_kg(220)\n[1] \"99.79 kg\"\n```\n\n---\n\n## 📌 What I Learned\n- How to write modular, reusable R functions\n- Robust input validation and error handling\n- Documenting with .Rd files\n- Testing using testthat\n- Building a basic R package structure\n\n\n---\n\n## 📄 License\nMIT\n\n---\n\n![R](https://img.shields.io/badge/Made_with-R-276DC3)\n![testthat](https://img.shields.io/badge/Tested_with-testthat-1f425f)\n![CS50](https://img.shields.io/badge/CS50R-Project-red)\n![License](https://img.shields.io/badge/License-MIT-green)\n![Status](https://img.shields.io/badge/Status-Complete-brightgreen)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadabyt%2Funitconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadabyt%2Funitconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadabyt%2Funitconverter/lists"}