kaitlyngaynor / gorongosa-mesocarnivores

2 stars 0 forks source link

using strsplit #96

Closed klg-2016 closed 3 years ago

klg-2016 commented 3 years ago

https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/blob/18766daf4683188c19584924c38babb1c8aeddf1/Image%20ID/download-images-from-url.R#L24

I'm trying to use strsplit to create a "URL_Partial" column to use for naming the images, which I think I need to do. I'm having trouble figuring out how to use the function. What should my "split" argument be?

klg-2016 commented 3 years ago

also do you know what the two differen URLs are? zooniverse_url_0 and zooniverse_url_1?

kaitlyngaynor commented 3 years ago

I'll let you troubleshoot the coding part of this (you should test out my code as it is and let me know if you need any input data files to rerun it, have a look at strsplit documentation, etc) but I think that the two URLs refer to the two different images. Click em and confirm!

On Mon, Nov 9, 2020 at 9:08 AM klg-2016 notifications@github.com wrote:

also do you know what the two differen URLs are? zooniverse_url_0 and zooniverse_url_1?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/96#issuecomment-724147315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT7TJI3BYTJXXTNH4BLSPAOYZANCNFSM4TPTVSUA .

klg-2016 commented 3 years ago

OK yes that's exactly right for the images.

Do you have the url_info.csv file? I think that's the main file the script works on. I've also got the strsplit documentation open and I'll keep working at it--thanks!

kaitlyngaynor commented 3 years ago

I don't have that exact file, actually, as I think it was just an example. I think it takes two formats, some with columns for the full URL (starting with http://...) and some with just the last part of it (like "S3/E05/E05_R12/S3_E05_R12_IMAG1199.JPG"), which is why the script I wrote has two different options for dealing with those columns.

Sorry if this isn't helpful, I may have time to dig in more later this week!

On Mon, Nov 9, 2020 at 9:57 AM klg-2016 notifications@github.com wrote:

OK yes that's exactly right for the images.

Do you have the url_info.csv file? I think that's the main file the script works on. I've also got the strsplit documentation open and I'll keep working at it--thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/96#issuecomment-724174922, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT7CVWWDXOTGPSXBFSLSPAUPDANCNFSM4TPTVSUA .

klg-2016 commented 3 years ago

Yes that sounds right. The excel file has a column with the full URL and I'm struggling right now with creating a column with the unique identifiers for file names. I tried to use the column "subject_id", but got an error saying it was expecting a character argument. so now I'm trying to use strsplit (as recommended in the script, but not fully coded out) and getting confused. If you get a chance to look later in the week that would be great, and I'll keep working on it now! Thank you

kaitlyngaynor commented 3 years ago

Maybe it's treating subject_id as a factor? as simple as changing to character with dataframe$subject_id <- as.character(dataframe$subject_id)

On Mon, Nov 9, 2020 at 10:51 AM klg-2016 notifications@github.com wrote:

Yes that sounds right. The excel file has a column with the full URL and I'm struggling right now with creating a column with the unique identifiers for file names. I tried to use the column "subject_id", but got an error saying it was expecting a character argument. so now I'm trying to use strsplit (as recommended in the script, but not fully coded out) and getting confused. If you get a chance to look later in the week that would be great, and I'll keep working on it now! Thank you

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/96#issuecomment-724206399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT5GPRI723IBOBQXX4DSPA2ZVANCNFSM4TPTVSUA .

klg-2016 commented 3 years ago

I just tried that, and now I get a different error when I try to run the download code: Error in charToRaw(URL) : argument must be a character vector of length 1

kaitlyngaynor commented 3 years ago

Hmmm. How many records are you talking about here? I am wondering if it is even worth the headache of downloading them all to your hard drive to look at them, rather than just clicking the URL to view the image? And then just manually entering species name (rather than doing some other process locally to add metadata, which you'd then have to extract and rejoin with image data). Seems like you may be making your job harder than it has to be?

On Mon, Nov 9, 2020 at 11:02 AM klg-2016 notifications@github.com wrote:

I just tried that, and now I get a different error when I try to run the download code: Error in charToRaw(URL) : argument must be a character vector of length 1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/96#issuecomment-724212306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WTZU7UEVGWS4JA6PPXLSPA4C7ANCNFSM4TPTVSUA .

klg-2016 commented 3 years ago

I would certainly agree that it feels like I'm making my job harder than it has to be--this doesn't seem like it should be that hard. For mongoose, there are 360 separate camera instances (so 720 total images). Would you recommend just using the links?

kaitlyngaynor commented 3 years ago

Yeah probably!!

On Mon, Nov 9, 2020 at 11:11 AM klg-2016 notifications@github.com wrote:

I would certainly agree that it feels like I'm making my job harder than it has to be--this doesn't seem like it should be that hard. For mongoose, there are 360 separate camera instances (so 720 total images). Would you recommend just using the links?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kaitlyngaynor/gorongosa-mesocarnivores/issues/96#issuecomment-724217033, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT6L26223RZUMEZDEZTSPA5EXANCNFSM4TPTVSUA .

klg-2016 commented 3 years ago

Okay! I'll work with that, and if you have any thoughts on these issues please let me know!

kaitlyngaynor commented 3 years ago

Seems like this one can be closed too