Get full path to current R script

Are you wondering where is my current R script file located and how to determine the full path? Here is how to do that in RStudio or while running in batch mode.

Execute Windows CMD command (PowerShell) from R script

Here is an example of how to execute the Windows CMD command or PowerShell from R script. You can run cmd.exe by using the system function, and input might be something that you can run in CMD.

R time shift problem after merging data

After merging two data frames by the date column, something weird was happening. The records did not match, and one of the date columns appeared with an additional timestamp. In the beginning, I was thinking that something is wrong with the join function from dplyr function that I was using. But as always, there was… Continue reading R time shift problem after merging data

Play a sound at the end of R script in Windows command line

In my post about favorite RStudio tips and tricks, I mentioned sounds that could be played during R script execution. It works great but doesn’t make a sound after running R script from the Windows command line. Here is how to do that by using PowerShell and adding additional lines in the same batch file.

How to rename data frame columns in R

Here are multiple ways how to rename columns in R using base functionality or dplyr functions like rename and select.

R error in data.frame : undefined columns selected

For me, R error undefined columns selected appears when I try to select some of the columns to keep in the data frame. It is easy to solve. You have to search for the misspelled column name, but if there is a long list of column names, then here is how to do that quickly.

Exit mobile version