Click here to Skip to main content
15,893,161 members
Home / Discussions / C#
   

C#

 
Questioncreating a folder on console application with c# by clicking on it's .exe file ! Pin
Manoj Kumar Miriyala17-Jun-16 20:58
professionalManoj Kumar Miriyala17-Jun-16 20:58 
AnswerRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
OriginalGriff17-Jun-16 21:10
mveOriginalGriff17-Jun-16 21:10 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Manoj Kumar Miriyala17-Jun-16 21:18
professionalManoj Kumar Miriyala17-Jun-16 21:18 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
OriginalGriff17-Jun-16 21:33
mveOriginalGriff17-Jun-16 21:33 
QuestionRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Richard MacCutchan17-Jun-16 21:10
mveRichard MacCutchan17-Jun-16 21:10 
AnswerRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Manoj Kumar Miriyala17-Jun-16 21:21
professionalManoj Kumar Miriyala17-Jun-16 21:21 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Richard MacCutchan17-Jun-16 21:44
mveRichard MacCutchan17-Jun-16 21:44 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
BillWoodruff17-Jun-16 23:18
professionalBillWoodruff17-Jun-16 23:18 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Richard MacCutchan17-Jun-16 23:19
mveRichard MacCutchan17-Jun-16 23:19 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
BillWoodruff17-Jun-16 23:48
professionalBillWoodruff17-Jun-16 23:48 
GeneralRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
Richard MacCutchan19-Jun-16 21:25
mveRichard MacCutchan19-Jun-16 21:25 
AnswerRe: creating a folder on console application with c# by clicking on it's .exe file ! Pin
BillWoodruff17-Jun-16 23:45
professionalBillWoodruff17-Jun-16 23:45 
QuestionHow to export a result table and charts from RDotNet to Excel Pin
Member 1085025317-Jun-16 15:45
Member 1085025317-Jun-16 15:45 
AnswerRe: How to export a result table and charts from RDotNet to Excel Pin
Garth J Lancaster17-Jun-16 16:40
professionalGarth J Lancaster17-Jun-16 16:40 
GeneralRe: How to export a result table and charts from RDotNet to Excel Pin
Member 1085025323-Jun-16 11:41
Member 1085025323-Jun-16 11:41 
GeneralRe: How to export a result table and charts from RDotNet to Excel Pin
Garth J Lancaster23-Jun-16 16:12
professionalGarth J Lancaster23-Jun-16 16:12 
GeneralRe: How to export a result table and charts from RDotNet to Excel Pin
Member 1085025323-Jun-16 16:22
Member 1085025323-Jun-16 16:22 
QuestionCan't get the replace to work, and double check my work. Pin
jkirkerx17-Jun-16 11:11
professionaljkirkerx17-Jun-16 11:11 
AnswerMy Bad, perhaps I can just get that double check Pin
jkirkerx17-Jun-16 11:19
professionaljkirkerx17-Jun-16 11:19 
QuestionError while trying to use R.Net in VS 2012 Pin
Member 1085025317-Jun-16 5:39
Member 1085025317-Jun-16 5:39 
I followed the tutorial here:
Importing and displaying a Data frame with C# and R.NET | Psychwire[^]
and I got errors on the code, here:
REngine.SetDllDirectory(dlldir);
      REngine.CreateInstance("RDotNet");
REngine engine = REngine.GetInstanceFromID("RDotNet");
engine.EagerEvaluate("dataset<-read.table(file.choose(), header=TRUE, sep = ',')");
DataFrame dataset = engine.EagerEvaluate("dataset").AsDataFrame();
saying that it couldn't find the methods inRDotNet.Engine.
This is the code I am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
using RDotNet;
using RDotNet.NativeLibrary;
using Microsoft.Win32;

namespace RScript
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            string dlldir = @"C:\Program Files\R\R-3.3.0\bin\x64";
            bool r_located = false;
            Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + dlldir);
            InitializeComponent();    

            while (r_located == false)
            {
                try
                {
                    REngine.SetDllDirectory(dlldir);
                    REngine.CreateInstance("RDotNet");
                    r_located = true;
                }

                catch
                {
                    MessageBox.Show(@"Unable to find R installation's \bin\i386 folder.
                    Press OK to attempt to locate it.");

                    /if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                    {
                        dlldir = @folderBrowserDialog1.SelectedPath;
                    }/

                }
            }

        }

        private void button1_Click(object sender, EventArgs e)
        {
            REngine engine = REngine.GetInstanceFromID("RDotNet");

            try
            {
                // import csv file
                engine.EagerEvaluate("dataset<-read.table(file.choose(), header=TRUE, sep = ',')");

                // retrieve the data frame
                DataFrame dataset = engine.EagerEvaluate("dataset").AsDataFrame();

                for (int i = 0; i < dataset.ColumnCount; ++i)
                {
                    dataGridView1.ColumnCount++;
                    dataGridView1.Columns[i].Name = dataset.ColumnNames[i];
                }

                for (int i = 0; i < dataset.RowCount; ++i)
                {
                    dataGridView1.RowCount++;
                    dataGridView1.Rows[i].HeaderCell.Value = dataset.RowNames[i];

                    for (int k = 0; k < dataset.ColumnCount; ++k)
                    {
                        dataGridView1[k, i].Value = dataset[i,k];

                    }

                }

            }

            catch
            {
                MessageBox.Show(@"Equation error.");
            }
        }

    }
}
can someone please help me out, since I really need your help?
I am new to R.Net.
I am using the newest version of RDotNet (1.6.5).
Thanks in advance!
AnswerRe: Error while trying to use R.Net in VS 2012 Pin
OriginalGriff17-Jun-16 5:47
mveOriginalGriff17-Jun-16 5:47 
QuestionHelp me gather info about multiple monitors Pin
Tomaž Štih17-Jun-16 3:41
Tomaž Štih17-Jun-16 3:41 
AnswerRe: Help me gather info about multiple monitors Pin
BillWoodruff17-Jun-16 23:52
professionalBillWoodruff17-Jun-16 23:52 
GeneralRe: Help me gather info about multiple monitors Pin
Tomaž Štih18-Jun-16 3:52
Tomaž Štih18-Jun-16 3:52 
GeneralRe: Help me gather info about multiple monitors Pin
BillWoodruff18-Jun-16 19:06
professionalBillWoodruff18-Jun-16 19:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.