Unfortunately if the first environmental variable is found we can use that path but if not we must add additional folders to the path so `find_first_env` is not as useful as one would hope.  I did clean it up by adding a `Sys.getenv_force` utilitiy function:

    Sys.getenv_force <- function(env) {
        val <- Sys.getenv(env, unset = NA)
        if(!is.na(val)) return(val)
        stop("Could not find Windows environmental variables") 
    }
    # How to get reasonable window paths via environmental variables
    win_path_env <- function(type_appdata) {
        switch(type_appdata, 
        roaming =  {
            Sys.getenv_force("APPDATA")
        },
        local = {
            path <- Sys.getenv("LOCALAPPDATA", unset=NA)
            if(is.na(path)) { # environmental variable not defined in XP
                path <- file.path(Sys.getenv_force("USERPROFILE"),
                                  "Local Settings", "Application Data")
            }
            path
        },
        common = {
            path <- Sys.getenv("PROGRAMDATA", unset=NA)
            if(is.na(path)) { 
                path <- file.path(Sys.getenv_force("ALLUSERPROFILE"),
                                  "Application Data")
            }
            path
        }
        )
    }