Ich schreibe Matrizen in eine Textdatei. Das Problem ist, dass jede Zeile, die länger als 10 Zeichen ist, abgeschnitten und zur nächsten Zeile hinzugefügt wird. Ich möchte, dass alles in einer Zeile angezeigt wird.R maximal 10 Zeichen pro Zeile speichern
Beispiel, grundlegende Informationen mit einer 1 x 12 Matrix kommt als:
12
0 0 0 0 0
0 0 0 0 0
0 0
Ziel:
12
0 0 0 0 0 0 0 0 0 0 0 0
Code:
# Create all the info
info <- paste(inputSize)
inTheta <- matrix (0,1,inputSize)
# Create the file
file.create(fileDir)
# Write the content
write(x=info,file=fileDir,append=TRUE)
write(x=inTheta,file=fileDir,append=TRUE)
Die 'file.create' Anweisung unnötig ist. –