Skip to content

Commit bff6613

Browse files
committed
Merge branch 'release/1.7.0.4'
2 parents fdc8c90 + a3ebca6 commit bff6613

File tree

7 files changed

+102
-10
lines changed

7 files changed

+102
-10
lines changed

R.NET/DynamicVector.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,15 @@ private void WriteInt32(int value, IntPtr pointer, int offset)
226226
private string ReadString(IntPtr pointer, int offset)
227227
{
228228
pointer = Marshal.ReadIntPtr(pointer, offset);
229-
pointer = IntPtr.Add(pointer, Marshal.SizeOf(Engine.GetVectorSexprecType()));
229+
if (Engine.Compatibility == REngine.CompatibilityMode.ALTREP)
230+
{
231+
pointer = GetFunction<DATAPTR_OR_NULL>()(pointer);
232+
}
233+
else
234+
{
235+
pointer = IntPtr.Add(pointer, Marshal.SizeOf(Engine.GetVectorSexprecType()));
236+
}
237+
230238
return InternalString.StringFromNativeUtf8(pointer);
231239
}
232240

R.NET/Properties/VersionInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// <auto-generated/>
22
using System.Reflection;
33

4-
[assembly: AssemblyVersionAttribute("1.7.0.3")]
5-
[assembly: AssemblyFileVersionAttribute("1.7.0.3")]
4+
[assembly: AssemblyVersionAttribute("1.7.0.4")]
5+
[assembly: AssemblyFileVersionAttribute("1.7.0.4")]

RDotNet.TestBase/RDotNet.TestBase.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>
3636
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
38+
<DebugSymbols>true</DebugSymbols>
39+
<OutputPath>bin\x86\Debug\</OutputPath>
40+
<DefineConstants>DEBUG;TRACE</DefineConstants>
41+
<DebugType>full</DebugType>
42+
<PlatformTarget>x86</PlatformTarget>
43+
<ErrorReport>prompt</ErrorReport>
44+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
47+
<OutputPath>bin\x86\Release\</OutputPath>
48+
<DefineConstants>TRACE</DefineConstants>
49+
<Optimize>true</Optimize>
50+
<DebugType>pdbonly</DebugType>
51+
<PlatformTarget>x86</PlatformTarget>
52+
<ErrorReport>prompt</ErrorReport>
53+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54+
</PropertyGroup>
3755
<ItemGroup>
3856
<Reference Include="System" />
3957
<Reference Include="System.Core" />

RDotNet.Tests.sln

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.168
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.40629.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RDotNet", "R.NET\RDotNet.csproj", "{0923E1A0-2032-4997-AB73-49E42C4034A9}"
77
EndProject
@@ -18,33 +18,59 @@ EndProject
1818
Global
1919
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2020
Debug|Any CPU = Debug|Any CPU
21+
Debug|x86 = Debug|x86
2122
Release|Any CPU = Release|Any CPU
23+
Release|x86 = Release|x86
2224
EndGlobalSection
2325
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2426
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2527
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Debug|x86.ActiveCfg = Debug|x86
29+
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Debug|x86.Build.0 = Debug|x86
2630
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
2731
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Release|x86.ActiveCfg = Release|x86
33+
{0923E1A0-2032-4997-AB73-49E42C4034A9}.Release|x86.Build.0 = Release|x86
2834
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2935
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Debug|x86.ActiveCfg = Debug|x86
37+
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Debug|x86.Build.0 = Debug|x86
3038
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Release|Any CPU.ActiveCfg = Release|Any CPU
3139
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Release|x86.ActiveCfg = Release|x86
41+
{2A089A59-0F22-4484-B442-0FE8BDA10879}.Release|x86.Build.0 = Release|x86
3242
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3343
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Debug|Any CPU.Build.0 = Debug|Any CPU
44+
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Debug|x86.ActiveCfg = Debug|x86
45+
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Debug|x86.Build.0 = Debug|x86
3446
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Release|Any CPU.ActiveCfg = Release|Any CPU
3547
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Release|x86.ActiveCfg = Release|x86
49+
{BCADF6CF-2D63-4BD7-BC28-F0AC4F98AE78}.Release|x86.Build.0 = Release|x86
3650
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3751
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Debug|x86.ActiveCfg = Debug|x86
53+
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Debug|x86.Build.0 = Debug|x86
3854
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Release|Any CPU.ActiveCfg = Release|Any CPU
3955
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Release|x86.ActiveCfg = Release|x86
57+
{37E8DF32-0D37-418E-B976-10F4B36A0073}.Release|x86.Build.0 = Release|x86
4058
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4159
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
60+
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Debug|x86.ActiveCfg = Debug|x86
61+
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Debug|x86.Build.0 = Debug|x86
4262
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
4363
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Release|Any CPU.Build.0 = Release|Any CPU
64+
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Release|x86.ActiveCfg = Release|x86
65+
{B9E15660-096F-45FB-82E3-3C21BBE986DF}.Release|x86.Build.0 = Release|x86
4466
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4567
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Debug|Any CPU.Build.0 = Debug|Any CPU
68+
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Debug|x86.ActiveCfg = Debug|x86
69+
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Debug|x86.Build.0 = Debug|x86
4670
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Release|Any CPU.ActiveCfg = Release|Any CPU
4771
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Release|x86.ActiveCfg = Release|x86
73+
{6C456A2E-FBB5-44DA-B0D2-FE76C49FCD06}.Release|x86.Build.0 = Release|x86
4874
EndGlobalSection
4975
GlobalSection(SolutionProperties) = preSolution
5076
HideSolutionNode = FALSE

