Project 2: Comcast Telecom Consumer Complaints

Discussion in 'Masters Program - Customers only' started by Vasudevan Santhanam, Apr 5, 2020.

  1. Vasudevan Santhanam

    Joined:
    Jan 23, 2020
    Messages:
    2
    Likes Received:
    0
    Hi,

    Can anyone help me with the code for adding a new column into the dataset.
    I need to create a new categorical variable with value as Open and Closed. Open & Pending is to be categorized as Open and Closed & Solved is to be categorized as Closed.
     
    #1
  2. Amarshree V

    Amarshree V Active Member
    Alumni

    Joined:
    Feb 17, 2020
    Messages:
    20
    Likes Received:
    4
    With the help of transform() and ifelse you can do it.

    sample code:

    x= transform(data frame, column name = ifelse((Status=='Open'|Status=='Pending'),"Open","Closed"))
     
    #2
  3. Barath Raj S N

    Joined:
    Aug 14, 2019
    Messages:
    4
    Likes Received:
    0
    -> Provide the trend chart for the number of complaints at monthly and daily granularity levels.
    Can u help me doing this, I am not understanding that how to make monthly and daily level.
     
    #3
  4. Amarshree V

    Amarshree V Active Member
    Alumni

    Joined:
    Feb 17, 2020
    Messages:
    20
    Likes Received:
    4
    They are asking how many complaints received monthly and daily basis (match Ticket and Date)
    1. Date need to be converted to date format use as.Date
    2. Split the month from date for monthly analysis.
    3. For daily report plot directly

    For Monthly report
    a<-as.Date(com$date)
    m<-as.numeric(format(com$date," %m"))
    head(com)
    c<-table(com$Ticket..,com$month)
    barplot(cou,main="number of monthly daily")

    Now for Daily u try it (using last two steps)

    Modify accordingly
     
    #4
  5. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    I'm converting date using date format a<-as.Date(com$date)
    but if dates having this (21-02-2011) format converted as dates and the other 2/02/2015 format converted as NA.
    HOW TO FIX THIS?
     
    #5
  6. Amarshree V

    Amarshree V Active Member
    Alumni

    Joined:
    Feb 17, 2020
    Messages:
    20
    Likes Received:
    4
    com$date<-as.Date(com$date, "%d-%m-%Y")

    I tried this before Extracting month It is working
     
    #6
  7. Eunice Elizabeth Dhivya

    Joined:
    Dec 30, 2019
    Messages:
    1
    Likes Received:
    0
    Can someone help me with this part of the project. Kind of stuck here not sure how to handle this one.
    • Which state has the highest percentage of unresolved complaints
    • Provide the percentage of complaints resolved till date, which were received through the Internet and customer care calls.
     
    #7
  8. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    Still it is coming like that. in excel also I tried to change but it is not changing.
     
    #8
  9. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    In Comcast telecom complaints data dates are like 22-04-2015
    4/8/2015
    18-04-2015
    5/7/2015
    after importing this data in R I used str() function to check the structure of the data, and I found Dates are in factors type.
    I wrote code like
    data <- read.csv(file.choose())
    str(data)
    d <- as.Date(data$Date)
    d
    but in console I got dates like "0022-04-20" NA "0018-04-20" NA "0026-05-20" NA "0024-06-20" "0023-06-20"
    why NA came here and how to i fix this?
     
    #9
  10. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    This code is not working. may i know you also seeing dates in data set like me.
    date
    22-02-2015
    4/5/2015
    .
    .
    .
     
    #10
  11. Amarshree V

    Amarshree V Active Member
    Alumni

    Joined:
    Feb 17, 2020
    Messages:
    20
    Likes Received:
    4
    Hence we have 04-08-2015 - we don't have any information whether the 04 or 08 is month or date so i considered 04 as date (like DD/MM/YYYY)

    comcast$d = as.Date(comcast$Date,"%d-%m-%Y")
    comcast$d
    class(comcast$d)


    Attached the Table after executing this above code, and by the below table you can see how my data set looks like. ( if your data set is different download again) Date format.png
     
    #11
  12. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    upload_2020-4-27_0-5-0.png

    This above picture is before code
    My code is
    data <- read.csv(file.choose())
    View(data)
    data$Date <- as.Date(data$Date,"%d-%m-%Y")
    data$Date
    class(data$Date)
    upload_2020-4-27_0-7-0.png

    Above pic is my console
    I got a lot of NA's
     
    #12
  13. Vicky Das

    Vicky Das Member

    Joined:
    Apr 7, 2020
    Messages:
    7
    Likes Received:
    0
    @REVANURU MADHVAMAHARSHI - Any update on the date conversion issue in Comcast data as I'm facing similar issue as you mentioned. This issue is same in Walmart data as well.
     
    #13
  14. REVANURU MADHVAMAHARSHI

    Joined:
    Feb 6, 2020
    Messages:
    10
    Likes Received:
    0
    No update... if you got please let me know
     
    #14
  15. Vicky Das

    Vicky Das Member

    Joined:
    Apr 7, 2020
    Messages:
    7
    Likes Received:
    0
    @REVANURU MADHVAMAHARSHI : OK try the below command. It will work as it worked for me.

    1 - run the library(lubridate) package. Its the package to convert the column to date. Then run the below command.

    2 - comcast.tele.complnt$Date <- parse_date_time(comcast.tele.complnt$Date, orders ="%d!-%m!-%y!")

    Let me know if it doesn't work!
     
    #15
  16. AIA

    AIA Member

    Joined:
    Aug 29, 2019
    Messages:
    5
    Likes Received:
    0
    Can someone please help with the codes to compare. My codes keep throwing error and i dont know what i am getting wrong. my email id is ayooluwanimi05@gmail.com. Thanks.
     
    #16

Share This Page