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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:36:14+00:00 2026-06-18T21:36:14+00:00

This is my dataframe using dput(): structure(list(Year = 1900:1903, Top.10..income.share = structure(c(82L, 81L, 76L,

  • 0

This is my dataframe using dput():

structure(list(Year = 1900:1903, Top.10..income.share = structure(c(82L, 
81L, 76L, 75L), .Label = c("", "30,3", "30,65", "30,8", "31,3", 
"31,37", "31,38", "31,4", "31,5", "31,51", "31,52", "31,55", 
"31,62", "31,64", "31,66", "31,67", "31,69", "31,75", "31,77", 
"31,8", "31,81", "31,82", "31,85", "31,9", "31,98", "32,01", 
"32,03", "32,04", "32,05", "32,07", "32,11", "32,12", "32,2", 
"32,35", "32,36", "32,42", "32,43", "32,44", "32,5", "32,62", 
"32,64", "32,67", "32,72", "32,82", "32,87", "33,02", "33,22", 
"33,4", "33,69", "33,72", "33,76", "33,87", "33,95", "34,25", 
"34,4", "34,57", "34,62", "34,71", "35,49", "36,3", "36,48", 
"37,26", "37,3", "37,73", "37,77", "37,78", "37,84", "37,92", 
"38,01", "38,1", "38,2", "38,38", "38,4", "38,47", "38,52", "38,59", 
"38,6", "38,63", "38,84", "38,91", "38,99", "39,13", "39,31", 
"39,48", "39,6", "39,82", "39,9", "40,29", "40,54", "40,59", 
"40,75", "41,02", "41,16", "41,52", "41,73", "41,98", "42,12", 
"42,23", "42,36", "42,67", "42,76", "42,86", "42,95", "43", "43,07", 
"43,11", "43,26", "43,35", "43,39", "43,64", "43,76", "44,07", 
"44,17", "44,4", "44,43", "44,57", "44,67", "44,77", "44,94", 
"45,03", "45,16", "45,47", "45,5", "45,67", "45,96", "46,09", 
"46,3", "46,35", "46,54"), class = "factor")), .Names = c("Year", 
"Top.10..income.share"), row.names = c(NA, 4L), class = "data.frame")

My sessionInfo():

R version 2.15.0 (2012-03-30)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] rstudio_0.97.248 tools_2.15.0  

What I want to do is to plot the Year column against the Top10 column.
But since there are a quite a few missing values the graph looks pretty awful.
Here is the code I wrote to plot this so far.

require(stats)

tid_a = read.csv("tid-a.csv", header=TRUE, sep=";")
germany <- tid_a[1:111, ]
usa <- tid_a[112:210, ]

germany_year <- germany[, 2]
germany_top10 <- na.omit(germany[, 3])

plot(germany_year, germany_top10, type="l")

I’ve tried a few examples I found online to omit the missing values, but I’m a noob and can’t get it to work.

  • 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-18T21:36:15+00:00Added an answer on June 18, 2026 at 9:36 pm

    This question is not reproducible, but something like this should work:

    gdat <- na.omit(subset(germany,select=c(Year,Top10)))
    plot(Top10~Year,data=gdat,type="l")
    

    (The use of subset in this way is fairly rare — germany[,c("Year","Top10")] is more common — but I like it because it’s readable. A simpler version is plot(...,data=na.omit(germany)), but that will omit rows with NAs in any column of the data frame.)

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

Sidebar

Related Questions

I have a data frame called y dput(y) structure(list(val1 = c(25L, 615L, 30L, 76L,
I have the following dataframe: > dput(py6s_pwc_16) structure(list(source = c(AERONET, BIGF, MODIS), ndvi_real =
Using this dataframe, df : bat.condition bat.group bat.money 1 safe 2825.882 2 safe 2931.875
Suppose I have a dataframe like this one: df <- data.frame (id = c(a,
I have a dataframe x with this values: x1 x2 x3 1 NA 4
I have a dataframe that looks like this: person n start end 1 sam
I have a dataframe with numeric entries like this one test <- data.frame(x =
I have a dataframe with distances df<-data.frame(site.x=c(A,A,A,B,B,C), site.y=c(B,C,D,C,D,D),Distance=c(67,57,64,60,67,60)) I need to convert this to
I have the data below saved as a pandas dataframe . With this data,
I am using pandas.DataFrame in a multi-threaded code (actually a custom subclass of DataFrame

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.