RDotNet.Tests/DataFrameTest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ public void TestDataFrameInMemoryCreationTwice()
7474
TestDataFrameInMemoryCreation();
7575
}
7676

77+
[Fact]
78+
public void TestDataFrameConversionCharacterWithFactors()
79+
{
80+
SetUpTest();
81+
var engine = this.Engine;
82+
83+
engine.Evaluate("x <- data.frame(c1 = c('a', 'b'), stringsAsFactors = FALSE)");
84+
var expression = engine.GetSymbol("x");
85+
Assert.Equal("a", expression.AsDataFrame()[0][0]);
86+
Assert.Equal("b", expression.AsDataFrame()[0][1]);
87+
88+
engine.Evaluate("y <- data.frame(x = c('a', 'b'), stringsAsFactors = TRUE)");
89+
expression = engine.GetSymbol("y");
90+
Assert.Equal("a", expression.AsDataFrame()[0][0]);
91+
Assert.Equal("b", expression.AsDataFrame()[0][1]);
92+
93+
engine.Evaluate("c1 <- x$c1");
94+
expression = engine.GetSymbol("c1");
95+
Assert.Equal("a", expression.AsCharacter()[0]);
96+
Assert.Equal("b", expression.AsCharacter()[1]);
97+
}
98+
7799
[Fact]
78100
public void TestDataFrameInMemoryCreation()
79101
{

RDotNet.Tests/RDotNet.Tests.csproj

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props" Condition="Exists('..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props')" />
34
<Import Project="..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" />
4-
<Import Project="..\packages\xunit.runner.console.2.3.1\build\xunit.runner.console.props" Condition="Exists('..\packages\xunit.runner.console.2.3.1\build\xunit.runner.console.props')" />
55
<Import Project="..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
66
<PropertyGroup>
77
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -16,7 +16,7 @@
1616
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1717
<RestorePackages>true</RestorePackages>
1818
<TargetFrameworkProfile />
19-
<NuGetPackageImportStamp>4e7d28b5</NuGetPackageImportStamp>
19+
<NuGetPackageImportStamp>386ab210</NuGetPackageImportStamp>
2020
</PropertyGroup>
2121
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2222
<DebugSymbols>true</DebugSymbols>
@@ -35,6 +35,24 @@
3535
<ErrorReport>prompt</ErrorReport>
3636
<WarningLevel>4</WarningLevel>
3737
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
39+
<DebugSymbols>true</DebugSymbols>
40+
<OutputPath>bin\x86\Debug\</OutputPath>
41+
<DefineConstants>DEBUG;TRACE</DefineConstants>
42+
<DebugType>full</DebugType>
43+
<PlatformTarget>x86</PlatformTarget>
44+
<ErrorReport>prompt</ErrorReport>
45+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
48+
<OutputPath>bin\x86\Release\</OutputPath>
49+
<DefineConstants>TRACE</DefineConstants>
50+
<Optimize>true</Optimize>
51+
<DebugType>pdbonly</DebugType>
52+
<PlatformTarget>x86</PlatformTarget>
53+
<ErrorReport>prompt</ErrorReport>
54+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
55+
</PropertyGroup>
3856
<ItemGroup>
3957
<Reference Include="System" />
4058
<Reference Include="System.Core" />
@@ -1180,8 +1198,8 @@
11801198
</PropertyGroup>
11811199
<Error Condition="!Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
11821200
<Error Condition="!Exists('..\packages\xunit.MSBuild.2.0.0.0\build\xunit.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.MSBuild.2.0.0.0\build\xunit.MSBuild.targets'))" />
1183-
<Error Condition="!Exists('..\packages\xunit.runner.console.2.3.1\build\xunit.runner.console.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.console.2.3.1\build\xunit.runner.console.props'))" />
11841201
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props'))" />
1202+
<Error Condition="!Exists('..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.console.2.4.1\build\xunit.runner.console.props'))" />
11851203
</Target>
11861204
<Import Project="..\packages\xunit.MSBuild.2.0.0.0\build\xunit.MSBuild.targets" Condition="Exists('..\packages\xunit.MSBuild.2.0.0.0\build\xunit.MSBuild.targets')" />
11871205
</Project>

RDotNet.Tests/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
88
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
99
<package id="xunit.MSBuild" version="2.0.0.0" targetFramework="net45" developmentDependency="true" />
10-
<package id="xunit.runner.console" version="2.3.1" targetFramework="net45" developmentDependency="true" />
11-
<package id="xunit.runner.visualstudio" version="2.3.1" targetFramework="net45" developmentDependency="true" />
10+
<package id="xunit.runner.console" version="2.4.1" targetFramework="net45" developmentDependency="true" />
11+
<package id="xunit.runner.visualstudio" version="2.4.1" targetFramework="net45" developmentDependency="true" />
1212
</packages>

0 commit comments

Comments
 (0)