Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 views
in Technique[技术] by (71.8m points)

dplyr - why does R markdown says that the column is not found?

I am trying to create a table in R, but it says there is no such column. Here is what I have done:

invis_tib <- readr::read_csv("/Users/bahar/Desktop/yeni_r/veri/invisibility.csv")
─ Column specification ────────────────────────────────────────────────────────────

cols( id;cloak;mischief = col_character() )

``{r,echo=FALSE}
invis_sum <-invis_tib %>%
dplyr::group_by(cloak) %>%
dplyr::summarize(
n=n(),
mean=mean(mischief),
`std.dev` =sd(mischief)

)

Error: Must group by variables found in `.data`. * Column `cloak` is not found.

Please help me to get handle this.

Someone commented use csv2, so I tried and got this:

``? Using ',' as decimal and '.' as grouping mark. Use     `read_delim()`       for more control.

── Column specification   ────────────────────────────────────────────────────────────
cols(
id = col_double(),
cloak = col_character(),
mischief = col_double()
)

[1] "id"       "cloak"    "mischief"

But when I run the code for the mean and sd nothing happens, when I knit I just get ...

question from:https://stackoverflow.com/questions/65944983/why-does-r-markdown-says-that-the-column-is-not-found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...