0

This question has been asked before but no answers have worked for me. I'm trying to upload my data frame into R from excel but R keeps leaving two columns out. When I input "variable" I get the error object "variable" not found and when I input "data.frame$variable" I get the warning message unknown or uninitialized column: 'variable'. Does anyone know why R isn't reading my whole data set?

  • Can you show the `str(yourdata)` – akrun Oct 21 '21 at 16:11
  • No code, no sample data ... can you imagine a way that we can intelligently *infer* what is happening on your computer? Please see https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info for ways to frame questions in a way that makes them *reproducible*, ergo much easier for us to answer and much more applicable for those with same/similar questions. Thanks. – r2evans Oct 21 '21 at 16:31
  • Here is what I get with str() – elyse.mallinger Oct 21 '21 at 16:37
  • tibble [1,321,278 × 17] (S3: tbl_df/tbl/data.frame) $ ParkCode : chr [1:1321278] "GRPO" "GRPO" "GRPO" "GRPO" ... $ LocationName : chr [1:1321278] "GRPO001A_2016" "GRPO001A_2016" "GRPO001A_2016" "GRPO001A_2016" ... $ EventYear : num [1:1321278] 2016 2016 2016 2016 2016 ... $ DeploymentID : num [1:1321278] 62 62 62 62 62 62 62 62 62 62 ... $ Night : POSIXct[1:1321278], format: "2016-06-08" "2016-06-08" "2016-06-08" "2016-06-08" ... – elyse.mallinger Oct 21 '21 at 16:38
  • There is more to the above but it is too long to post. Let me know if you would like me to break it up into multiple comments. Just so you know, this data frame is taking into account two sheets using the following code:dfA <- readxl::read_excel("DetectionInfoCombined.xlsx", sheet="A") dfB <- readxl::read_excel("DetectionInfoCombined.xlsx", sheet="B") df <- dplyr::bind_rows(dfA,dfB)............... I had used this code before for another analysis before adding the two extra columns that aren't showing up. Would that have something to do with this? – elyse.mallinger Oct 21 '21 at 16:40
  • 1
    Comments are really bad for lots of code or data, please just [edit] your question and add it there (likely in [code blocks](https://stackoverflow.com/editing-help)). – r2evans Oct 21 '21 at 17:06

0 Answers0