> On Oct 7, 2016, at 10:44 AM, Jorge Cimentada wrote:
>
> Hi Bert,
>
> Yes, I'm aware of the difference between a and "a" but in terms of object
> classes I don't see the difference between "a" and names(mtcars)[1].
> They're both strings.
They are not both "strings". One is a character value
On 07/10/2016 1:44 PM, Jorge Cimentada wrote:
Hi Bert,
Yes, I'm aware of the difference between a and "a" but in terms of object
classes I don't see the difference between "a" and names(mtcars)[1].
They're both strings. However, for creating a named character vector, this
works:
c("a" = "b)
Bu
Hi Bert,
Yes, I'm aware of the difference between a and "a" but in terms of object
classes I don't see the difference between "a" and names(mtcars)[1].
They're both strings. However, for creating a named character vector, this
works:
c("a" = "b)
But this doesn't
c(names(mtcars)[1] = "b")
For e
I think you have R semantics confused. What do you think
c("a" = "b")
means?
Note that:
> c("a" = "b")
a
"b"
> a
Error: object 'a' not found
And of course:
class("a") # character
class("b") # character
but this has *nothing* to do with the line immediately above it.
Have you gone through
I'm sorry, there was a typo. The result is still the same:
c("a" = "b") # named character vector
class("a") # character
class("b") # character
c(names(mtcars)[1] = names(mtcars)[2]) # error
class(names(mtcars)[1]) # character
class(names(mtcars)[2]) # character
Thanks,
Jorge Cimentada
[
Hi everyone,
I was hoping someone would explain why this doesn't work.
c("a" = "b") # named character vector
class("a") # character
class("b") # character
c(names(mtcars)[1] = names(mtcars[2]) # error
class(names(mtcars)[1]) # character
class(names(mtcars)[2]) # character
Thanks,
Jorge Cimenta
6 matches
Mail list logo