Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6184455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:32:20+00:00 2026-05-24T01:32:20+00:00

I need to take a data.frame and export it to a CSV file (or

  • 0

I need to take a data.frame and export it to a CSV file (or something else, but CSV seemed like the easiest well-formed format) so I can import it into an SQLite database.

However, it looks like write.csv() requires that I write a header line, and SQLite’s .import command requires that I don’t have a header line. So that’s a bit of a mismatch.

Here’s what happens if I try to omit the header line:

> write.csv(mydf, "/tmp/mydf.csv", row.names=F, col.names=F)
Warning message:
In write.csv(mydf, "/tmp/mydf.csv", row.names = F, col.names = F) :
  attempt to set 'col.names' ignored

I have to wonder why it’s enforcing that in the first place – the manual says “These wrappers are deliberately inflexible: they are designed to ensure that the correct conventions are used to write a valid file. Attempts to change append, col.names, sep, dec or qmethod are ignored, with a warning.” But I know of nothing in the spec or elsewhere requiring column names – indeed, most tools (Excel, etc.) don’t treat them specially.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:32:20+00:00Added an answer on May 24, 2026 at 1:32 am

    If you can’t beat ’em, join ’em.

    If you switch to write.table() (which write.csv() calls anyway) you’re golden:

    R> write.table(trees, file="/tmp/trees.csv", 
    +              row.names=FALSE, col.names=FALSE, sep=",")
    R> system("head /tmp/trees.csv")
    8.3,70,10.3
    8.6,65,10.3
    8.8,63,10.2
    10.5,72,16.4
    10.7,81,18.8
    10.8,83,19.7
    11,66,15.6
    11,75,18.2
    11.1,80,22.6
    11.2,75,19.9
    R>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to take data from external file and format it, the problem is,
I need to take a data.frame in the format of: id1 id2 mean start
I need to take production data with real customer info (names, address, phone numbers,
I need to take an existing xml file, and modify just a few attributes
I need to parse data from one JSON file in order to validate arrays,
I have IQueryable object and I need to take the data inside the IQueryable
I have a website and an administrator panel. I need to take some data
Need to take a SELECT drop down list options and find if any of
I need to take a web page and extract the address information from the
I need to take a paragraph of text and extract from it a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.