G
G
Gokilla2018-04-28 16:31:59
R
Gokilla, 2018-04-28 16:31:59

Analytics on R?

There is a file of this format orders_class.txt:

orderItemID;orderDate;deliveryDate;itemID;size;color;manufacturerID;price;customerID;salutation;dateOfBirth;state;creationDate
1;2013-04-01;2013-04-03;2347;43;magenta;1;89.90;12489;Mrs;1963-04-26;Hesse;2012-04-23
2;2013-04-01;2013-04-03;2741;43;grey;1;99.90;12489;Mrs;1963-04-26;Hesse;2012-04-23
3;2013-04-01;2013-04-03;2514;9;ecru;19;79.90;12489;Mrs;1963-04-26;Hesse;2012-04-23
4;2013-04-01;2013-05-06;2347;42;brown;1;89.90;12489;Mrs;1963-04-26;Hesse;2012-04-23
5;2013-04-01;?;2690;43;grey;1;119.90;12489;Mrs;1963-04-26;Hesse;2012-04-23
6;2013-04-01;2013-04-02;2318;41;blue;1;89.90;3649;Mrs;1956-03-26;Hesse;2013-04-01
7;2013-04-01;2013-04-22;2590;7+;white;57;99.90;3649;Mrs;1956-03-26;Hesse;2013-04-01
8;2013-04-01;2013-06-13;2656;41;magenta;1;79.90;3649;Mrs;1956-03-26;Hesse;2013-04-01

need to open in r studio for further processing, some fields may have ? question mark:
31;2013-04-01;2013-04-02;2875;m;blue;3;24.90;82791;Mrs;?;Baden-Wuerttemberg;2013-03-15

e.g. calculate the average price

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-04-28
@Gokilla

https://support.rstudio.com/hc/en-us/articles/2186...

R
Roman Pavlov, 2014-05-06
@Trytge

1) Let's assume that

public class Company
{
    public int Id { get; set; }
    public string Name { get; set; }
    public List<Employee> Employees { get; set; }

}

public class Employee
{
    public int Id { get; set; }
    public string FirstName { get; set; }
}

Then you can save like this:
int employeeId;
int companyId;
using (var context = new EntitiesContext())
{
    var employee = new Employee { FirstName = "John" };
    var company = new Company { Name = "Contoso" };
    company.Employees.Add(employee);
    context.Companies.Add(company);

    context.SaveChanges();

    employeeId = employee.Id;
    companyId = company.Id;
}

After SaveChanges(), IDs will appear if they are still needed somewhere further (the records will already be linked in the database).
2. If an exception is thrown, write the exception in the question. Most likely 'LINQ to Entities does not recognize the method 'Int32 ToInt32 (System.String)',' .
Do the conversion to number, outside of LINQ,
var idInt = Convert.ToInt32(comboBoxServices.SelectedValuePath);
var perforList = from p in context.performers
join o in context.orderperformer on p.performerID equals o.perfromerID
 where o.serviceID == idInt
select new { p.secondName, p.firstName, p.patronymic, o.price };

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question