Write the C code to a file
write_c_code.RdThis function does not compile the code, it only writes it to a file in a temporary location (tempdir). By default, the name of the file will contain the hash of the entire code.
Details
If instead of a character vector, an ode or cme object is passed, this function will generate code from it with default options.
Examples
m <- model_from_tsv(uqsa_example("AKAR4"))
o <- as_ode(m)
C <- generate_code(o)
c_path(o) <- write_c_code(C)
print(o)
#> Model name : AKAR4
#> C file : /tmp/Rtmp3WxBip/adf9204aaf2748b8/AKAR4.c [2026-05-15 14:26:39.553243]
#>
#> Number of state variables : 2
#> Number of parameters : 5
#> Number of outputs : 1
#> Conservation laws : 2
#> Transformations : no
if (file.exists(c_path(o))) cat("c file exists.\n")
#> c file exists.