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 6618411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:49:47+00:00 2026-05-25T20:49:47+00:00

I’m using sqldf to subset an enormous file. The following command gives me a

  • 0

I’m using sqldf to subset an enormous file. The following command gives me a data.frame of 100 rows and 42 columns.

first <- read.csv.sql("first.txt", sep = " ", header = TRUE, row.names = FALSE,
        sql = "SELECT * FROM file WHERE n = '\"n63\"' AND ratio = 1 AND r_name = '\"r1\"' AND method = '\"nearest\"' AND variables = 10")

The structure of the object is

'data.frame':   100 obs. of  42 variables:
 $ test_before       : chr  "TRUE" "TRUE" "TRUE" "TRUE" ...
 $ test_after        : chr  "TRUE" "TRUE" "TRUE" "TRUE" ...
 $ meanPSmatchRATIO  : chr  "1.54845330373635" "1.16857102212364" "1.25330045961256" "1.8011651466717" ...
snipped intervening normally printed columns
 $ PSdiff_DIFF       : chr  "-0.0103938442562762" "-0.00935228868105753" "-0.00947571480267878" 
snipped intervening normally printed columns
 $ nUNMATCHt         : chr  "0" "0" "0" "0" ...
 $ caliper           : chr  "\"no\"" "\"no\"" "\"no\"" "\"no\"" ...
 $ method            : chr  "\"nearest\"" "\"nearest\"" "\"nearest\"" "\"nearest\"" ...
 $ r_name            : chr  "\"r1\"" "\"r1\"" "\"r1\"" "\"r1\"" ...
 $ ratio             : int  1 1 1 1 1 1 1 1 1 1 ...
 $ n                 : chr  "\"n63\"" "\"n63\"" "\"n63\"" "\"n63\"" ...
 $ variables         : int  10 10 10 10 10 10 10 10 10 10 ...

Now, based on this you would expect that when I print the data.frame, all columns (except those int will be character (enclosed in “”)). But you would be wrong!

  test_before test_after meanPSmatchRATIO del-  nUNMATCHt caliper    method r_name ratio     n variables
1        TRUE       TRUE 1.54845330373635 eted          0    "no" "nearest"   "r1"     1 "n63"        10
2        TRUE       TRUE 1.16857102212364 ...           0    "no" "nearest"   "r1"     1 "n63"        10
3        TRUE       TRUE 1.25330045961256 ...           0    "no" "nearest"   "r1"     1 "n63"        10
4        TRUE       TRUE  1.8011651466717 ...t          0    "no" "nearest"   "r1"     1 "n63"        10

Notice that only the last few columns are “character”. I’m a bit lost at what’s going on. Can someone explain?

  • 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-25T20:49:47+00:00Added an answer on May 25, 2026 at 8:49 pm

    Looks fine to me. print.data.frame doesn’t usually print quotes for character columns, but those last few columns have embedded quotes, so that’s why they appear “quoted” by default.

    Data <- data.frame(x=1:5,y=as.character(1:5),
      z=letters[1:5], q=paste("\"",letters[1:5],"\"",sep=""))
    print(Data)  # default print
    #   x y z   q
    # 1 1 1 a "a"
    # 2 2 2 b "b"
    # 3 3 3 c "c"
    # 4 4 4 d "d"
    # 5 5 5 e "e"
    print(Data, quote=TRUE)  # show embedded quotes
    #     x   y   z       q
    # 1 "1" "1" "a" "\"a\""
    # 2 "2" "2" "b" "\"b\""
    # 3 "3" "3" "c" "\"c\""
    # 4 "4" "4" "d" "\"d\""
    # 5 "5" "5" "e" "\"e\""
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I want to construct a data frame in an Rcpp function, but when I
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the

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.