pinskylab / OceanAdapt

Scripts and data for OceanAdapt website to visualize shifts in marine animal distributions
http://oceanadapt.rutgers.edu
MIT License
13 stars 6 forks source link

Package versions and reading CSV files tag df511 #138

Closed john-f-kennedy-zz closed 3 years ago

john-f-kennedy-zz commented 3 years ago

0) RStudio and R version information at bottom 1) Downloaded OceanAdapt-update2020.zip file on Jan. 22, 2021 2) Extracted files 3) Open OceanAdapt.Rproj and executed comile.R scripts 4) install_version fails for all listed packages 5) library() loads packages, but have to try twice (run line twice) 6) Use Run to step through code. The "Compile AI" section fails at: temp_csv <- read_csv(temp_fixed)

With Error: Error: 'LATITUDE,LONGITUDE,STATION,STRATUM,YEAR,DATETIME,WTCPUE,NUMCPUE,COMMON,SCIENTIFIC,SID,BOT_DEPTH,BOT_TEMP,SURF_TEMP,VESSEL,CRUISE,HAUL 51.48754,-178.55987,153-12,423,2014,07/08/2014 21:05,1.2743,.7654,walleye pollock,Gadus chalcogrammus,21740,216,4.6,6,176,201401,12251.48754,-178.55987,153-12,423,2014,07/08/2014 21:05,.0099,-9999,parchment tubeworms,Chaetopterus sp.,50013,216,4.6,6,176,201401,12251.48754,-178.55987,153-12,423,2014,07/08/2014 21:05,.0023,.3827,spiny lumpsuckers,Eumicrotremus sp.,22183,216,4.6,6,176,201401,12251.48754,-178.55987,153-12,423,2014,07/08/2014 21:05,.4018,-9999,,Fanellia compressa,44090,216,4.6 In addition: Warning messages: 1: In if (grepl("\n", x)) { : the condition has length > 1 and only the first element will be used 2: In if (grepl("\n", path)) return(path) : the condition has length > 1 and only the first element will be used 3: In if (is_url(path)) { : the condition has length > 1 and only the first element will be used 4: In if (file.exists(path)) return(normalizePath(path, "/", mustWork = FALSE)) : the condition has length > 1 and only the first element will be used 5: In if (!is_absolute_path(path)) paste0(" in current working directory ('", : the condition has length > 1 and only the first element will be used

RStudio Version 1.1.456 – © 2009-2018 RStudio, Inc. Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/538.1 (KHTML, like Gecko) rstudio Safari/538.1 Qt/5.6.2

R _Version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x8664-w64-mingw32/x64 (64-bit)

john-f-kennedy-zz commented 3 years ago

I checked the file and that portion of the script; all good there. I followed up on suggestion that the issue may be related to using RStudio in Anaconda. Using my personal laptop I downloaded R, RTools, and RStudio and I was able to run the R script without too much trouble. It did glitch on a few CSV files that were still zipped, but I was able to extract those and successfully was able to run the script.

john-f-kennedy-zz commented 3 years ago

Resolved by using R, RTools, and RStudio outside of Anaconda.