Steven Ferrino

Technical SEO / PHP Developer

  • Home
  • SEO
  • Local Search
  • PHP
You are here: Home / R Programming / Reading CSV Data and Ignoring NA’s

Reading CSV Data and Ignoring NA’s

October 31, 2016 by Steven Leave a Comment

When coming from one scripting language and going to another it is usually a matter of just finding the function name that will do what you want, well R Programming doesn’t easily allow for that. The syntax is quite different since it was designed to handle nothing but data.

Reading CSV:

fileData <- read.csv( thisFilePath )

Remove columns with NULL or NA items:

# This will set cleanRows to Only have useable data
# The comma at the end is required
cleanRows <- fileData[complete.cases(fileData),]

# If you want to count the number of Rows
rowCount <- nrow(cleanRows)

Filed Under: R Programming

Steven Ferrino

Recent Posts

  • Google Business Service Account API & PubSub
  • Google Core March 2023 Not Just E-A-T
  • [Fix] – Jupiter Theme: /jupiter/dynamic-styles/global/header.php on line 346
  • Laravel 5.4: SQLSTATE[42000]: Password_resets – [Solution]
  • Restrict wp-login.php Access With Htaccess

Blogroll

  • Microdata Generator

Profiles

  • LinkedIn
  • Twitter

Copyright © 2025 · Dynamik-Gen on Genesis Framework · WordPress · Log in