read.table()
uses quote="'\""
(that is, looking for either single- or double-quotes)
read.delim()
uses quote="\""
(just looking for double-quotes).To solve quote problem,
In
read.table(),
use quote=""
, and for that matter also fill=FALSE
read.table()
uses quote="'\""
(that is, looking for either single- or double-quotes)
read.delim()
uses quote="\""
(just looking for double-quotes).read.table(),
use quote=""
, and for that matter also fill=FALSE
X column1 column2 column3
row1 0 1 2
row2 3 4 5
row3 6 7 8
row4 9 10 11
to
X row1 row2 row3 row4
column1 0 3 6 9
column2 1 4 7 10
column3 2 5 8 11
A.
awk '
{
for (i=1; i<=NF; i++) {
a[NR,i] = $i
}
}
NF>p { p = NF }
END {
for(j=1; j<=p; j++) {
str=a[1,j]
for(i=2; i<=NR; i++){
str=str" "a[i,j]; # check FS (ex: space, tab, etc)
}
print str
}
}' file
p = rand(10,2);
scatter(p(:,1), p(:,2), 'filled')
axis([0 1 0 1])
labels = num2str((1:size(p,1))','%d'); %'
text(p(:,1), p(:,2), labels, 'horizontal','left', 'vertical','bottom','Fontsize', 7)