Did you mean this:
> write.table(t, eol=",\n", row.names=FALSE, col.names=FALSE)
"",
"01001001011011101100",
"1001001011010101",
"1101110100000011",
"000100100101001001011001",
"000101101101101001101001",
If you want to create that output in a file, then create one long string and
use 'cat' to output; here is an example with the output to the console:
> t <- c(
+ "",
+ "01001001011011101100",
+ "1001001011010101",
+ "1101110100
Thanks.
I am sorry that I did not clearly put my question.
I need to output the array like
t <- c(
+ "",
+ "01001001011011101100",
+ "1001001011010101",
+ "1101110100000011",
+ "000100100101001001011001",
+ "
A simpler solution:
my.string <- c("",
"01001001011011101100",
"1001001011010101",
"1101110100000011",
"000100100101001001011001",
"000101101101101001101001")
my.string <- paste(my.string, collapse="\",\n
peng chen wrote:
Hi, R experts:
I am trying to generate data output in the following format:
rom_array := (
"",
"01001001011011101100",
"1001001011010101",
"1101110100000011",
"000100100101001001011001",
"00
> t <- c(
+ "",
+ "01001001011011101100",
+ "1001001011010101",
+ "1101110100000011",
+ "000100100101001001011001",
+ "000101101101101001101001")
> {
+ cat ('rom_array := (\n');
+ for (i in 1:length(t)) {
+
Hi, R experts:
I am trying to generate data output in the following format:
rom_array := (
"",
"01001001011011101100",
"1001001011010101",
"1101110100000011",
"000100100101001001011001",
"00010110110110100
7 matches
Mail list logo