Set up R in VS Code for Windows 11 in 2023

Поділитися
Вставка
  • Опубліковано 8 лис 2024

КОМЕНТАРІ • 102

  • @kwizeralambert1316
    @kwizeralambert1316 Рік тому +6

    This is great, I have been wondering how you configure the R in VSCode. Thank you for this UA-cam. You are a great teacher.

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      Thank you for your kind words! I’m glad that you found the video helpful. If you have any other questions or suggestions, feel free to let me know. Have a great day!

  • @yifanwu620
    @yifanwu620 Рік тому +2

    Im a postgrad and about to start a project in R. Thank u very much!

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      Lovely! I hope this tutorial helps you set up R and start the adventure!

  • @Aaqib..
    @Aaqib.. Рік тому +2

    Ok this is something i was considering but didn't know where to start, grateful as always. Love the thumbnail btw💪🏻😂

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Hahaha, glad I hit the target 🎯 😂. Let me know how it goes 😉

  • @mahatmaalimibrahim6631
    @mahatmaalimibrahim6631 Рік тому +3

    Always amazing and relevant. A lot of people struggle to set up. Thank you.

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Thank you for your kind words! I’m glad that I could help. If you have any more questions or need further assistance, please don’t hesitate to ask

    • @mahatmaalimibrahim6631
      @mahatmaalimibrahim6631 Рік тому +1

      Thank you brother. So nice of you. Your generousity of knowledeg sharing, the quality of your presentation, and making sense of messed up data is unmatched. @@milos-makes-maps

  • @lbarq
    @lbarq Рік тому +1

    Thank you for the excellent tutorial. I use VS code to program in many programming languages, and knowing that it's possible for R is really nice. I will try it for sure

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      You’re welcome! I’m glad that you found the tutorial helpful. It’s great to hear that you use VS Code for programming in many languages. I hope that you find it just as useful for R. If you have any questions or need further assistance, please don’t hesitate to ask

  • @AleksPopovic
    @AleksPopovic Рік тому +1

    Great one Milos, we need more videos like this!

  • @solarenergynow08
    @solarenergynow08 Рік тому +2

    This is the best video that solved my installation issue: Working with R in VS Code for Windows 10, R Version 4.3.2. The Settings part in Win10 are different to access but are named the same as in Win11. Thanks. Now dealing with execution issues...
    Im Stuck with "Failed to get list of R functions. Make sure that `jsonlite` is installed and r.rpath.windows points to a valid R executable" AND "Error: '\U' used without hex digits in character string (:4:36) Execution halted". Have tried everything on the comments but cannot solve it..any guidance is welcome.

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Wow, I was just about to write my response to your previous question! Happy that you successfully resolved it. I'm glad you found the video helpful. Working with R in VS Code is a great way to improve your productivity and efficiency. Thank you for sharing your feedback and tips on how to access the settings in Windows 10. I appreciate your support and enthusiasm. 😊

    • @solarenergynow08
      @solarenergynow08 Рік тому +1

      @@milos-makes-maps Appreciate your getting back to me...I could not make VS Code work so I am working with RStudio... I am trying to use VS Code 1.84.1 with R 4.3.2 but there's just too many issues right now.(per my comment above. )

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      @@solarenergynow08 let's try to debug it together. Starting from the first error it complains about jsonlite not being installed. Can you check if that's true? Also, can you check the pathway to the library where jsonlite is installed?

    • @BboyDaquack
      @BboyDaquack 5 місяців тому

      @@milos-makes-maps Did you ever figure this out? I made sure the pathway was correct and jsonlite is installed. still get the same errors.

    • @ahmadkura9503
      @ahmadkura9503 4 місяці тому

      Having same issues. Were you able to resolve it??

  • @kevon217
    @kevon217 6 місяців тому +1

    Exactly what I was looking for. Appreciate it!

    • @fosimuboolubo8891
      @fosimuboolubo8891 5 місяців тому

      Good day. Did you R extension settings in vsCode contain RPath, cause mine did not.

  • @tornikeb8872
    @tornikeb8872 10 місяців тому +1

    Thank you! Very detailed and useful tutorial!

  • @iliasaretos
    @iliasaretos Рік тому +2

    Thanks a lot for your excellent video tutorial!!! I used to work with RStudio, nevertheless it became so much “heavy” and I believe that VS Code is the only serious alternative. I have a short question: How can I use the Ctrl + Shift + M for the %>% pipe? Thanks in advance!!!

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Hi @iliasaretos7442, I’m glad you enjoyed the RStudio tutorial!! VS Code is indeed a great alternative for working with R. For pipe %>% either type % and then TAB or use ctrl+shift+m shortcut in VSCode

  • @sweven9515
    @sweven9515 10 місяців тому +9

    thank you for this amazing tutorial but i have an error when running the " > languageserversetup::languageserver_install() " command
    the error reads : Error: Failed to install 'languageserver' from GitHub
    any solutions?

    • @Snaggletooth44
      @Snaggletooth44 7 місяців тому +3

      try running "Rgui" as administrator

    • @designedbyckb5427
      @designedbyckb5427 4 місяці тому

      @@Snaggletooth44 had the same issue as @sweven9515. Thank you for your help here

  • @magdalenaszulc8997
    @magdalenaszulc8997 16 днів тому +1

    You saved me from dropping from using R

  • @almaanahi6233
    @almaanahi6233 2 місяці тому +1

    The BEST VIDEO. I'm stuck on languageserversetup::languageserver_install() . I have an error, File name issue. Too long
    Ant solution? Please 🙏🏻

  • @oluwafemioyedele
    @oluwafemioyedele Рік тому +1

    Nice, l use radian before to integrate R with VS code but I really love your step!!@

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Thank you for your kind words! I’m glad that you found the tutorial helpful. It’s great to hear that you’ve used radian before to integrate R with VS Code. I hope that you find this method just as useful. If you have any questions or need further assistance, please don’t hesitate to ask

    • @oluwafemioyedele
      @oluwafemioyedele Рік тому

      @@milos-makes-maps When I run languageserversetup::languageserver_install() : I get the following error:
      The command ‘wmic process where processid=5580 get commandline’ cannot run successfully. Please make sure the software is available to use the package. Any suggestion ?

    • @oluwafemioyedele
      @oluwafemioyedele Рік тому

      I have been able to fix this, I discovered that there was a bug with windows

  • @emirhandemir3872
    @emirhandemir3872 9 місяців тому +1

    Hell yeah, I agree! I have no idea what I am agreeing but YES, I AGREE !

  • @ShenjianLi
    @ShenjianLi 4 місяці тому +2

    Just got a problem but resolved by myself is, when in the RGui, run: "languageserversetup::languageserver_install()" will cause an error, if not install Rtools. So install Rtools first before the tutorial.

    • @milos-makes-maps
      @milos-makes-maps  4 місяці тому

      Thanks for the tip! Can you share the error message?

  • @ronaldfranck2351
    @ronaldfranck2351 8 місяців тому +1

    A big thank

  • @kwizeralambert1316
    @kwizeralambert1316 Рік тому +1

    This is amazing, thank you.

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      My pleasure! I hope it'll work for you. Let me know how it goes 😉

    • @kwizeralambert1316
      @kwizeralambert1316 Рік тому +1

      @@milos-makes-maps I actually I have R, and VSCODE installed in my machine, but I have never had attempted to run R via VSCODE. I will try and see how it goes. I will let you know and give you suggestions

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      @@kwizeralambert1316 Thanks!

  • @Keroxez
    @Keroxez 11 місяців тому +1

    Thank you for the video, man. I got stuck in the R setup because I'm using WSL, I suppose. Does that mean I should install R on my Ubuntu subsystem instead of Windows to use it? If so, I would appreciate some guidance. Thank you!

    • @milos-makes-maps
      @milos-makes-maps  11 місяців тому

      Hey, sorry to hear that but I haven't used Linux

  • @chris7263
    @chris7263 5 місяців тому

    My problem might be that I’d already installed everything before watching this tutorial following other instructions, but it seemed like it was all working the same until you got to the end and then I couldn’t find the specific “rPath” settings in REditor? I’ve got most of the same ones as you do, but not those.

  • @ramasama
    @ramasama 6 місяців тому

    Thanks for the video. This is very detailed. I have one problem though during the installation of server language I get the following error:
    Error in dir.exists(rlsLib) :
    file name conversion problem -- name too long?
    Not doing anything, returning FALSE.
    My user folder has a character with an accent (í) I don't know if that could be the problem. I'm running it on windows 11. Do you have any idea how to resolve this?

    • @milos-makes-maps
      @milos-makes-maps  5 місяців тому

      The issue you're encountering seems to be related to a file name conversion problem, specifically an error stating "name too long" or a potential issue with special characters in the file path as you suggested. This can occur when the file path exceeds the maximum length allowed by the system or contains characters that are not recognized properly.
      To resolve this, you can try the following steps:
      1. Shorten the File Path: Try moving the file to a directory with a shorter path and see if that resolves the issue.
      2. Remove Special Characters: If your file path includes special characters, especially non-English ones, try renaming folders or files to remove them.
      3. Check File System Limitations: Different file systems have different limitations on file path lengths. Ensure that your file system supports the length of your file path.
      4. Update R and Packages: Make sure you are using the latest version of R and all relevant packages, as updates often include bug fixes for issues like these.

  • @burakt
    @burakt Рік тому +1

    Hi Milos, first of all thank you for this nice setup explanation. I wrote install.packages("languageservertup") in R Console, but this error came: Error: unable to create temporary directory ‘C:\Program Files\R\R-4.3.1\library\file3bf4617e185b’
    In addition: Warning message: In dir.create(tmpDir) : cannot create dir 'C:\Program Files\R\R-4.3.1\library\file3bf4617e185b', reason 'Permission denied'

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Hi Burak and thank you! It seems that you are having trouble creating a temporary directory in R console due to permission issues. Can you run the R console as an administrator? This will give you full access to the file system and avoid permission errors.

    • @solarenergynow08
      @solarenergynow08 Рік тому +1

      @@milos-makes-maps Hi, you'd have to run R as an Admin everytime you want to install packages, it is better to change permissions to the library folder using windows explorer (right click on folder. tab security and so on (plenty of how to videos ...). Worked for me and have not seen any setbacks...

    • @2sidessas334
      @2sidessas334 4 місяці тому

      @@milos-makes-maps Running Rgui solved the problem!!.

  • @boredom730
    @boredom730 8 місяців тому

    is there an environment tab for vscode just like the rstudio? i think environment pane is very important especially when scraping or saving objects

    • @milos-makes-maps
      @milos-makes-maps  8 місяців тому

      What is the environment tab? I never used RStudio

  • @reinadavisaoki8230
    @reinadavisaoki8230 3 місяці тому

    I am stuck with the opening up the R terminal part on VS code. The error message I get is "Cannot find R for creating R terminal. Change setting r.rterm.windows to R path." Any suggestions?

  • @Keving-fv3wp
    @Keving-fv3wp 4 місяці тому +1

    Whenever i open up the RGui, I'm prompted with the error message: '\i' is an unrecognized escape in character string (:4:43). I've been stuck at this part for a couple of hours and tried to research solutions but a no go. Anyone know anything that might work?

    • @milos-makes-maps
      @milos-makes-maps  4 місяці тому

      The error message you’re seeing in RGUI suggests that there’s an issue with an escape character in a string. In R, backslashes (\) are used as escape characters, which means they have a special meaning when used within strings. If you want to include a literal backslash in a string, you need to escape it by using two backslashes (\\).
      This error often occurs when setting file paths on Windows systems where the backslash is the default directory separator. If you’re setting a file path or working directory in your R profile or an R script that runs on startup, make sure all backslashes are properly escaped.
      If you’re not sure where the error is coming from, check any .Rprofile or .Renviron files in your home directory or R’s home directory, as well as any scripts or commands that run when R starts up.
      If the issue persists, you might want to consider using the file.path() function to construct file paths, as it automatically uses the correct file separator for your operating system:
      file.path("C:", "myfolder", "myfile")

  • @johannesdoermer840
    @johannesdoermer840 Рік тому +3

    When I try to download the packages with ("languageserversetup") the terminal prints: 'lib = "C:/Program Files/R/R-4.3.1/library" ' is not writable & it asks me if I want to use a personal library instead? What does this mean?

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      This means that you do not have permission to install packages in the default library location, which is usually reserved for system-wide packages. You have two options to fix this error:
      - You can answer yes to the question and create a personal library in your home directory, where you can install packages for your own use. This is the easiest and safest option, as it does not require changing any system settings or permissions.
      - You can change the permission of the default library location or add yourself to the staff group, so that you can write to it. This option may require administrator privileges or sudo access, and it may affect other users or programs that use R on your computer.

    • @solarenergynow08
      @solarenergynow08 Рік тому

      @@milos-makes-maps Hello, I had the same error; clicked "Yes", then selected the "cloud" option it started the download briefly and got this error: Error: unable to create temporary directory ‘C:\Program Files\R\R-4.3.2\library\filed787c0e7f64’ In addition: Warning message: In dir.create(tmpDir) : cannot create dir 'C:\Program Files\R\R-4.3.2\library\filed787c0e7f64', reason 'Permission denied'
      Solved issue by running the console as an administrator BUT now having issues with the " add to rprofile()" part: languageserversetup::languageserver_add_to_rprofile() Error in loadNamespace(x) : there is no package called ‘languageserversetup’ AND tried also: > languageserver::languageserver_add_to_rprofile() Error: 'languageserver_add_to_rprofile' is not an exported object from 'namespace:languageserver'
      Appreciate some help/guidance.. Edited: Solved...retyped the instruction again and it went through....maybe a space made the difference...Thanks

    • @yashsindhu9520
      @yashsindhu9520 10 місяців тому

      I am having the same issue please tell how to create a library .HELP PLEASE.......
      @@milos-makes-maps

    • @RenegadeZac
      @RenegadeZac 8 місяців тому +2

      @@yashsindhu9520 I know this is a month late but I had this issue and simply resolved it by running R as an administrator

  • @newtube4618
    @newtube4618 Місяць тому

    '\U' used without hex digits in character string i always get this error... anyone help?

  • @andrea-mj9ce
    @andrea-mj9ce Рік тому +1

    When I click on "R Terminal", I get the error message
    _The terminal process failed to launch: Path to shell executable "PATH\\R\\R-4.1.2\\bin\\x64\\R.exe" does not exist._

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      Hey, this message suggests that the path to R executable is incorrect. Are you getting this error when you try to open a new R terminal in VS code? If yes, then you need to find the path to the folder with R exe on your local drive and enter this path in Rpath Windows, which is in Extensions -> R -> settings

    • @andrea-mj9ce
      @andrea-mj9ce Рік тому +1

      ​@@milos-makes-maps Indeed, I added the R path and the R term, and now it works. For info, I used a double backslah for the path '\\'

    • @pinkyc7328
      @pinkyc7328 11 місяців тому

      I don’t find R document in the new file list

  • @bryanlee3197
    @bryanlee3197 Рік тому +2

    Error: '\U' used without hex digits in character string (:4:36)
    Execution halted
    Im having this problem. I dont know what wend wrong. Just follow your procedure

    • @bryanlee3197
      @bryanlee3197 Рік тому +1

      it works now i change the rprofile from \ to /.

    • @yashkumar6623
      @yashkumar6623 10 місяців тому

      @@bryanlee3197 how did you fix this? can you explain a bit?

    • @bryanlee3197
      @bryanlee3197 10 місяців тому

      @@yashkumar6623 i just updatr my rprofile and json file.

    • @AbhishekKumar-dx8fb
      @AbhishekKumar-dx8fb 2 місяці тому

      I am also facing similar error while installing software

    • @AbhishekKumar-dx8fb
      @AbhishekKumar-dx8fb 2 місяці тому

      If you have any solution then please tell us.

  • @lillalaurakis1514
    @lillalaurakis1514 Рік тому +1

    i get this error message Error: '\U' used without hex digits in character string (~/.Rprofile:4:36) i dot know wheres the problem

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Hi, R complains about using a backslash (\\) in the file path, which causes the error: Error: 'U' used without hex digits in character string (~/.Rprofile:4:36). This is because the backslash is used to indicate special characters or hexadecimal numbers in R, and the letter U does not have a special meaning. There are two ways to fix this error:
      - Use forward slashes (/) instead of backslashes in the file path. For example, instead of writing ~/.Rprofile, write ~/Rprofile.
      - Use double backslashes (\\\\) instead of single backslashes in the file path. For example, instead of writing ~/.Rprofile, write ~\\.Rprofile.
      Can you find out where the error pops up?

    • @lillalaurakis1514
      @lillalaurakis1514 Рік тому +1

      @@milos-makes-maps the error message pops out whenever I try to use R in VS. Can you tell me wich pathways I need to change? The one in the R settings or the one in my windows enviroment variables?

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      Hey, try to find the path to the folder with R.exe on your local drive and change the path in Rpath Windows, which is in Extensions -> R -> settings

    • @solarenergynow08
      @solarenergynow08 Рік тому +1

      Same here. Cannot figure it out yet.@@milos-makes-maps

    • @milos-makes-maps
      @milos-makes-maps  Рік тому +1

      Does the below tip help?
      - Use forward slashes (/) instead of backslashes in the file path. For example, instead of writing ~/.Rprofile, write ~/Rprofile.

  • @fauziyahya1010
    @fauziyahya1010 10 місяців тому

    How many times have I tried to install it but it still doesn't work?

    • @milos-makes-maps
      @milos-makes-maps  10 місяців тому

      Hey, can you specify where the issue occurs?

  • @simaroy4900
    @simaroy4900 Місяць тому

    in my laptop this error is coming: Error: unable to create temporary directory ‘C:\Program Files\R\R-4.4.1\library\file35185303578d’
    In addition: Warning message:
    In dir.create(tmpDir) :
    cannot create dir 'C:\Program Files\R\R-4.4.1\library\file35185303578d', reason 'Permission denied'
    Plss tell me why this was happening

  • @samuelbrown9634
    @samuelbrown9634 11 місяців тому +1

    Hello @milo-makes-maps thank you for the tutorial, please I'm having this issue, languageserversetup::languageserver_install()
    Error in languageserversetup::languageserver_install() :
    The command ‘wmic process where processid=8396 get commandline’ cannot run successfully.
    Please make sure the software is available to use the package.
    Can you please assist me. Thank You

    • @milos-makes-maps
      @milos-makes-maps  11 місяців тому

      Hey, are you getting this error on Windows?

    • @samuelbrown9634
      @samuelbrown9634 11 місяців тому +1

      @@milos-makes-maps Yes I am, Windows 10

    • @milos-makes-maps
      @milos-makes-maps  11 місяців тому

      @@samuelbrown9634 The error message says that the command 'wmic process where processid=8396 get commandline' cannot run successfully. This command is used to get the command line arguments of a process with a given process ID.
      According to the web search results, this error may be due to the fact that you do not have the libcurl package installed on your system. This package is required for the curl package in R, which is a dependency of the languageserver package. Check if the libcurl package is installed. Otherwise you need to install it.
      After installing it, you can try to install the languageserver.
      I hope this helps you debug your issue. If you have any other questions, please feel free to ask me. 😊

    • @samuelbrown9634
      @samuelbrown9634 11 місяців тому

      @@milos-makes-maps Thank you so much for your help and feedback

    • @samuelbrown9634
      @samuelbrown9634 11 місяців тому

      @@milos-makes-maps I've tried installing libcurl package the output was "A version of this package for my intalled R is not available.

  • @joseeduardomartinezsanchez3535

    Hi, I'm getting this error message when trying to install the languageserver package:
    Installing package into ‘C:\Users\jose.martinez\OneDrive\Documents/languageserver-library’
    (as ‘lib’ is unspecified)
    * installing *source* package 'languageserver' ...
    ** using staged installation
    ** libs
    Error in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"), :
    'make' not found
    * removing 'C:/Users/jose.martinez/OneDrive/Documents/languageserver-library/languageserver'

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      You don't have compilers and/or build tools on your machine. What is your OS?

    • @joseeduardomartinezsanchez3535
      @joseeduardomartinezsanchez3535 Рік тому

      @@milos-makes-maps my OS is Windows 10

    • @milos-makes-maps
      @milos-makes-maps  Рік тому

      The error message indicates that you don't have the make utility installed on your Windows 10 system. Make is a tool that helps you compile and build programs from source code. You need to install make before you can install the languageserver package. There are different ways to install make on Windows 10. You can use a package manager like Chocolatey or Winget, or you can download and install it manually from GnuWin32