Closed ArkaB-DS closed 2 years ago
If the "if condition" is to check whether is all the elements in the ram vector is NA, then a better solution maybe -
if (all(is.na(ram))) return (NA)
. Then, in the following codeblock-
clean_win_ram = function(ram) {
ram = remove_white(ram)
ram = ram[nchar(ram) > 0]
sum(as.numeric(ram))
}
should have "sum(as.numeric(ram), na.rm=T)" to deal with ram = c("8589934592 \r" "NA" ) i.e. atleast one element is NA in the ram vector. In my case, since I have two RAM slots, get_windows_ram() gives "8589934592 \r" "\r" . So, the
length(ram) >1 || is.na(ram)
will always return NA.
Merged into dev
. I'll ask questions there. Thanks
This pull request attempts to fix the "NA B" output of get_ram() function in Windows 10.