From 9c51a141bb1ef712d005d03cf636c90b145ddc6f Mon Sep 17 00:00:00 2001 From: eneller Date: Sun, 17 May 2026 13:42:11 +0200 Subject: [PATCH] hw4 convert rinex nums --- hw4.Rmd | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw4.Rmd b/hw4.Rmd index d9cae30..19de32f 100644 --- a/hw4.Rmd +++ b/hw4.Rmd @@ -36,7 +36,6 @@ rinex_file <- rstudioapi::selectFile() ``` ```{r read-file} -# Function to extract Klobuchar parameters from a RINEX navigation file extract_klobuchar_parameters <- function(rinex_file) { ion_alpha <- numeric(4) ion_beta <- numeric(4) @@ -46,11 +45,11 @@ extract_klobuchar_parameters <- function(rinex_file) { while (length(line <- readLines(con, n = 1)) > 0) { if (grepl("ION ALPHA", line, fixed = TRUE)) { # Extract the 4 numeric values from the line - ion_alpha <- unlist(strsplit(line, "\\s+"))[2:5] + ion_alpha <- as.numeric(gsub("D", "e", strsplit(line, "\\s+")[[1]][2:5])) } if (grepl("ION BETA", line, fixed = TRUE)) { # Extract the 4 numeric values from the line - ion_beta <- unlist(strsplit(line, "\\s+"))[2:5] + ion_beta <- as.numeric(gsub("D", "e", strsplit(line, "\\s+")[[1]][2:5])) } # Stop reading if we've reached the end of the header (END OF HEADER) if (grepl("END OF HEADER", line, fixed = TRUE)) {