function printTransGraph(res, type, accounts) {
	console.log("Function printTransGraph called.");
	accountsVisualization = groupPairsOfNodesForVisualization(accounts);
	accounts = groupPairsOfNodes(accounts);
	accountsToCSV = csv(accounts);
	if (CSVWrite) {
		try {
			fs.writeFileSync('/home/ether/EthereumTracking/TFM/R/CSVfrom.csv', accountsToCSV, 'utf8');
		} catch (error) {
			console.log("Error while writing CSVfrom.csv file.");
			//TODO RENDER ERROR CODE
			return;
		}
		if (type == "normal") {
			//console.log("Calling RCallNormal()");
			RCallNormal(res, accountsVisualization);
		} else if (type == "betweenness") {
			RCallBetween(res, accountsVisualization);
			//console.log("Calling RCallBetween()");
		} else if (type == "closeness") {
			RCallCloseness(res, accountsVisualization);
		} else if (type == "page rank") {
			RCallPageRank(res, accountsVisualization);
		} else {
			console.log("Wrong input type.");
		}
	}
}
// Save accounts to CSV and call the R script.
Save accounts to CSV and call the R script.
Save accounts to CSV and call the R script .
function printTransGraph(res, type, accounts) {
	console.log("Function printTransGraph called.");
	accountsVisualization = groupPairsOfNodesForVisualization(accounts);
	accounts = groupPairsOfNodes(accounts);
	accountsToCSV = csv(accounts);
	if (CSVWrite) {
		try {
			fs.writeFileSync('/home/ether/EthereumTracking/TFM/R/CSVfrom.csv', accountsToCSV, 'utf8');
		} catch (error) {
			console.log("Error while writing CSVfrom.csv file.");
			return;
		}
		if (type == "normal") {
			RCallNormal(res, accountsVisualization);
		} else if (type == "betweenness") {
			RCallBetween(res, accountsVisualization);
		} else if (type == "closeness") {
			RCallCloseness(res, accountsVisualization);
		} else if (type == "page rank") {
			RCallPageRank(res, accountsVisualization);
		} else {
			console.log("Wrong input type.");
		}
	}
}
function printTransGraph ( res , type , accounts ) { console . log ( "Function printTransGraph called." ) ; accountsVisualization = groupPairsOfNodesForVisualization ( accounts ) ; accounts = groupPairsOfNodes ( accounts ) ; accountsToCSV = csv ( accounts ) ; if ( CSVWrite ) { try { fs . writeFileSync ( '/home/ether/EthereumTracking/TFM/R/CSVfrom.csv' , accountsToCSV , 'utf8' ) ; } catch ( error ) { console . log ( "Error while writing CSVfrom.csv file." ) ; return ; } if ( type == "normal" ) { RCallNormal ( res , accountsVisualization ) ; } else if ( type == "betweenness" ) { RCallBetween ( res , accountsVisualization ) ; } else if ( type == "closeness" ) { RCallCloseness ( res , accountsVisualization ) ; } else if ( type == "page rank" ) { RCallPageRank ( res , accountsVisualization ) ; } else { console . log ( "Wrong input type." ) ; } } }
Save accounts to CSV and call the R script.
Save accounts to CSV and call the R script .
//TODO RENDER ERROR CODE //console.log("Calling RCallNormal()"); //console.log("Calling RCallBetween()");