On 10-Oct-2018, at 8:42 AM, Hao Ye <[log in to unmask]> wrote:
Hi Vratika,This list strives to be beginner friendly. However, we still ask that you PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I'm going to try and rephrase your question because I think there are multiple elements to it, and that is making it difficult to help out. I would like the list to be a place where people feel comfortable asking for R help, and I think it will help everyone to see how to structure requests.
Setup:* multiple image files in a folder* metadata that contains file paths for the images, and other info (see example csv attached)
Goal:In a new location:* make subfolders for each individual species* copy the corresponding image files into those subfolders
Then the steps seem to me to be:
1. read in the metadata into R2. for each individual species, make a new subfolder (e.g. `/users/vratika/desktop/elephant/`)3. for each image file for that species, copy it into the subfolder (e.g. `/users/vratika/desktop/elephant/<filename>`)
So, questions to you:Which parts are you stuck on?How do you want to choose the filename?Do you want to save the metadata, and where? (I strongly recommend you do this, obvious choice might be `/users/vratika/desktop/image_metadata.csv`)
On Tue, Oct 9, 2018 at 10:34 PM, Chaudhary,Vratika <[log in to unmask]> wrote:
This is a question regarding file path change. I have an image database, from a camera trap data management software (camelot) from which I need to seperate certain specific images into a different folder. Each of the image has a metadata associated with it, one of the metadata being species tag. I want to extract only specific species in a separate folder. It is a data frame where each row represents a single image which has a specific path (pasted below). Hence my question is regarding trying to change absolute file path in R, I am trying to do so using file.path but haven’t been successful. Alternatively, if I use file.copy - is there a way to choose ‘pattern’ so that species with a specific metadata (e.g. Elephant) gets selected. Also attached is the csv with first 10 rows of the data.
I would need to change the path to something like:
from the existing path:
Application Support/camelot/Media/ce/ ceab3647-bc09-45a3-9505- c17d5166d446.jpg
Application Support/camelot/Media/1e/ 1e9ca86c-18a2-42c5-8903- 0b8e1af46bc9.jpg
Application Support/camelot/Media/4e/ 4e6ead9b-b6fc-4c4d-b9c7- 54055fe7a0d9.jpg
Application Support/camelot/Media/57/ 57953a3d-5083-4041-804e- 7b6a0d00b546.jpg
Application Support/camelot/Media/59/ 59255c10-20da-4fa0-9b2b- 1a9f3690f951.jpg
Application Support/camelot/Media/cb/ cb256dc1-5958-4881-a3f5- 12e80fcb178e.jpg
This list strives to be beginner friendly. However, we still ask that you
PLEASE do read the posting guide https://urldefense.proofpoint.
com/v2/url?u=http-3A__www.R- 2Dproject.org_posting-2Dguide. html&d=DwIGaQ&c= pZJPUDQ3SB9JplYbifm4nt2lEVG5pW x2KikqINpWlZM&r=SEmRVMqAFbH_ Cx3K2dozZfH2QG2rALCjx8XkDKdS6d E&m= Gwaby9SdCvf1bJvHiNRn2KzbAcRIXu uhQ4DVVeCUuo0&s= nnvHhuLL0Pvv2ZVeNiEfPRU5lY7OUp d0jJZSE17zeHA&e=
and provide commented, minimal, self-contained, reproducible code.
This list strives to be beginner friendly. However, we still ask that you PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.