DS WITH R | 12TH JAN - 10TH FEB |ASHUTOSH

Discussion in 'Big Data and Analytics' started by Kunal Guwalani, Jan 9, 2019.

  1. Kunal Guwalani

    Kunal Guwalani Well-Known Member
    Simplilearn Support

    Joined:
    Jul 17, 2018
    Messages:
    152
    Likes Received:
    10
    #1
    Last edited: Jan 9, 2019
  2. Ankur Sharma_12

    Ankur Sharma_12 Customer
    Customer

    Joined:
    Oct 31, 2018
    Messages:
    11
    Likes Received:
    0
    ****** Additional blank row is being added while reading an .xlsx file *******

    Hi Guys - I have an excel sheet with multiple tabs and I am trying to read it through R. Essentially, I would like to transform this excel sheet and add some new columns/calculations based on my business need.

    Issue in this code which I am not able to solve is, somehow below code is create an additional last row (I verified it through View() syntax) which is incorrect as per my business rule. Can you suggest some change here?

    install.packages("readxl")
    read_excel_allsheets <- function(filename, tibble = FALSE) {
    sheets = excel_sheets(filename)
    sheets
    x = lapply(sheets, function(X) read_excel(filename,skip = 1))
    if(!tibble)
    {
    x = lapply(x, as.data.frame)
    }
    names(x) = sheets
    x
    }

    ## Load the excel sheet with all the tabsl
    mysheet = read_excel_allsheets("Dashboard.xlsx")
    View(mysheet)

    ## Retreive the tab which we need to format.
    listOfOpenRemedyIncidentsh = mysheet$`Tab1`

    ## Convert list to data frame for easier operations.
    dfListOfOpenRemedyIncidents = data.frame(listOfOpenRemedyIncidents)
    View(dfListOfOpenRemedyIncidents)

    ## Now from here we need to add a new column in this data frame with Onsite V/S Offshore V/S SME
    ## and assign these tickets based upon names or unassigned
    dfListOfOpenRemedyIncidents$'NEW_COLUMN_NAME'='Not Assigned Yet'

    ## How to export now this data frame to an Excel again
    library(xlsx)
    write.xlsx(dfListOfOpenRemedyIncidents, "New Dashboard.xlsx")
     
    #2
  3. _55446

    _55446 Member

    Joined:
    Jan 10, 2019
    Messages:
    4
    Likes Received:
    0
    Hi,

    I recently submitted my project of healthcare in data science with R learning. It was rejected. When I checked the error details I found timeout errors. I would like to know if they are because I have included "install.packages and library" commands in my code. Kindly confirm.
    Thanks in advance for your reply
     
    #3
  4. _46225

    _46225 New Member

    Joined:
    Oct 31, 2018
    Messages:
    1
    Likes Received:
    0
    Hi ,

    Need some help iam trying to find the missing values using in titanic_data found age has some missing values by using this function p$Age[is.na(p$Age)]->k it is showing the NA 's in vector form but i need which row has missing values of age.
    Kindly help to find the values.

    Thanks in advance!
     
    #4
  5. Kunal Guwalani

    Kunal Guwalani Well-Known Member
    Simplilearn Support

    Joined:
    Jul 17, 2018
    Messages:
    152
    Likes Received:
    10
    Please help us with the full code
     
    #5

Share This Page