ICloud Photo Library optimize space

Hi, I just switched to the iCloud photo library. If I optimize space on my iphone and I need an high quality photo on my iphone (for example to edit it using an app), could I download only the photo that I need in high quality from iCloud?
thank you

Apple does not say what will happen, if your Photos Library is too large for iCloud. And it is risky to try to find out.
If you want only selected photos in iCloud, make your main System Photo Library small, and keep the bulk of your photos in a separate Photos Library.
That is, what I am doing - a small library for syncing to iCloud and across devices, and a large library with most of my photos.
You can switch between libraries by holding down the alt/options key while launching Photos.

Similar Messages

  • ICloud Photo Library - Optimize or not

    I am tempted to switch on "Optimize iPad / iPhone Storage" but am nervous about whether iCloud will really retain the original full resolution photos and videos. I have read some posts where people claim it does not.
    So my questions:
    1: Have you tested and positively confirmed that iCloud will retain the full resolution photos and videos?
    2: If I optimize on my iPad / iPhone and I want to email a picture, is it still possible to send the full resolution picture?
    3: Will it synchronize the full resolution picture with iPhoto on the Mac?
    Thanks.
    Karl

    albums keep appearing and disappearing on iCloud.com/Photos ... again with no title but containing, most of the time, corresponding photos (saying that because sometimes albums that I never created show up too, with a mixture of images picked randomly by the server) ... in any case no album is ever syncing back to my iPhone.
    How do I clean that mess? I don't mind losing the albums actually, what I mind is that they still exist but are not visible locally, preventing apps from using them. There's also the risk that they'll sync again one of these days, creating duplicate albums if I create them again manually in the meantime. But there's no way to manage albums on iCloud.com, that's the problem; otherwise I'd get rid of them there.

  • I have the iCloud Photo Library (Beta) turned on. The photos from my iPhone do get uploaded to the iCloud. The photos are then downloaded to my wife's iPhone (we share the iCloud account). How do I keep the photos from downloading to my wife's iPhone

    I do not want all the photos from my iPhone downloading to my wife's iPhone from iCloud? We share an iCloud account. How can I prevent the download to my wife's iPhone from iCloud. .The "Upload to My Photo Stream" is turned off on my iPhone. . I am running 8.1.3. 
    I have a related question. In order to same space on my iPhone is there a way to upload the photos to the iCloud and then delete them from my iPhone.

    The way to keep the photos from downloading to your wife's phone would be for her to go to Settings > iCloud > Photos > and turn off iCloud Photo Library. If that isn't an option, the other option would be for her to have her own Apple ID ( and possibly explore the new family sharing options https://www.apple.com/ios/whats-new/family-sharing/ )
    Regarding the "related question" see the quotes below from iCloud Photo Library beta FAQ - Apple Support
    Deleting a photo or video from your Photos app will also remove the item from iCloud Photo Library and from your iCloud storage allocation. Photos and videos you remove can be recovered from the Recently Deleted album for 30 days. After 30 days, your content will be removed from the Recently Deleted album.
    If you want to reduce the space used by photos on your phone, rather than deleting them see the following:
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    You can turn on Optimize [device] Storage from Settings > iCloud > Photos or Settings > Photos & Camera > iCloud Photo Library on your iPhone, iPad, or iPod touch. You need an Internet connection to access an original photo or video that’s stored only in iCloud.

  • ICloud Photo Library: How do I transfer photos and videos only from my iPhone to my iPad but not from my iPad to my iPhone?

    I had iCloud photo libraey turned on on both my iPad and iPhone. As said by the feature, photos and videos were being transferred automatically from each device to each other. I have a 64GB iPad Air 2 and my iPhone 5 only has 16GB of storage so I am lacking much more space on my iPhone than my iPad. I was wondering if there was a way to transfer photos only from my iPhone to my iPad but not from my iPad to my iPhone. Would turning off iCloud Photo library on my iPad do the trick? Thanks hope someone can help me out.

    iCloud Photo Library keeps all of your photos in the Cloud which you then can selectively download. So, unless you download the iPad photos, they are not going to be taking up any room on your iPhone:
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    You can turn on Optimize [device] Storage from Settings > iCloud > Photos or Settings > Photos & Camera > iCloud Photo Library on your iPhone, iPad, or iPod touch. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    Here is a link to the FAQs page for iCloud Photo Library:
    iCloud Photo Library beta FAQ - Apple Support
    Cheers,
    GB

  • IPhone photos app crashing consistently with large iCloud photo library beta - how can I completely remove?

    Hi - I turned on the iCloud photo library beta on my phone weeks ago.  Worked fine with no issues.  Then the Yosemite OS X beta 10.10.3 was released with the new Photos app.  Once i loaded that new app, it converted my Aperture library and began to upload around 75,000 photos.
    My iPhone almost immediately became sluggish (I assumed because it was downloading the pictures) and then eventually started crashing every time I go into the app (after a few seconds).  I assumed it was because it showed 75,000 images in my Cameral Roll/Moments so I turned of the iCloud photo library beta.  It prompted to be certain I was ok with deleting the images, which I said OK to.  But it still shows 75,000 images in the camera roll and anything I tried to do with any photo has become completely unusable (generally just crashing each time).
    Did I miss a step in the process?
    Is this just me?
    I'm trying to backup my iPhone but it keeps erroring out with the message "iTunes could not back up the iPhone "name" because the iPhone disconnected".  Otherwise I would just recreate .  Please help

    It can free up some storage but it doesn't work like Dropbox. See the following quotes from iCloud Photo Library beta FAQ - Apple Support
    I personally don't use iCloud Photo Library as it is still beta. Additionally, I have a Mac computer and there is not yet a Mac Photos app that is compatible.
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    How does iCloud delete photos and videos from iCloud Photo Library?
    Deleting a photo or video from your Photos app will also remove the item from iCloud Photo Library and from your iCloud storage allocation. Photos and videos you remove can be recovered from the Recently Deleted album for 30 days. After 30 days, your content will be removed from the Recently Deleted album. Photos are backed up on our servers for up to 30 days after they're deleted from the Photos app. If you need to recover these photos during that time, contact Apple Support.

  • ICloud Photo library storage optimisation

    I cannot make this think work..! Open , close IPL buttons...! but ...! same storage in my iPhone and in my iCloud..!

    See the quote below from iCloud Photo Library beta FAQ - Apple Support
    That link has some other details but doesn't explicitly state (at least that I could find) how the situation where you have photos from other sources added to iCloud Photo Library are dealt with on your phone if you no longer have space.
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.

  • ICloud photo library question

    So I can find hundreds of articles telling me that if you iCloud storage is full, your photos won't sync anymore. But if you have thousands of  photos, what will happen in my phone is eventually full?
    I mean, I have my "optimize iPhone storage" option turned on, but there will be a maximum right? Or are the optimized versions really that small of size?
    Thank you in advance for answering my question.
    Rafael

    Yeah - I'm not seeing anywhere that it states if there is a maximum of "optimized" photos you can keep on your device. I'm guessing that "optimized" photos must be much like iTunes in the Cloud where you can see all of your music (including what is stored in the cloud), but only the music you have actually downloaded will be on your physical device. So only the "original photos" that the management system have left on your device, or that you have specifically downloaded are actually on your device.
    Sorry I'm not 100% on that. I'll see if any of our Photo experts know for certain!
    But to answer your question about:
    "nowhere it's stated that your oldest/never viewed pictures will be removed from your device" I think this covers that particular question:
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    So, if original photos are the ones that are actually on your device, then it will remove older and least viewed original photos to maximize storage when needed.
    This is supported by the paragraph about turning off iCloud Photo Library:
    You can turn off iCloud Photo Library for a single iOS device by going to Settings > iCloud > Photos and turning off iCloud Photo Library beta. If you turned on Optimize [device] Storage, you might not be storing all original photos and videos on that device. To download the original photos and videos, select Download and Keep Originals.
    If it is off, you do not have access to those photos that are "optimized", so that supports the idea that they actually live in the cloud.
    Cheers,
    GB

  • ICloud Photo Library (beta) version?

    I have an iPhone 5c that was recently repaired and upgraded to iOS 8.2. A new feature I noticed was the Photos setting in iCloud, where I have the option to "Optimize iPhone Storage" or "Download and Keep Originals." The wording doesn't make sense to me, and the little description below isn't exactly clear either--what's the difference between the two? I take a ton of photos, so storage is important to me, but does that mean I have lower quality photos saved to my phone only? Or are lower quality photos being backed up on iCloud, too?
    Thanks!

    See the quotes below from iCloud Photo Library beta FAQ - Apple Support
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    What happens if I turn off iCloud Photo Library?
    You can turn off iCloud Photo Library for a single iOS device by going to Settings > iCloud > Photos and turning off iCloud Photo Library beta. If you turned on Optimize [device] Storage, you might not be storing all original photos and videos on that device. To download the original photos and videos, select Download and Keep Originals. Then you can turn iCloud Photo Library off. You can also select the items that you want to download within the beta Photos app on iCloud.com.
    You can disable iCloud Photo Library (and recover iCloud storage) for all devices by going to Settings > iCloud > Storage > Manage Storage > iCloud Photo Library beta, then selecting Disable and Delete. Once disabled, you will have 30 days to download your library to at least one device. You can download your photos and videos to your iOS device by turning on Keep Originals or by selecting the items to download from iCloud.com/photos.

  • ICloud Photo Library - Are my camera photos being compressed?

    When 'Optimize iPhone Storage' is selected, are the photos I take with the iPhone being compressed and the originals deleted locally after being uploaded, or is it just photos taken with an iPad which are then synced across other devices that are 'optimized'? I've searched online and can't seem to find an answer to this question.

    Greetings Mac_Man_Dan,
    Welcome to the Apple Support Communities!
    I understand that you have a question about how your photos are stored when you elect to optimize your iPhone storage. Please refer to the attached article for information on this question. 
    iCloud Photo Library beta FAQ - Apple Support
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    Cheers,
    Joe

  • ITunes sees all my iCloud photo Library photos on iPhone

    Here is a problem, see the screenshot below
    I suppose that this is all my iCloud Photo Library Photos but how could they be as a photos on device? Of course I have no space to sync even my tones... :/
    How to fix this problem? Any suggestions?
    Thanks in advance!

    A copy of iCloud Photo Library (beta) photos is stored on your phone. If you want to minimize the space required on your phone for that copy, see the quote below from iCloud Photo Library beta FAQ - Apple Support
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.

  • ICloud Photo Library (Final version) ?

    Hi guys,
    I know that iCloud Photo Library is now in beta version and also released to the public... but my question is, when will the final version be released? and will it include more features? like editing the photos from icloud.com and also view the recently deleted album and so? do any of you know or is there anything I can read more about the final version?
    Thankssssss

    See the quotes below from iCloud Photo Library beta FAQ - Apple Support
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    To turn on Optimize [device] Storage on your device, tap Settings > iCloud > Photos or Settings > Photos & Camera, then select Optimize [device] Storage. You need an Internet connection to access an original photo or video that’s stored only in iCloud.
    What happens if I turn off iCloud Photo Library?
    You can turn off iCloud Photo Library for a single iOS device by going to Settings > iCloud > Photos and turning off iCloud Photo Library beta. If you turned on Optimize [device] Storage, you might not be storing all original photos and videos on that device. To download the original photos and videos, select Download and Keep Originals. Then you can turn iCloud Photo Library off. You can also select the items that you want to download within the beta Photos app on iCloud.com.
    You can disable iCloud Photo Library (and recover iCloud storage) for all devices by going to Settings > iCloud > Storage > Manage Storage > iCloud Photo Library beta, then selecting Disable and Delete. Once disabled, you will have 30 days to download your library to at least one device. You can download your photos and videos to your iOS device by turning on Keep Originals or by selecting the items to download from iCloud.com/photos.

  • Deleting the pictures my camera roll to iCloud Photo Library beta?

    What if I delete several pictures from my camera roll then will it automatic to delete from iCloud Photo Library beta?

    Yes according to the quote below from iCloud Photo Library beta FAQ - Apple Support
    Deleting a photo or video from your Photos app will also remove the item from iCloud Photo Library and from your iCloud storage allocation. Photos and videos you remove can be recovered from the Recently Deleted album for 30 days. After 30 days, your content will be removed from the Recently Deleted album. Photos are backed up on our servers for up to 30 days after they're deleted from the Photos app.
    If you are wanting to keep the photo but reduce storage space used on the phone, the following quote from the same source may help:
    How does iCloud Photo Library save space on my device?
    If you turn on Optimize [device] Storage, iCloud Photo Library will automatically manage the size of your library on your iOS device, so you can make the most of your device's storage and access more photos than ever. iCloud Photo Library stores the original, high-resolution photos and videos in iCloud and can keep lightweight, device-optimized versions on each of your devices. As long as you have enough storage, recent photos and videos that you access the most will stay on your device at full resolution.
    You can turn on Optimize [device] Storage from Settings > iCloud > Photos or Settings > Photos & Camera > iCloud Photo Library on your iPhone, iPad, or iPod touch. You need an Internet connection to access an original photo or video that’s stored only in iCloud.

  • How does iCloud Photo Library and Optimize iPhone Storage Work?

    Even Apple Phone support can't answer these questions:
    How does iCloud Photo Library (Beta) from yesterday's 8.1 update with Optimize iPhone Storage turned on work? (I'm on an iPhone 6)
    It only stores your iPhone/iPad versions on your device, which is amazing. Why would you need anything else? It freed up around 8-10GB of space on my device which is amazing. But how does it work when you use it?
    When you email it seems to ask you, when sending what size you want to send like it's always done. It gives you the original 2.4MB version. This works like I'd imagine and when I received the test email the photo was correct. In this case I assume it hits iCloud and sends it from there, not your actual device. (Like it doesn't re-download it to email it). Correct?
    When posting to Facebook, does it do this same thing? Or is this something Facebook has to build into their iOS app in an update? Or does it just work? Correct?
    When posting to Instagram, does it grab the right version. Obviously the phone optimized version should be fine, but when viewing on a Desktop version of Instagram at instagram.com, will it show the right version?
    Sometimes I backup photos using Image Capture on the Mac. If I did that right now, would it only grab the iPhone versions? Obviously I can just test it but it'd be amazing if someone who knows these things could explain all of these use cases.
    Do you need to be on
    In closing it's more of how does this work? Does it work? Why wouldn't you want to use this feature if it saved space and made more sense? I guess I just would love some real clarity since not even the blogs are explaining how it works in every application.
    In closing part 2. It does seem to work really well, it's just those fringe cases. I just viewed all my photos on https://beta.icloud.com/#photos and they're all there, easy download of the high res, delete, it deletes from my camera roll on my phone, it's amazing, it works, it's magic. Just tell me what issues there are with storing only low res iPhone on my device and if there are none, game on!
    Thanks!

    santiagofrommiami wrote:
    And of those 4.3GB of backup, my Photo Library is 1.4GB.
    So my question is, how do I prevent my Photo Library from being backed up to the cloud, since I already have a backup of it everytime I connect to iPhoto and it copies all those photos to my mac?
    I don't know, sorry. It's supposed to work alongside Photos & iCloud, so that photos are stored only once. When it doesn't work you have a couple of options as I see it –
    Delete the old backups on iCloud to hopefully start over (I don't like deleting the only backup of anything).
    Forget about iCloud backups & use iTunes to backup instead, it might not be suitable if you have no computer etc.
    Buy more storage for iCloud.
    I don't use iCloud backup, it bemuses me with issues like this, there is no easy way to resolve when it fails.
    And one more question while we are at it...can I erase iphoto from my computer now that I have the new Photos app?
    That is up to you. If you are happy you do not need it & have a backup of it go ahead & remove it. You can re-download it from the app store if it is already in your Mac App store account.

  • ICloud photo library and iPhone/iPad storage space

    Hi,
    I use iCloud photo library beta for some time and it's a great feature for apple product. However, I'm a bit worried about what happend after some time. Now I have 20Gb of storage in iCLoud and 16Gb iPhone 6 and iPad air 2. On both of them is the "optimize iPhone/iPad storage" checked. What will happen after I would put 20Gb of photos to the iCloud and the iPhone and iPad wouldn't have enough storage to handle them (even when the photos are optimize)?
    Thanks for any response or a link where it is discussed,
    Jakub

    Hi jakudo,
    "optimize iPad/iPhone storage" means that photos don't have to take any storage capacity of your devices, if you are using your devices storage capacity e.g. for other content like music, apps etc. Your photos will be stored in the cloud and only a some of them are stored locally as long as you have storage space available. The only thing you have to do, is upgrading for more storage as soon as your passing the 20 GB.
    With kind regards,
    David

  • How does iCloud Photo Library backup photos & save iCloud space

    I was reading about how to free up some space on my iCloud account (5GB).
    Since the Camera Roll is the only thing that is backed up to iCloud, I would periodically import all my photos to iPhoto and delete them from my device.  This would make the Camera Roll pictures move over to my other albums which are NOT backed up to iCloud.  Now I ran into some apple documentation which explains what exactly gets backed up on an iOS device and its reads like this:
    Photos and videos on your iOS devices, unless you turn on iCloud Photo Library beta on your iOS 8.1 device. If you turn on iCloud Photo Library beta, your photos and videos are already stored in iCloud, so they aren’t included in your iCloud Backup.
    So basically if I turn on this iCloud Photo Library on my iOS device, it won't back up any photos to iCloud, because they are already stored in iCloud?  What does that mean?  Is this going to free up some iCloud space if I turn it on on my device?  If so, how exactly does it work that will save me space?
    Thanks

    santiagofrommiami wrote:
    And of those 4.3GB of backup, my Photo Library is 1.4GB.
    So my question is, how do I prevent my Photo Library from being backed up to the cloud, since I already have a backup of it everytime I connect to iPhoto and it copies all those photos to my mac?
    I don't know, sorry. It's supposed to work alongside Photos & iCloud, so that photos are stored only once. When it doesn't work you have a couple of options as I see it –
    Delete the old backups on iCloud to hopefully start over (I don't like deleting the only backup of anything).
    Forget about iCloud backups & use iTunes to backup instead, it might not be suitable if you have no computer etc.
    Buy more storage for iCloud.
    I don't use iCloud backup, it bemuses me with issues like this, there is no easy way to resolve when it fails.
    And one more question while we are at it...can I erase iphoto from my computer now that I have the new Photos app?
    That is up to you. If you are happy you do not need it & have a backup of it go ahead & remove it. You can re-download it from the app store if it is already in your Mac App store account.

Maybe you are looking for

  • How can I have acces to a component of a window from a menu

    In a JInternalFrame, I have one Button. I try to access to this Button from a ActionListener of a JMenuBar. In the ActionListener of the JMenuBar, I have use the function "MyActiveFrame = MyDesktop.getSelectedFrame();" for having a pointer to my JInt

  • Headphone jack not working

    Have had external speakers connected to headphone jack for over a year now, worked flawlessly.  Upgraded to Lion one month ago. Unplugged cord going to external speakers to plug in some headphones.  Headphones worked fine.  Unplugged headphones, plug

  • How to accomplish this

    Hello all, A table ('main') contains data for multiple years (2009, 2010, 2011) , department and expense. How can I duplicate in Oracle BI : select a.department, a.expense, a.year,b.department, b.expense, b.year, from main a, main b where a.departmen

  • Java.lang.ClassNotFoundException: oracle.j2ee.ws.wsdl.extensions.addressing

    Hello, I'm on weblogic 12c Im using a client generated by CFX plugin in Maven. Everything works fine but I have a lot of those lines in my log file. WARNING: Registering oracle.j2ee.ws.wsdl.extensions.addressing.AddressingExtensionRegistry extension

  • Can we create manually dictionary collection as like string plain text

    Dear All, Can we create manually dictionary collection as below in workflow with SharePoint designer? ["Value1","Value2","Value3","Value4",......,"Valuen"] or how can we update collection field(Multichoice) of listitem in sharepoint workflow? Mahendr