Hi @jaison. Looking at the data set, it appears the column names have several unusual characters. Below are two different ways to change the name of the column in question. Since the column appears first in the data frame, the first example changes the element in the first position of the names() vector. The second example uses the clean_names() function from the janitor package, which standardizes all of the column names. Then, the rename() function is used to update the first column.
library(tidyverse)
# two copies of the same data
chocolate_df = read_csv('flavors_of_cacao.csv')
chocolate_df2 = chocolate_df
# Ex.1 - rename the vector of names
names(chocolate_df)
#> [1] "Company \n(Maker-if known)" "Specific Bean Origin\nor Bar Name"
#> [3] "REF" "Review\nDate"
#> [5] "Cocoa\nPercent" "Company\nLocation"
#> [7] "Rating" "Bean\nType"
#> [9] "Broad Bean\nOrigin"
names(chocolate_df)[1] = 'Company'
names(chocolate_df)
#> [1] "Company" "Specific Bean Origin\nor Bar Name"
#> [3] "REF" "Review\nDate"
#> [5] "Cocoa\nPercent" "Company\nLocation"
#> [7] "Rating" "Bean\nType"
#> [9] "Broad Bean\nOrigin"
# Ex. 2 - use the janitor package to clean the names first, then rename the column
# (this will change/clean all column names)
chocolate_df2 = chocolate_df2 |> janitor::clean_names()
names(chocolate_df2)
#> [1] "company_maker_if_known" "specific_bean_origin_or_bar_name"
#> [3] "ref" "review_date"
#> [5] "cocoa_percent" "company_location"
#> [7] "rating" "bean_type"
#> [9] "broad_bean_origin"
chocolate_df2_renamed = rename(chocolate_df2, company = company_maker_if_known)
names(chocolate_df2_renamed)
#> [1] "company" "specific_bean_origin_or_bar_name"
#> [3] "ref" "review_date"
#> [5] "cocoa_percent" "company_location"
#> [7] "rating" "bean_type"
#> [9] "broad_bean_origin"
Man thank you so much. One of Google employees said this is a helpful and strong community but i didn't expect this level of commitment and a helpful mindset