:
julia> n, p = size(df)
(3,2)
julia> open("/tmp/df_file.txt", "w") do f
for i in 1:n
for j in 1:p
write(f, string(df[i, j]))
write(f, "\t")
end
write(f, "\n")
end
end
, - ( writetable):
julia> function myprinttable(io::IO,
df::AbstractDataFrame;
header::Bool = true,
separator::Char = ',',
quotemark::AbstractString = "\"",
nastring::AbstractString = "NA")
n, p = size(df)
etypes = eltypes(df)
if header
cnames = DataFrames._names(df)
for j in 1:p
print(io, quotemark)
print(io, cnames[j])
print(io, quotemark)
if j < p
print(io, separator)
else
print(io, '\n')
end
end
end
quotestr = quotemark
for i in 1:n
for j in 1:p
if ! (isna(df[j],i))
if ! (etypes[j] <: Real)
print(io, quotemark)
DataFrames.escapedprint(io, df[i, j], quotestr)
print(io, quotemark)
else
print(io, df[i, j])
end
else
print(io, nastring)
end
if j < p
print(io, separator)
else
print(io, '\n')
end
end
end
return
end
julia> open("/tmp/df_file.txt", "w") do f
myprinttable(f, df, header=true, separator='\t', quotemark="")
end
( .)
quotemark Char String. ( Char .