fveronesi / PlottingToolbox

3 stars 2 forks source link

Invalid subscript type 'list' when running Summary Tool #1

Open hminor711 opened 7 years ago

hminor711 commented 7 years ago

Hi Dr. Veronesi,

I'm receiving the following error from the Summary tool in the Plotting Toolbox. Can you offer any insight to what the problem might be? I'm using R version 3.3.1 (2016-06-21). Thank you!

Executing: Summary "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcToolbox\Toolboxes\PlottingToolbox-master\Sample_Data\EPA_Data_2014.csv" Temp;CO;NO2;SO2;AtmPres C:\Users\hminor\Desktop\Summary Start Time: Fri Aug 05 14:59:56 2016 Running script Summary... Loading required package: gridExtra Loading required package: sp Loading required package: moments [1] "Summary" [1] "Author: Fabio Veronesi" 'C:\Users\hminor\Desktop\Summary' already exists Error in [ : invalid subscript type 'list' Failed to execute (Summary). Failed at Fri Aug 05 14:59:56 2016 (Elapsed Time: 0.62 seconds)

fveronesi commented 7 years ago

Hello, I just downloaded the toolbox from GitHub and tested it with the settings you used and it worked fine. This is what I got:

Executing: Summary C:\Users\Fabio\Desktop\PlottingToolbox-master\Sample_Data\EPA_Data_2014.csv Temp;CO;NO2;SO2;AtmPres C:\Users\Fabio\Desktop\PlottingToolbox-master\Summary Start Time: Sat Aug 06 08:41:13 2016 Running script Summary... [1] "Summary" [1] "Author: Fabio Veronesi" 'C:\Users\Fabio\Desktop\PlottingToolbox-master\Summary' already exists TableGrob (2 x 1) "arrange": 2 grobs z cells name grob 1 1 (1-1,1-1) arrange gtable[rowhead-fg] 2 2 (2-2,1-1) arrange gtable[rowhead-fg] Completed script Summary... Succeeded at Sat Aug 06 08:41:13 2016 (Elapsed Time: 0,49 seconds)

I have R 3.3.0 installed, but that should not be the problem. Are you sure you have not modified the R script by accident? Could you please try to download once again the plotting toolbox from GitHub to your desktop and try again the summary tool from there?

hminor711 commented 7 years ago

I re-downloaded the plotting toolbox to my desktop, but I'm still receiving the same error. I have not modified the R script. Possibly it is related to the version of R?

fveronesi commented 7 years ago

I think I may have found the error. Sorry for the late reply but I was able to replicate your error only Today. On my PC the histogram script worked great until I decided to update the arcbindings library. From that point on some functions did not work any longer, and I received the error you mentioned. After some tests I was able to fix the issue.

It was in line 33, which was: data_summary <- data.frame(data[,variable[1]])

Basically, I had to use the function paste to make sure that the object variable[1] is a string. Now the code is: data_summary <- data.frame(data[,paste(variable[1])])

Please try to download again the Plotting Toolbox and re-test it. Many thanks, Fabio