0

Why doesn't the logical statement show TRUE?

> pfv0$x[480]
[1] -2
> pfv0$x[480] == -2
[1] FALSE
> is.numeric(pfv0$x[480])
[1] TRUE

I am fairly new to R and I feel like I am missing something easy here. Any help would be appreciated.

  • 1
    You have to tell us what `pfv0` is. How was it created? What is x? – yeedle Oct 26 '16 at 01:42
  • 1
    can you `str(pfv0)`? – HubertL Oct 26 '16 at 01:42
  • 1
    This is almost certainly R FAQ 7.31, http://www.hep.by/gnu/r-patched/r-faq/R-FAQ_82.html ... `x <- -2.000000001; print(x); x==2` – Ben Bolker Oct 26 '16 at 02:01
  • @HubertL `> str(pfv0) 'data.frame': 1000 obs. of 2 variables: $ x : num -49.9 -49.8 -49.7 -49.6 -49.5 -49.4 -49.3 -49.2 -49.1 -49 ... $ pfv: num -0.0097 -0.00968 -0.00939 -0.00979 -0.01039 ...` x is created by: `x <- seq(-49.9,50.0, by=0.1)` then put into a dataframe with pfv. – Justin Mathew Oct 26 '16 at 02:53

0 Answers0