I want to load a file with several pictures but the file is only recognised as value and not data.
So tried to load only one image (see below) and I get following error:
Error in load("C:/Users/Name/Bachelor/A_muscaria_pics/Amanita_muscariaTRUE133095.jpg") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning messages:
1: In readChar(con, 5L, useBytes = TRUE) :
truncating string with embedded nuls
2: file ‘Amanita_muscariaTRUE133095.jpg’ has magic number 'ÿØÿà'
Use of save versions prior to 2 is deprecated
and when I try to plot this picture i get following error:
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
I assume that this problem applies to every single one of my pictures. I am still fairly new to R and I have no clue how to solve this problem myself. I am more than happy to provide further information if it is needed.
base r doesn't have a load.images function, therefore you must be relying on a package.
Can you name the package please, and share at least a few lines of code of how you use it ?
Other pictures can be loaded without a problem only the ones in this specific folder are problematic. It may be related to the way I downloaded those via a code in Rstudio.
hmmm.
Wouldnt it be more straightforward to list.files on the jps to load as images ? then you could dispense with the large paste0 and str_extract_all codes ?
In the folder as they are , can you view them with normal image viewing software to verify that they are images ? its unclear if your image example of the mushroom, represents the file as it is or before your download of it.
what is the way you downloaded those via code in Rstudio ?
I'am using the large paste0 code to pair the images to a corresponding .csv-file in the end since the picture and the csv-file have a matching ID in their name. I don't know if it's possible with the other way.
Concerning the picture: Those are normal pictures and I can open/ view them with my image viewing software. I uploaded the picture from my file.
concerning the method of download:
I used an excel file with URLs to the pictures I wanted to download and I ran a code to do so.