[R-sig-Geo] Same code line for graph with different output messages

Frede Aakmann Tøgersen frtog at vestas.com
Thu Feb 26 09:16:29 CET 2015


Hi Yuster

The problem is about understanding basic R. 

The R parser is case sensitive, so the column name Partic_per is different from the name Partic_Per. The latter is a column name in the data frame Ind_sport whereas the former is not a column in that data frame. So basically lnd_sport$Partic_per is parsed to NULL and this gives the error message you see from R when trying to do the indexing lnd_sport[lnd_sport$Partic_per > 25, ].

Yours sincerely / Med venlig hilsen


Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender. 


> -----Original Message-----
> From: R-sig-Geo [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of
> Yuster Ronoh
> Sent: 26. februar 2015 07:36
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] Same code line for graph with different output
> messages
> 
> Dear r-geo members
> Iam using example from creating maps with R by Robin Lovelace example
> and
>  I tried to plot map of active sport participant using the two codes, line
> one gave me the error messages and line two gave me plot of active sport
> partcipation in londe
> 1.plot(lnd_sport[lnd_sport$Partic_per > 25, ])
> 2.plot(lnd_sport[lnd_sport$Partic_Per > 25, ])
> R-output
> code for line 1
>  > plot(lnd_sport[lnd_sport$Partic_per > 25, ])
> Error in plot(lnd_sport[lnd_sport$Partic_per > 25, ]) :
>   error in evaluating the argument 'x' in selecting a method for function
> 'plot': Error in if (is.numeric(i) && i < 0) { :
>   missing value where TRUE/FALSE needed
> code for line 2
>  > plot(lnd_sport[lnd_sport$Partic_Per > 25, ]) # plotted actual graph
> could some one explain what is happening
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list