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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:49:26+00:00 2026-06-18T12:49:26+00:00

I tried loading the baseball statistics from this link. When I read it from

  • 0

I tried loading the baseball statistics from this link. When I read it from the file using

data <- read.csv("MLB2011.csv")

it seems to be reading all fields as factor values. I tried dropping those factor values by doing:

read.csv("MLB2011.xls", as.is= FALSE)

.. but it looks like the values are still being read as factors. What can I do to have them loaded as simple character values and not factors?

  • 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-06-18T12:49:27+00:00Added an answer on June 18, 2026 at 12:49 pm

    You aren’t reading a csv file, it is an excel spreadsheet (.xls format). It contains two worksheets bat2011 and pitch2011

    You could use the XLConnect library to read this

    library(XLConnect)
    # load the work book (connect to the file)
    wb <- loadWorkbook("MLB2011.xls")
    
    
    # read in the data from the bat2011 sheet
    bat2011 <- readWorksheet(wb, sheet = 'bat2011')
    

    readWorksheet has an argument colType which you could use to specify the column types.


    Edit

    If you have already saved the sheets as csv files then

    as.is = TRUE or stringsAsFactors = FALSE will be the correct argument values

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
tried uncommenting pam_limits.so from the pam.d directory but no luck. Basic PAM seems to
I tried loading C shared library .so in Python using ctypes.CDLL class (Linux). Here
Has anyone tried loading multiple hierarchical contexts (parent/child) using Spring? Could you explain how
I tried loading the contents of the bucket into a NSTableView using Arraycontroller. I
I tried loading an update for my app where I've switched from OpenGL ES
I tried using the example code from my previous question . However I get
Tried to create a mobile navigation using dataview or outline and the view renders
Tried to search for this online and didn't get very far, so I'm asking
Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']

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.