1

When I do anything with my variables, for example: Y<-cbind(bank)or liq <-Liq, the error object not found appears. I guess, something is wrong with reading the excel file. I use library("readxl") and h<-read_xlsx("banks_NA.xlsx")to download the dataset. Here is info about the session and data:

`>ls(h)
[1] "Da"      "Dh_a"    "Dh_l1"   "Dh_m1"   "Dl1"     "Dm1"    
[7] "K"       "La_a"    "La_l1"   "La_m1"   "Lh_a"    "Lh_l1"  
[13] "Lh_m1"   "Liq"     "Ll1"     "Lm1"     "Mac"     "Na_Da"  
[19] "OtR"     "OtR_a"   "PrT"     "Pro"     "S"       "S_Bl"   
[25] "S_Bo"    "S_S"     "bank"    "date"    "dis"     "foreign"
[31] "live"    "rD"      "rL"      "rQi"     "rS"      "rSc"    
[37] "rSi"     "region"  "state"   "ta"`
`> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] C
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     
other attached packages:
 [1] sandwich_2.4-0  readxl_1.1.0    plm_1.6-6 
[4] openxlsx_4.0.17 gplots_3.0.1    Formula_1.2-2  
 [7] foreign_0.8-70  class_7.3-14    caTools_1.17.1 
[10] car_3.0-0       carData_3.0-1  

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16        cellranger_1.1.0    pillar_1.2.2       
 [4] compiler_3.5.0      forcats_0.3.0       bitops_1.0-6       
 [7] miscTools_0.6-22    tools_3.5.0         tibble_1.4.2       
[10] nlme_3.1-137        lattice_0.20-35     rlang_0.2.0        
[13] cli_1.0.0           maxLik_1.3-4        curl_3.2           
[16] haven_1.1.1         rio_0.5.10          gtools_3.5.0       
[19] lmtest_0.9-36       grid_3.5.0          data.table_1.10.4-3
[22] bdsmatrix_1.3-3     gdata_2.18.0        magrittr_1.5       
[25] MASS_7.3-50         assertthat_0.2.0    abind_1.4-5        
[28] KernSmooth_2.23-15  utf8_1.1.3          crayon_1.3.4       
[31] zoo_1.8-1`

Yesterday, I did exactly the same operations and everything worked perfectly. Today I decided to update R studio and now everything is corrupted...

  • 6
    It appears that `Liq` and `bank` are variables in the `data.frame` `h`, not objects in your namespace. Try `h$Liq` instead of `Liq`, for example. – Brian Stamper May 01 '18 at 17:51
  • you should refer to bank within h, ie, h$bank – Russ Hyde May 01 '18 at 17:51
  • another option is to `attach(h)` then the variables in the dataframe are accessible in the global environment. The preferred method is lised above. – Dave2e May 01 '18 at 17:52
  • 7
    @Dave2e I was thinking that may have been what she had done in a previous session. Some say `attach()` should be avoided, discussed here https://stackoverflow.com/questions/10067680/why-is-it-not-advisable-to-use-attach-in-r-and-what-should-i-use-instead – Brian Stamper May 01 '18 at 17:56
  • it works now, thank you! – firstgirlonstackoverflow May 01 '18 at 17:56
  • 5
    Strongly +1 discouraging the use of `attach`, it can easily lead to many issues (this one being the star witness). – r2evans May 01 '18 at 17:58

0 Answers0