Deedle icon indicating copy to clipboard operation
Deedle copied to clipboard

R plugin - data frame columns

Open tpetricek opened this issue 11 years ago • 1 comments

This commit (https://github.com/BlueMountainCapital/Deedle/commit/ef65df7fc1899aa8a152504eb74d221a9203b766) tried to fix an error where passing Deedle data frame to R would fail.

However, the problem isn't the size of the data frame, but instead, the column keys - the operation R.data_frame fails when the column names are not valid R identifiers. The $<- operation can handle that, because it takes the name as a string (not as a named param).

We should probably build data frames using $<- unless that is slower.

tpetricek avatar Nov 13 '13 15:11 tpetricek

I discussed this with @dshiber. He gave me another example which fails (which had a numeric column).

He suggested we build the dataframe by building a list and then converting to a frame:

> a=list()
> a[["1"]]=c(1,2,3)
> a[["a"]]=c(1,2,3)
> a
$`1`
[1] 1 2 3

$a
[1] 1 2 3

> data.frame(a)
  X1 a
1  1 1
2  2 2
3  3 3

hmansell avatar Nov 26 '13 15:11 hmansell