These are chat archives for FreeCodeCamp/DataScience

10th
Oct 2018
Alice Jiang
@becausealice2
Oct 10 2018 04:32
@erictleung and @GoldbergData are both handy with R scripts, @sourav006 maybe they can help
Eric Leung
@erictleung
Oct 10 2018 05:30
@sourav006 what does R say the error is? And what are you looping through?
sourav006
@sourav006
Oct 10 2018 06:13
@erictleung @becausealice2 @GoldbergData

CODE

for (i in 1:ncol(df)){
print(paste(max(str_length(df[,i]))))}

It is throwing following error:-

Error in [.data.table(df, , i) :
j (the 2nd argument inside [...]) is a single symbol but column name 'i' is not found.
Perhaps you intended DT[, ..i]. This difference to data.frame is deliberate and explained in FAQ 1.1

My agenda is to get the max string length from every colomn present in a dataframe df.
Any alternate solution or how to
solve this error.

Rahul Bhatia
@rbhatia46
Oct 10 2018 07:28
Can anyone tell me how to implement ordinal logistic regression using mord?