Skip to content

Tag: r

Select Rows That Does Not Contain any Negative Or Missing Value

Assume a database table has a few hundred columns. In SQL statements, how would you select rows/records that do not contain any negative or missing value? Can you do it using the sqldf package for R users? Here is an example of data frame with 6 rows and 2 columns: The SQL statement(s) should only return a ta…

Creating a cumulative sum column with_order in R

I’m working alongside a SQL tutorial using queryparser and tidyquery in R. This has been going well until I was asked to do: Tidyquery reported that it did not support OVER functions so I am trying to replicate the OVER (PARTITION BY…) function with dplyr. This led me to with_order(order_by =&#823…

Permission denied when using file.remove in R after updating to 4.1.1

After updating from 3.6.3 to 4.1.1 a weekly script I run broke. Specifically it triggers an error: To manually delete temp.csv I get a file in use by rsession.exe error from windows. If I restart R in Rstudio, then both file.remove() and manually deleting work. It might be that I’m using a bad stratgy i…