Closed LCisannoyed closed 6 years ago
Sure we should be able to do this with existing functions. I'll make a reprex for it
Here's a possible solution using existing functions. If you think this is something we'll do often let's build it in to the core functionality so you don't need to do workarounds...
library(conquestr)
my_cmds <- cqc_cmds()
my_defaults <- cqc_defaults()
my_cmds$data <- "data {customfile}.txt"
my_defaults$customfile <- "my_default_file.txt"
writeLines(unlist(cqc_syntax("example1", "1-10", my_cmds, my_defaults)))
#> reset;
#> data my_default_file.txt.txt
#> label << example1.lab;
#> format responses 1-10;
#> model item;
#> estimate ! iter=1000, nodes=30;
#> itanal >> example1.itn;
#> show ! estimates=latent >> example1.shw;
#> export logfile >> example1.CQL;
#> put >> example1.CQS;
Created on 2018-04-20 by the reprex package (v0.2.0).
I reckon I will frequently need to do this .
I am happy to use your reprex in the interim
thanks for get me a solution so quickly
New commit to develop branch should address this issue now. If you don't want a custom filename it defaults to the current setup and uses the value of the name
argument provided to cqc_syntax
This is now been merged into the master branch with https://github.com/markdly/conquestr/commit/8dae71860803cdb83d48384c7bf5b49ad2853c2e
Currently {name} is used for $title, $data, $label etc. Could we use something like
data {filename}.txt;
so that we can use one datafile for many subsets of analysis?> cq_cmds
$reset
[1] "reset;"
`
$title