I am an experienced programmer in SAS, but a beginner in R. I am working with RStudio Version 0.99.903 - © 2009-2016 RStudio, Inc. and Windows 8. I have the following question:
The file "a_us" has 4 numeric and 2 alphanumeric fields as follows:
str (a_us) // command to show file structure
'data.frame': 1039992 obs. of 7 variables: $ 'dsSisOriginario' : chr "Construcard" "Construcard" "Construcard" "Construcard" ... $ 'nrContrato' : chr "000002160000023630," "000002160000116565," "000002160000225267," ... $ 'vlCredInadimplenciaLancadoCa': num 9570 4455 6791 2678 4483 ... $ 'dtCredInadimplenciaEntradaCa': chr "03/11/2002" "17/10/2004" "25/03/2007" "15/12/2006" ... $ 'vlCredFcvsCessao' : num 271 216 329 130 217 ... $ PercentPagoCarteira : num 0.0283 0.0484 0.0484 0.0484 ... $ QtdCredDiasAtraso : int 5110 4396 3507 3607 2768 2407 2640 ...
Using summary (a_us), the result comes out as expected, that is, the statistics for the numeric variables are perfect.
However, when I try to take, for example, the mean (mean) or any other quantitative procedure, such as hist (), of these same numeric variables ('vlCredInputInputCa', 'vlCredFcvsCessage', PercentageDelay Port, , it only works for the variables (PercentPagoCarteira, QtDCredDiasAtraso), for the others ('vlCredPayIndicationCan', 'vlCredFcvsCessao'), I get the message:
> mean(a_us$'vlCredFcvsCessao') > [1] NA > Warning message: > In mean.default(a_us$vlCredFcvsCessao) : > argumento não é numérico nem lógico: retornando NA
Although the variable is numeric, I get this error message!
Can anyone give me a hint of what's going on and how to solve it?