Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write csv file issue #4

Open
dipenpatel235 opened this issue Aug 1, 2018 · 0 comments
Open

write csv file issue #4

dipenpatel235 opened this issue Aug 1, 2018 · 0 comments

Comments

@dipenpatel235
Copy link

Below code is not working due to write df in csv file.
stuck in write csv file.
so what need to do for that ?
Saperate R code is working but not working with your library.

`<?php
require 'vendor/autoload.php';

use Okvpn\R\Process\RProcess;
use Okvpn\R\UnixPipes;

$rPath = '/usr/bin/R'; //path to R
//$rPath = 'C:\Program Files\R\R-3.5.1\bin\R.exe';
$process = new RProcess(new UnixPipes(), $rPath);

$process->start();
$rOutput = $process->write(<<<TXT
setwd("/root")
library(ggplot2)
library(RJSONIO)
library(rPython)
library(ggsunburst)
df <- read.table(header = T, sep = ",", text = "
parent,node,size
/,home,
home,Images,40
home,Videos,20
home,Documents,5
/,usr,
usr,src,
src,linux-headers,4
src,virtualbox,1
usr,lib,4
usr,share,2
usr,bin,1
usr,local,1
usr,include,1
")
write.table(df, '/root/df.csv', sep = ",", row.names = F)
sb <- sunburst_data('/root/df.csv', sep = ",", type = "node_parent")
png('test1.png')
sunburst(sb, node_labels = T, rects.fill.aes = "name")
dev.off()
TXT
);
?>
`

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant