fslaborg / RProvider

Access R packages from F#
http://fslab.org/RProvider/
Other
235 stars 69 forks source link

Replace "." with "_" in package names #245

Closed nhirschey closed 2 years ago

nhirschey commented 2 years ago

Proposed Changes

Fixes #226. Specifically, in packages like data.table the package name should have an underscore rather than a period for consistency.

Types of changes

Technically a breaking change but given 2.0 is just released I think it is reasonable to include.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

With the new functionality intellisense on open statements works as one would expect when trying to find data.table (before the change it would show data only, see the raised issue):

image

Here's output from interactive:

open RDotNet
open RProvider
open RProvider.data_table

let flights = R.fread("https://raw.githubusercontent.com/Rdatatable/data.table/master/vignettes/flights14.csv")

let names = R.names(flights).AsCharacter() |> Seq.toList

[ for nm in names[..3] -> 
    nm, flights.AsDataFrame()[nm] |> Seq.take 3 ]
|> List.iter (printfn "%A")    
("year", seq [2014; 2014; 2014])
("month", seq [1; 1; 1])
("day", seq [1; 1; 1])
("dep_delay", seq [14; -3; 2])
val flights: RDotNet.SymbolicExpression
val names: string list =
  ["year"; "month"; "day"; "dep_delay"; "arr_delay"; "carrier"; "origin";
   "dest"; "air_time"; "distance"; "hour"]
val it: unit = ()
AndrewIOM commented 2 years ago

Thanks - this looks great. I agree that we can get away with this breaking change in a 2.0.2 or similar release, since 2.0 is such a big change anyway. I'll merge this.

It could also be argued that this is a bug fix, as we state that all R names with dots in general are replaced by underscores in the docs.