Skip to content

write csv file issue  #4

Description

@dipenpatel235

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions