write_command_via_csv: Write csv files with indicated commands to the external...

Description Usage Arguments Value Author(s) Examples

View source: R/write_command_via_csv.R

Description

Function is capable to read the data and writing multiple files e.g. 'SystemControl8139124.csv'

[Stable]

Usage

1
write_command_via_csv(x, path_terminal = "", fileName = "SystemControl")

Arguments

x
  • dataframe object with resulting command e.g. 1 - enable; 0 - disable

path_terminal
  • path to the terminal

fileName
  • desired control file prefix e.g. 'SystemControl'

Value

Function is writing multiple files e.g. 'SystemControl8139124.csv' to the Sandbox

typical content of the file: "Magic","IsEnabled" 8139124,1

Author(s)

(C) 2019, 2021 Vladimir Zhbanko

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(dplyr)
library(readr)
library(lubridate)
library(lazytrade)

path_sbxm <- normalizePath(tempdir(),winslash = "/")

file.copy(from = system.file("extdata", "OrdersResultsT1.csv", package = "lazytrade"),
          to = file.path(path_sbxm, "OrdersResultsT1.csv"), overwrite = TRUE)

DFT1 <- import_data(path_sbxm = path_sbxm,
                    trade_log_file = "OrdersResultsT1.csv")

DFT1 %>%
group_by(MagicNumber) %>% select(MagicNumber) %>% mutate(IsEnabled = 0) %>%
# head to shorten time of this example
head(2) %>%
# write commands to disable/enable systems
write_command_via_csv(path_terminal = path_sbxm)

lazytrade documentation built on Dec. 16, 2021, 1:06 a.m.