So che questo può essere fatto con PHP e altri linguaggi, ma si chiedeva se la seguente potrebbe essere realizzato utilizzando knitr:porzioni di inserimento di un documento Markdown all'interno di un altro documento Markdown utilizzando knitr
Diciamo che ho un Rmarkdown (.RMD) documento con due voce 1 sezioni:
# This is the first heading for the first document
Lorem ipsum dolor sit amet
# This is the second heading for the first document
plot(object)
domanda 1: se aperto un altro documento .RMD, come posso creare un collegamento in modo che quando analizzato questo documento presenterebbe il suo contenuto, nonché la tutto il contenuto del primo documento. Per esempio:
# This is the first heading for the second document Lorem ipsum dolor sit amet [command goes here to insert the first document]
risultato sarebbe:
# This is the first heading for the second document Lorem ipsum dolor sit amet # This is the first heading for the first document Lorem ipsum dolor sit amet # This is the second heading for the first document [plot shows up here]
Domanda 2: avrebbe knitr mi permetta di selezionare e inserire solo parti specifiche del documento 1 nel documento 2? Ad esempio, solo rubrica 1 e il contenuto sotto di esso, oppure solo rubrica 2 e la sua trama
Si può fare la prima cosa tramite documenti figli. Vedi [questo] (https://github.com/yihui/knitr/issues/268). Il secondo è più complicato e dipende da come si definisce cosa dovrebbe apparire e cosa non dovrebbe. – Ramnath