public static void TestFindRPath(string expectContains) { var rPath = NativeUtility.CreateNew().FindRPath(); var match = rPath.Contains(expectContains); Console.WriteLine("Detected RPath is {0}", rPath); if (match) { Console.WriteLine("Contains string '{0}' as expected", expectContains); } else { Console.WriteLine("Does NOT contain string '{0}' as expected", expectContains); } }
/// <summary> /// Perform the necessary setup for the PATH and R_HOME environment variables. /// </summary> /// <param name="rPath">The path of the directory containing the R native library. /// If null (default), this function tries to locate the path via the Windows registry, or commonly used locations on MacOS and Linux</param> /// <param name="rHome">The path for R_HOME. If null (default), the function checks the R_HOME environment variable. If none is set, /// the function uses platform specific sensible default behaviors.</param> /// <remarks> /// This function has been designed to limit the tedium for users, while allowing custom settings for unusual installations. /// </remarks> public static void SetEnvironmentVariables(string rPath = null, string rHome = null) { environmentIsSet = true; NativeUtility.CreateNew().SetEnvironmentVariables(rPath: rPath, rHome: rHome); }