-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using your package "flickRgeotag" - update needed? #11
Comments
Hi Maeve, |
Dear Remi, Many thanks, I will try this now. Best wishes, |
Hi Remi, I am still getting the same error unfortunately. Could this have to do with the fact that I cannot install the package "Rtools"? When I try to install that one I get an error message: package ‘Rtools’ is not available (for R version 4.0.1) Best, |
I think you are likely still using the 'old' version of the package? To confirm can you do:
Assuming that doesn't give you Rtools is not a package, but rather a tool used to build packages. You need it to install most packages you'll find on GitHub (including flickRgeotag), you can find it here for Windows: https://cran.r-project.org/bin/windows/Rtools/ Once you have installed Rtools, then you need to install devtools, then you can try to install flickRgeotag. |
Hi Remi, Thank you! After some trying around it appears to work now. The only thing is I cannot get a list of more than 250 photos. If I try the command ".allpages = TRUE" I get the same error as above. I assume the amount of output is simply too much for R. Do you happen to know a workaround here? Alternatively, I have tried setting the number of pictures returned by adjusting the arguments "per_page" and "page", but this doesn't appear to change anything. Ideally, I would want all pictures though (close to 280,000 in total). |
It sounds like it's a problem (that I didn't fix yet) with the package... I'll investigate, more from me soon |
OK, it should be fixed now! I should note that for 280,000 photos, you will encounter problems! I've noticed that if you ask the API for more than ~1500 photos, you do not get everything you asked for (likely flickr trying to protect its servers?). You need to narrow your search parameters (tags, dates, bbox) if you want to get ALL the data, but you can make many smaller queries. We've created
|
Hi Remi, Thank you, it worked now when I divided a year's worth of photos into 3 parts and then used splitbbox. This might be of interest to you, when I tried to apply splitbbox to the photos of a whole year it started off with many splitting iterations but in the end returned the following error: cannot open URL 'https://api.flickr.com/services/rest/?.......': HTTP status was '500 Internal Server Error'Error in splitbbox(api_key, sub_bbox[i], extras, .allpages, .usecache, : But I assume this is just Flickr not accepting such a large extraction. One more question, I am not sure how to use the output generated by splitbbox( ) as opposed to flickr.photos.search( ). The list generated appears to only contain coordinates, is there some way to "unpack" the information again? Or do you have some existing documentation/ user guide info typed up on this? Many thanks! |
@maevemaria , I have had issues with the .allpages=TRUE command retrieving an error, and I have managed to pin down the error to a tiny issue with the page number format in the restquery function. I guess that the package xml2 has been updated, and that has led to some issues with the flickRgeotag package: xml2 interprets the page numbers as double, while it should be a character (or probably numeric, didn't try that). If you use .allpages=FALSE, yo get the first 100 results; if you use .allpages=FALSE, page=as.character(10), you will get the 10th page (note the as.character for the page number). @remi-daigle , This seems like a minor issue coming from the xml2 package. My workaround right now is to make a frankestein function where I download the "raw" object as an object to my environment, and then extract from there the number of pages, which i subsequently include in a loop where I call the getphotos with as.character() in the page number. That works fine (for now). Drop me a line if I can help you :) ETA: This is the script I have used, and it works. It is not the most efficient, but it gets the job done. For flickr.photo.location<-list() #Create an empty list to store all the photo information queryparams<-list() for(w in 1:raw$photos$pages){ #loop through the pages temp[[w]]<-flickr.people.getPhotos(api_key = api_key,user_id=as.character(owners[j]),page=as.character(w),extras="geo,tags,date_taken,url_m",.allpages=FALSE)[,c("id","owner","latitude","longitude","url_m")] #All I want here is the photo ID (to get the unique values), coordinates and the link. this makes the dataset smaller and easier to handle } flickr.dataset<-do.call(rbind.data.frame,flickr.photo.location) #Here I collapse all the information I wanted to store |
Dear Dr Daigle,
I came across your package "flickRgeotag" which is exactly what I would need for my analysis using flickr.photo.search
However, when I try to use it I always end up with the same error, even when making use of your sample code flickr.photos.search(api_key, bbox=NULL, extras=c("geo","tags","date_taken","url_m"), output="metadata",.allpages=FALSE, .usecache=TRUE) found here: https://rdrr.io/github/remi-daigle/flickRgeotag/src/R/flickrphotossearch.R
The error I'm getting is:
Error in xml2::url_escape(searchparams[[item]]) : STRING_ELT() can only be applied to a 'character vector', not a 'double'
I would like to thank you in advance for your time on this matter!
Kind regards,
Maeve Smyth
The text was updated successfully, but these errors were encountered: