Skip to content

join or select row by col with Chinese in #2041

@may442

Description

@may442

library(data.table)
library(dplyr)

case1

a1 <- data.table(
a = c("a", "b", "c", "d"),
b = c(1:12)
)

b1 <- data.table(
a = c("a", "b", "e", "d")
)

a1[b1, on = "a"]

case2

a1 <- data.table(
a = c("中文1", "中文2", "中文3", "中文4"),
b = c(1:12)
)

b1 <- data.table(
a = c("中文1", "中文2", "中文5", "中文4")
)

a1[b1, on = "a"]

case3

a1 <- data.table(
a = c("中文一", "中文二", "中文三", "中文四"),
b = c(1:12)
)

b1 <- data.table(
a = c("中文一", "中文二", "中文五", "中文四")
)

a1[b1, on = "a"]

something wrong !!!!!!!!!!!!!!

a1[a == "中文一"]

something wrong !!!!!!!!!!!!!!

b1 %>%
left_join(
a1,
by = "a"
)

case4

a1 <- data.table(
a = c("中文一", "中文二", "中文三", "中文四"),
b = c(1:12)
)

b1 <- data.table(
a = c("中文一", "中文二", "中文三", "中文五")
)

a1[b1, on = "a"]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions