This thread (I started) is nearly two-year old ... and I finally wrote a function, ptable_to_syntax(), to do this in the package semhelpinghands: converting a parameter table back to a model syntax (not because I "have time" ... but because I need to do this in another project):
As Terrence showed, it is not difficult if we just need to have a long list of lhs-op-rhs strings. I wrote this function to make the syntax more readable, hopefully, as this is what I need in that project.
As a safeguard, I also wrote a function to compare two parameter tables, to check whether the syntax can produce the same parameter table.
I shared it here, in case there are other lavaan users who would like to do this (very) unusual thing.
It is only in the GitHub version of the package for now as I won't submit a new version to CRAN until probably late October.
There are models that the function does not yet support, due to the complexity that is difficult to foresee. But what it supports now is enough for me.
I tried to be conservative and it should refuse to work on models I know it does not support. Nevertheless, if you encountered any bugs, I would love to know. Thanks.
-- Shu Fai