{
  "id": 181445,
  "title": "How to install R package?",
  "url": "/competitions/osic-pulmonary-fibrosis-progression/discussion/181445",
  "author_name": "",
  "post_date": "2020-09-08T20:49:37.456179500Z",
  "votes": 1,
  "comment_count": 11,
  "views": 0,
  "content": "<p>I'm new to Code Competitions, so this may be a silly question. Is there a way to install an R package for use in both training and submission that is not already available via the library() function?</p>\n<p>Thanks.</p>",
  "messages": [
    {
      "id": "1003343",
      "postDate": "09/08/2020 20:49:37",
      "content": "<p>I'm new to Code Competitions, so this may be a silly question. Is there a way to install an R package for use in both training and submission that is not already available via the library() function?</p>\n<p>Thanks.</p>",
      "rawMarkdown": "I'm new to Code Competitions, so this may be a silly question. Is there a way to install an R package for use in both training and submission that is not already available via the library() function?\n\nThanks.",
      "votes": null
    },
    {
      "id": "1003448",
      "postDate": "09/09/2020 01:50:12",
      "content": "<p>Hi! <a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a>, <br>\nHave you tried to create an R Notebook or Script? Below image with Instructions?<br>\n<a href=\"https://www.kaggle.com/rtatman/installing-custom-r-packages\" target=\"_blank\">installing-custom-r-packages</a></p>",
      "rawMarkdown": "Hi! @dslate, \nHave you tried to create an R Notebook or Script? Below image with Instructions?\n[installing-custom-r-packages](https://www.kaggle.com/rtatman/installing-custom-r-packages)",
      "votes": null
    },
    {
      "id": "1003468",
      "postDate": "09/09/2020 02:24:35",
      "content": "<p>Thanks C4rl05/V, I'll try the suggestions on that page (installing-custom-r-packages). By the way, the packages I'm thinking of installing are not \"custom\", they are just packages in Cran that aren't installed in the online notebook environment. Also, it looks like I have to turn Internet access on to do the installs, but how do I make the packages available for the submission run, when I have to have Internet off?</p>\n<p>\"Have you tried to create an R Notebook or Script?\". Yes, I have already made some submissions successfully from R scripts using only those packages loadable via the library() function.</p>",
      "rawMarkdown": "Thanks C4rl05/V, I'll try the suggestions on that page (installing-custom-r-packages). By the way, the packages I'm thinking of installing are not \"custom\", they are just packages in Cran that aren't installed in the online notebook environment. Also, it looks like I have to turn Internet access on to do the installs, but how do I make the packages available for the submission run, when I have to have Internet off?\n\n\"Have you tried to create an R Notebook or Script?\". Yes, I have already made some submissions successfully from R scripts using only those packages loadable via the library() function.",
      "votes": null
    },
    {
      "id": "1003470",
      "postDate": "09/09/2020 02:32:26",
      "content": "<p>Hi! <a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a>, sorry, but I'm not sure how this can be achieved in particular with the internet option being disabled to submit the model.</p>",
      "rawMarkdown": "Hi! @dslate, sorry, but I'm not sure how this can be achieved in particular with the internet option being disabled to submit the model.",
      "votes": null
    },
    {
      "id": "1003518",
      "postDate": "09/09/2020 03:55:42",
      "content": "<p>Thanks C4rl05/V, unfortunately I think you're correct. The reason I asked my question is that the comments in a new notebook say: \"This R environment comes with all of CRAN and many other helpful packages …\", but I have found several packages that are in CRAN (and which I have installed on my own machine) but are not available in the notebook environment. For example, voxel (voxel_1.3.5) is in CRAN, but when I try to load it in the notebook Console I get the message: \"Error in library(voxel): there is no package called 'voxel'\". voxel has been in Cran for over 2 years, so it isn't a question of it being added too recently.  Perhaps Kaggle staff could comment on why those packages are missing?</p>",
      "rawMarkdown": "Thanks C4rl05/V, unfortunately I think you're correct. The reason I asked my question is that the comments in a new notebook say: \"This R environment comes with all of CRAN and many other helpful packages ...\", but I have found several packages that are in CRAN (and which I have installed on my own machine) but are not available in the notebook environment. For example, voxel (voxel_1.3.5) is in CRAN, but when I try to load it in the notebook Console I get the message: \"Error in library(voxel): there is no package called 'voxel'\". voxel has been in Cran for over 2 years, so it isn't a question of it being added too recently.  Perhaps Kaggle staff could comment on why those packages are missing?",
      "votes": null
    },
    {
      "id": "1003537",
      "postDate": "09/09/2020 04:32:52",
      "content": "<p><a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a> Have you tried to upload the R package as an external dataset and install from there? E.g., download voxel.tar.gz from CRAN, upload it to Kaggle as an external dataset, then <code>install.packages('../input/VoxelData/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</code></p>",
      "rawMarkdown": "dslate Have you tried to upload the R package as an external dataset and install from there? E.g., download voxel.tar.gz from CRAN, upload it to Kaggle as an external dataset, then `install.packages('../input/VoxelData/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")`",
      "votes": null
    },
    {
      "id": "1003596",
      "postDate": "09/09/2020 05:44:32",
      "content": "<p>Thanks CoreyLevinson for the suggestion, but I had already tried that, at least in the notebook Console, with no success.  I ran into a couple of problems: one was that when I uploaded the package via \"Add data\" it insisted on changing the file name from voxel_1.3.5.tar.gz to voxel-135targz.  I assumed that install.packages would need a valid filename, but attempts to change the name via bash commands executed from R via 'system' failed with messages like \"Resource temporarily unavailable\".  Various other tricks also failed, and I finally gave up.</p>\n<p>If you manage to get an R package installed this way please let me know.</p>",
      "rawMarkdown": "Thanks CoreyLevinson for the suggestion, but I had already tried that, at least in the notebook Console, with no success.  I ran into a couple of problems: one was that when I uploaded the package via \"Add data\" it insisted on changing the file name from voxel_1.3.5.tar.gz to voxel-135targz.  I assumed that install.packages would need a valid filename, but attempts to change the name via bash commands executed from R via 'system' failed with messages like \"Resource temporarily unavailable\".  Various other tricks also failed, and I finally gave up.\n\nIf you manage to get an R package installed this way please let me know.",
      "votes": null
    },
    {
      "id": "1003604",
      "postDate": "09/09/2020 05:54:37",
      "content": "<p>David J Slate, I am pretty sure what you refer to as \"voxel-135targz\" is the name of the dataset, not the name of the file. So the full line of code would be <code>install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</code> If you make your voxel dataset public, I can take a look for you tomorrow.</p>",
      "rawMarkdown": "David J Slate, I am pretty sure what you refer to as \"voxel-135targz\" is the name of the dataset, not the name of the file. So the full line of code would be `install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")` If you make your voxel dataset public, I can take a look for you tomorrow.",
      "votes": null
    },
    {
      "id": "1003654",
      "postDate": "09/09/2020 06:44:48",
      "content": "<p>Thanks again CoreyLevinson, but I tried both:</p>\n<p>install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</p>\n<p>and:</p>\n<p>install.packages('../input/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</p>\n<p>but both fail with messages like:</p>\n<p>Warning message in install.packages(\"../input/voxel-135targz/voxel_1.3.5.tar.gz\", :<br>\n\"installation of package '../input/voxel-135targz/voxel_1.3.5.tar.gz' had non-zero exit status\".</p>\n<p>And library(voxel) still failed.</p>\n<p>I think I succeeded in making my voxel_1.3.5.tar.gz dataset public (this is the first time I've tried to do anything with datasets, and I find them somewhat confusing), so if you succeed in installing it I'll be most grateful, but also curious about how you did it.</p>",
      "rawMarkdown": "Thanks again CoreyLevinson, but I tried both:\n\ninstall.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")\n\nand:\n\ninstall.packages('../input/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")\n\nbut both fail with messages like:\n\nWarning message in install.packages(\"../input/voxel-135targz/voxel_1.3.5.tar.gz\", :\n\"installation of package '../input/voxel-135targz/voxel_1.3.5.tar.gz' had non-zero exit status\".\n\nAnd library(voxel) still failed.\n\nI think I succeeded in making my voxel_1.3.5.tar.gz dataset public (this is the first time I've tried to do anything with datasets, and I find them somewhat confusing), so if you succeed in installing it I'll be most grateful, but also curious about how you did it.",
      "votes": null
    },
    {
      "id": "1005983",
      "postDate": "09/11/2020 00:29:35",
      "content": "<p><a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a> It wasn't working because voxel_1.3.5 requires two dependencies to install. So you need to install the dependencies first. Please see my kernel for help on installing. Let me know if you have any other questions!</p>\n<p>Kernel: <a href=\"https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/\" target=\"_blank\">https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/</a></p>",
      "rawMarkdown": "dslate It wasn't working because voxel_1.3.5 requires two dependencies to install. So you need to install the dependencies first. Please see my kernel for help on installing. Let me know if you have any other questions!\n\nKernel: https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/",
      "votes": null
    },
    {
      "id": "1006020",
      "postDate": "09/11/2020 02:08:46",
      "content": "<p>Thanks CoreyLevinson for your diligent efforts on this.  I tried your method and it actually worked!  I can now do 'library(voxel)', at least in the Console, and with some luck it will work in my scripts as well. I simplified your commands just a bit by combining the 3 R packages into a single zip file.</p>",
      "rawMarkdown": "Thanks CoreyLevinson for your diligent efforts on this.  I tried your method and it actually worked!  I can now do 'library(voxel)', at least in the Console, and with some luck it will work in my scripts as well. I simplified your commands just a bit by combining the 3 R packages into a single zip file.",
      "votes": null
    },
    {
      "id": "1006095",
      "postDate": "09/11/2020 03:46:40",
      "content": "<p>to install other packages if they're on Kaggle, you need to find out their dependencies that need to be insalled, and wrap everything up in another zip. Good luck dude</p>",
      "rawMarkdown": "to install other packages if they're on Kaggle, you need to find out their dependencies that need to be insalled, and wrap everything up in another zip. Good luck dude",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1003448,
      "author_name": "cv13j0",
      "author_url": "",
      "post_date": "09/09/2020 01:50:12",
      "content": "<p>Hi! <a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a>, <br>\nHave you tried to create an R Notebook or Script? Below image with Instructions?<br>\n<a href=\"https://www.kaggle.com/rtatman/installing-custom-r-packages\" target=\"_blank\">installing-custom-r-packages</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1003468,
          "author_name": "dslate",
          "author_url": "",
          "post_date": "09/09/2020 02:24:35",
          "content": "<p>Thanks C4rl05/V, I'll try the suggestions on that page (installing-custom-r-packages). By the way, the packages I'm thinking of installing are not \"custom\", they are just packages in Cran that aren't installed in the online notebook environment. Also, it looks like I have to turn Internet access on to do the installs, but how do I make the packages available for the submission run, when I have to have Internet off?</p>\n<p>\"Have you tried to create an R Notebook or Script?\". Yes, I have already made some submissions successfully from R scripts using only those packages loadable via the library() function.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003470,
          "author_name": "cv13j0",
          "author_url": "",
          "post_date": "09/09/2020 02:32:26",
          "content": "<p>Hi! <a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a>, sorry, but I'm not sure how this can be achieved in particular with the internet option being disabled to submit the model.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003518,
          "author_name": "dslate",
          "author_url": "",
          "post_date": "09/09/2020 03:55:42",
          "content": "<p>Thanks C4rl05/V, unfortunately I think you're correct. The reason I asked my question is that the comments in a new notebook say: \"This R environment comes with all of CRAN and many other helpful packages …\", but I have found several packages that are in CRAN (and which I have installed on my own machine) but are not available in the notebook environment. For example, voxel (voxel_1.3.5) is in CRAN, but when I try to load it in the notebook Console I get the message: \"Error in library(voxel): there is no package called 'voxel'\". voxel has been in Cran for over 2 years, so it isn't a question of it being added too recently.  Perhaps Kaggle staff could comment on why those packages are missing?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003537,
          "author_name": "returnofsputnik",
          "author_url": "",
          "post_date": "09/09/2020 04:32:52",
          "content": "<p><a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a> Have you tried to upload the R package as an external dataset and install from there? E.g., download voxel.tar.gz from CRAN, upload it to Kaggle as an external dataset, then <code>install.packages('../input/VoxelData/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</code></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003596,
          "author_name": "dslate",
          "author_url": "",
          "post_date": "09/09/2020 05:44:32",
          "content": "<p>Thanks CoreyLevinson for the suggestion, but I had already tried that, at least in the notebook Console, with no success.  I ran into a couple of problems: one was that when I uploaded the package via \"Add data\" it insisted on changing the file name from voxel_1.3.5.tar.gz to voxel-135targz.  I assumed that install.packages would need a valid filename, but attempts to change the name via bash commands executed from R via 'system' failed with messages like \"Resource temporarily unavailable\".  Various other tricks also failed, and I finally gave up.</p>\n<p>If you manage to get an R package installed this way please let me know.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003604,
          "author_name": "returnofsputnik",
          "author_url": "",
          "post_date": "09/09/2020 05:54:37",
          "content": "<p>David J Slate, I am pretty sure what you refer to as \"voxel-135targz\" is the name of the dataset, not the name of the file. So the full line of code would be <code>install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</code> If you make your voxel dataset public, I can take a look for you tomorrow.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1003654,
          "author_name": "dslate",
          "author_url": "",
          "post_date": "09/09/2020 06:44:48",
          "content": "<p>Thanks again CoreyLevinson, but I tried both:</p>\n<p>install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</p>\n<p>and:</p>\n<p>install.packages('../input/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")</p>\n<p>but both fail with messages like:</p>\n<p>Warning message in install.packages(\"../input/voxel-135targz/voxel_1.3.5.tar.gz\", :<br>\n\"installation of package '../input/voxel-135targz/voxel_1.3.5.tar.gz' had non-zero exit status\".</p>\n<p>And library(voxel) still failed.</p>\n<p>I think I succeeded in making my voxel_1.3.5.tar.gz dataset public (this is the first time I've tried to do anything with datasets, and I find them somewhat confusing), so if you succeed in installing it I'll be most grateful, but also curious about how you did it.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1005983,
          "author_name": "returnofsputnik",
          "author_url": "",
          "post_date": "09/11/2020 00:29:35",
          "content": "<p><a href=\"https://www.kaggle.com/dslate\" target=\"_blank\">@dslate</a> It wasn't working because voxel_1.3.5 requires two dependencies to install. So you need to install the dependencies first. Please see my kernel for help on installing. Let me know if you have any other questions!</p>\n<p>Kernel: <a href=\"https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/\" target=\"_blank\">https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1006020,
          "author_name": "dslate",
          "author_url": "",
          "post_date": "09/11/2020 02:08:46",
          "content": "<p>Thanks CoreyLevinson for your diligent efforts on this.  I tried your method and it actually worked!  I can now do 'library(voxel)', at least in the Console, and with some luck it will work in my scripts as well. I simplified your commands just a bit by combining the 3 R packages into a single zip file.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1006095,
          "author_name": "returnofsputnik",
          "author_url": "",
          "post_date": "09/11/2020 03:46:40",
          "content": "<p>to install other packages if they're on Kaggle, you need to find out their dependencies that need to be insalled, and wrap everything up in another zip. Good luck dude</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "1003343": "I'm new to Code Competitions, so this may be a silly question. Is there a way to install an R package for use in both training and submission that is not already available via the library() function?\n\nThanks.",
    "1003448": "Hi! @dslate, \nHave you tried to create an R Notebook or Script? Below image with Instructions?\n[installing-custom-r-packages](https://www.kaggle.com/rtatman/installing-custom-r-packages)",
    "1003468": "Thanks C4rl05/V, I'll try the suggestions on that page (installing-custom-r-packages). By the way, the packages I'm thinking of installing are not \"custom\", they are just packages in Cran that aren't installed in the online notebook environment. Also, it looks like I have to turn Internet access on to do the installs, but how do I make the packages available for the submission run, when I have to have Internet off?\n\n\"Have you tried to create an R Notebook or Script?\". Yes, I have already made some submissions successfully from R scripts using only those packages loadable via the library() function.",
    "1003470": "Hi! @dslate, sorry, but I'm not sure how this can be achieved in particular with the internet option being disabled to submit the model.",
    "1003518": "Thanks C4rl05/V, unfortunately I think you're correct. The reason I asked my question is that the comments in a new notebook say: \"This R environment comes with all of CRAN and many other helpful packages ...\", but I have found several packages that are in CRAN (and which I have installed on my own machine) but are not available in the notebook environment. For example, voxel (voxel_1.3.5) is in CRAN, but when I try to load it in the notebook Console I get the message: \"Error in library(voxel): there is no package called 'voxel'\". voxel has been in Cran for over 2 years, so it isn't a question of it being added too recently.  Perhaps Kaggle staff could comment on why those packages are missing?",
    "1003537": "dslate Have you tried to upload the R package as an external dataset and install from there? E.g., download voxel.tar.gz from CRAN, upload it to Kaggle as an external dataset, then `install.packages('../input/VoxelData/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")`",
    "1003596": "Thanks CoreyLevinson for the suggestion, but I had already tried that, at least in the notebook Console, with no success.  I ran into a couple of problems: one was that when I uploaded the package via \"Add data\" it insisted on changing the file name from voxel_1.3.5.tar.gz to voxel-135targz.  I assumed that install.packages would need a valid filename, but attempts to change the name via bash commands executed from R via 'system' failed with messages like \"Resource temporarily unavailable\".  Various other tricks also failed, and I finally gave up.\n\nIf you manage to get an R package installed this way please let me know.",
    "1003604": "David J Slate, I am pretty sure what you refer to as \"voxel-135targz\" is the name of the dataset, not the name of the file. So the full line of code would be `install.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")` If you make your voxel dataset public, I can take a look for you tomorrow.",
    "1003654": "Thanks again CoreyLevinson, but I tried both:\n\ninstall.packages('../input/voxel-135targz/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")\n\nand:\n\ninstall.packages('../input/voxel_1.3.5.tar.gz', repos = NULL, type=\"source\")\n\nbut both fail with messages like:\n\nWarning message in install.packages(\"../input/voxel-135targz/voxel_1.3.5.tar.gz\", :\n\"installation of package '../input/voxel-135targz/voxel_1.3.5.tar.gz' had non-zero exit status\".\n\nAnd library(voxel) still failed.\n\nI think I succeeded in making my voxel_1.3.5.tar.gz dataset public (this is the first time I've tried to do anything with datasets, and I find them somewhat confusing), so if you succeed in installing it I'll be most grateful, but also curious about how you did it.",
    "1005983": "dslate It wasn't working because voxel_1.3.5 requires two dependencies to install. So you need to install the dependencies first. Please see my kernel for help on installing. Let me know if you have any other questions!\n\nKernel: https://www.kaggle.com/returnofsputnik/how-to-use-external-uploaded-r-libraries-on-kaggle/",
    "1006020": "Thanks CoreyLevinson for your diligent efforts on this.  I tried your method and it actually worked!  I can now do 'library(voxel)', at least in the Console, and with some luck it will work in my scripts as well. I simplified your commands just a bit by combining the 3 R packages into a single zip file.",
    "1006095": "to install other packages if they're on Kaggle, you need to find out their dependencies that need to be insalled, and wrap everything up in another zip. Good luck dude"
  },
  "source": "meta"
}