Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的对象具有“字符”类。gg
x <- rep(TRUE,4) x <- replace(x,3,FALSE)
我现在想将其强制/转换为一个逻辑类。如何更改 x 的类别?
我假设你的意思是在你的例子中:
x <- rep("TRUE", 4) x <- replace(x, 3, "FALSE") class(x) # "character"
在这种情况下尝试:
y <- as.logical(x) class(y) # "logical"
I tried this code for adding b to books:
b
books
IEnumerable<Book> books =null; foreach (Book b in context.Books.AsEnumerable())