Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: Why only the first definition of matrix in R code is returned?

$
0
0
The problem as in subj:
A code sorts database records in table (weekdays/hours). After evaluating the R code only the initial FinTable is availiable (with zero values). I need a FinTable with processed values. How can I fix it?
engine.Evaluate(@"library(som)
DatTable<-read.table(""clipboard"", header=FALSE)
FinTable<-matrix(sample(0, 24*7, replace=TRUE), 24, 7)
DatTable[,3]<-normalize(DatTable[,3], byrow=FALSE)
for (i in 1:nrow(DatTable)){  
xAxes<-DatTable[i,1]  
yAxes<-DatTable[i,2]  
if (yAxes==0) {yAxes<-24}  
FinTable[yAxes,xAxes]<-DatTable[i,3]
}");
NumericMatrix FinTable = engine.GetSymbol("FinTable").AsNumericMatrix();

Viewing all articles
Browse latest Browse all 1634

Trending Articles