Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
137 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ os: | |
- linux | ||
- osx | ||
julia: | ||
- 0.4 | ||
- 0.5 | ||
- nightly | ||
notifications: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
julia 0.4 | ||
DataStructures | ||
DataArrays 0.3.8 | ||
DataFrames 0.7.6 | ||
julia 0.5 | ||
DataStructures 0.4.3 | ||
DataFrames 0.8.3 | ||
NullableArrays 0.0.9 | ||
CategoricalArrays 0.0.6 | ||
Compat 0.8 | ||
@windows WinReg | ||
@windows WinReg 0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,52 @@ | ||
using DataArrays,DataFrames | ||
using NullableArrays,CategoricalArrays,DataFrames | ||
|
||
v110 = rcopy(DataArray,reval("x <- 1:10")) | ||
@test isa(v110,DataVector) | ||
@test eltype(v110) == Cint | ||
@test isequal(rcopy(Nullable, RObject(1)), Nullable(1)) | ||
@test isequal(rcopy(Nullable, RObject("abc")), Nullable("abc")) | ||
@test rcopy(RObject(Nullable(1))) == 1 | ||
@test isnull(rcopy(Nullable, RObject(Nullable(1, true)))) | ||
|
||
v110 = rcopy(NullableArray,reval("c(1L, NA)")) | ||
@test isa(v110,NullableVector) | ||
@test eltype(v110) == Nullable{Int32} | ||
@test isnull(rcopy(NullableArray, RObject(v110[2]))[1]) | ||
|
||
attenu = rcopy(DataFrame,:attenu) | ||
@test isa(attenu,DataFrame) | ||
@test size(attenu) == (182,5) | ||
|
||
dist = attenu[:dist] | ||
@test isa(dist,DataArray{Float64}) | ||
@test isa(dist,Vector{Float64}) | ||
station = attenu[:station] | ||
@test isa(station,NullableCategoricalArray) | ||
|
||
@test rcopy(DataArray,"c(NA,TRUE)").na == @data([NA,true]).na | ||
@test rcopy(DataArray,"c(NA,1)").na == @data([NA,1.0]).na | ||
@test rcopy(DataArray,"c(NA,1+0i)").na == @data([NA,1.0+0.0*im]).na | ||
@test rcopy(DataArray,"c(NA,1L)").na == @data([NA,one(Int32)]).na | ||
@test rcopy(DataArray,"c(NA,'NA')").na == @data([NA,"NA"]).na | ||
@test_throws ErrorException rcopy(DataArray,"as.factor(c('a','a','c'))") | ||
@test rcopy(PooledDataArray,"as.factor(c('a','a','c'))").pool == ["a","c"] | ||
@test isequal(rcopy(NullableArray,"c(NA,TRUE)"), NullableArray([true,true], [true,false])) | ||
@test isequal(rcopy(NullableArray,"c(NA,1)"), NullableArray([true,1.], [true,false])) | ||
@test isequal(rcopy(NullableArray,"c(NA,1+0i)"), NullableArray([true,1.+0*im], [true,false])) | ||
@test isequal(rcopy(NullableArray,"c(NA,1L)"), NullableArray([true,one(Int32)], [true,false])) | ||
@test isequal(rcopy(NullableArray,"c(NA,'NA')"), NullableArray(["", "NA"], [true,false])) | ||
@test_throws ErrorException rcopy(NullableArray,"as.factor(c('a','a','c'))") | ||
@test CategoricalArrays.levels(rcopy(CategoricalArray,"factor(c('a','a','c'))")) == ["a","c"] | ||
@test CategoricalArrays.levels(rcopy(NullableCategoricalArray,"factor(c('a',NA,'c'))")) == ["a","c"] | ||
@test CategoricalArrays.ordered(rcopy(CategoricalArray,"ordered(c('a','a','c'))")) | ||
@test CategoricalArrays.ordered(rcopy(NullableCategoricalArray,"ordered(c('a',NA,'c'))")) | ||
|
||
@test rcopy(DataArray,RObject(@data([NA,true]))).na == @data([NA,true]).na | ||
@test rcopy(DataArray,RObject(@data([NA,1]))).na == @data([NA,1]).na | ||
@test rcopy(DataArray,RObject(@data([NA,1.]))).na == @data([NA,1.]).na | ||
@test rcopy(DataArray,RObject(@data([NA,1.+0*im]))).na == @data([NA,1.+0*im]).na | ||
@test rcopy(DataArray,RObject(@data([NA,NA,"a","b"]))).na == @data([NA,NA,"a","b"]).na | ||
pda = PooledDataArray(repeat(["a", "b"], inner = [5])) | ||
@test rcopy(PooledDataArray,RObject(pda)).refs == repeat([1,2], inner = [5]) | ||
v = NullableArray([true,true], [true,false]) | ||
@test isequal(rcopy(NullableArray,RObject(v)), v) | ||
v = NullableArray([1,2], [true,false]) | ||
@test isequal(rcopy(NullableArray,RObject(v)), v) | ||
v = NullableArray([1.,2.], [true,false]) | ||
@test isequal(rcopy(NullableArray,RObject(v)), v) | ||
v = NullableArray([0,1.+0*im], [true,false]) | ||
@test isequal(rcopy(NullableArray,RObject(v)), v) | ||
v = NullableArray(["","abc"], [true,false]) | ||
@test isequal(rcopy(NullableArray,RObject(v)), v) | ||
v = CategoricalArray(repeat(["a", "b"], inner = 5)) | ||
@test isequal(rcopy(CategoricalArray,RObject(v)), v) | ||
v = NullableCategoricalArray(repeat(["a", "b"], inner = 5), repeat([true, false], outer = 5)) | ||
@test isequal(rcopy(NullableCategoricalArray,RObject(v)), v) | ||
v = CategoricalArray(repeat(["a", "b"], inner = 5), ordered=true) | ||
@test isequal(rcopy(CategoricalArray,RObject(v)), v) | ||
v = NullableCategoricalArray(repeat(["a", "b"], inner = 5), repeat([true, false], outer = 5), ordered=true) | ||
@test isequal(rcopy(NullableCategoricalArray,RObject(v)), v) | ||
|
||
@test rcopy(rcall(:dim,RObject(attenu))) == [182,5] | ||
|