我有dataframe "InorganicNoStdConditionResiduals"
并拥有以下代码:
View(InorganicNoStdConditionResiduals[,"Job..R"]) #gives a column with 46 rows and two different character --> [1] "14047/1" "18331/3" (correct)
print(head(levels(InorganicNoStdConditionResiduals[,"Job..R"])))
[1] "14047/1" "14047/11" "14047/2" "18331/2" "18331/3" "18331/4"
# the answer should be: [1] "14047/1" "18331/3"
test = levels(InorganicNoStdConditionResiduals[,"Job..R"]) #The environment view panel in RStudio tells me that there are 4794 character (4794 rows, but there are only 46 rows as verified withe View() command earlier)
test1 = nrow(InorganicNoStdConditionResiduals)
print(test1)
[1] 46 # this is correct
可能是workspace
中有些东西存在干扰吗?