{"id":20261950,"url":"https://github.com/himloul/r-utils","last_synced_at":"2025-09-10T04:45:09.714Z","repository":{"id":152075252,"uuid":"312677693","full_name":"himloul/R-Utils","owner":"himloul","description":"Reproducible R functions to avoid repetitive work.","archived":false,"fork":false,"pushed_at":"2023-05-21T16:32:42.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T19:53:33.404Z","etag":null,"topics":["excel","xlsx","xml"],"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/himloul.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}},"created_at":"2020-11-13T20:35:02.000Z","updated_at":"2023-04-10T23:17:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f754bfa-be1c-40aa-bf61-8c9b73653fbd","html_url":"https://github.com/himloul/R-Utils","commit_stats":null,"previous_names":["himloul/r-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/himloul/R-Utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himloul%2FR-Utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himloul%2FR-Utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himloul%2FR-Utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himloul%2FR-Utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himloul","download_url":"https://codeload.github.com/himloul/R-Utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himloul%2FR-Utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274412864,"owners_count":25280199,"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-09-10T02:00:12.551Z","response_time":83,"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":["excel","xlsx","xml"],"created_at":"2024-11-14T11:27:49.662Z","updated_at":"2025-09-10T04:45:09.669Z","avatar_url":"https://github.com/himloul.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Useful functions scripted in R\n\nthis repository includes some reproducible functions\n\n## Data Collection  \n\n### Read Excel (XML 2003) Spreadsheets in R  \nWhile there are packages in R to read spreadsheets (`readxl::read_xlsx` and `readxl::read_xls`), they do not support XML 2003 spreadsheets, which can often be misidentified as XLS files due to their file extension. This function provides a solution to reading these files by using the read_xml function from the `xml2` package and the `xml_find_all` function from the `tidyverse` package. The function reads the spreadsheet, identifies the data in the rows and columns, and returns the data in a data frame with the column names derived from the first row of data.\n\n```r\nlibrary(tidyverse)\nlibrary(xml2)\n\nreadExcelXML =\n  function(filename) {\n    doc \u003c- read_xml(filename)\n    ns \u003c- xml_ns(doc)\n    rows \u003c- xml_find_all(doc, paste0(\".//ss:Worksheet/ss:Table/ss:Row\"), ns = ns)\n    values \u003c- lapply(rows, . %\u003e% xml_find_all(\".//ss:Cell/ss:Data\", ns = ns) %\u003e% xml_text %\u003e% unlist)\n    \n    columnNames \u003c- values[[1]]\n    \n    dat \u003c- do.call(rbind.data.frame, c(values[-1], stringsAsFactors = FALSE))\n    names(dat) \u003c- columnNames\n    \n    dat\n  }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimloul%2Fr-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimloul%2Fr-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimloul%2Fr-utils/lists"}