Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Data Science with R | Ashutosh | Apr 10 - May 09

Anita_50

Member
Sir, I am not able to download R, please share the picture image step by step as there are lots of link, i am getting confused.
when i clicked on Download R (For window) it is showing like this after this i clicked on installation and other instruction,it downloaded R studio when i opened it, it is showing that you haven't download "R",PLEASE GUIDE ME
1618071461982.png
HERE IS ANOTHER ATTACHEMENT


1618071746116.png
 

Anita_50

Member
HI,

IT IS SHOWING LIKE THIS ,PLEASE TELL ME I AM ON RIGHT TRACK OR NOT BECAUSE IT IS LITTLE BIT DIFFERENT FROM PROJECT LAB WHICH IS DEDICATED WITH Simplilearn.


1618072431676.png
 

Shailya

Active Member
I am applying sum function of a dataframe, row-wise, on column 7 to 11 like this and it works fine.

sum(hsb_df[1,7:11])

But the same method doesnt work apply mean function row-wise, on column 7 to 11.

mean(hsb_df[1,7:11])

[1] NA
Warning message:
In mean.default(hsb_df[1, 7:11]) :
argument is not numeric or logical: returning NA


Can someone please explain why this happenes??
 
Hi,

I have 3 queries:
1. Can we not put a list into a data frame ?
2. How to insert new element in data frame ?
3. How to remove any particular row or any column in data frame ?

I tried with first one and got this error:
1619106066525.png

Please Help.
 
Hello Everyone,

When I upload the dataset files to R studio which I downloaded from LMS, the files seem to be different from what I see on Ashutosh's screen. Could someone please help.

1619160506656.png
 

mansi_33

Member
Please help urgent, My system was not working in last 2 classes so I could not practice, Now while I downloaded the Datasets from LMS is different from the Ashutosh's Datasets. I am unable to move forward without same data or at least if anyone can hsb file as of now in Google Drive.

Please help on priority.
 

Shailya

Active Member
Please help urgent, My system was not working in last 2 classes so I could not practice, Now while I downloaded the Datasets from LMS is different from the Ashutosh's Datasets. I am unable to move forward without same data or at least if anyone can hsb file as of now in Google Drive.

Please help on priority.
Your mail id? I can mail hsb and other datasets from LMS.
 

Shailya

Active Member
I have created this data frame:

Employement_df = data.frame(Age_Group = c("18-25","25-35","35-45","45-55","55-65","65Plus"),
Employed = c(60,85,95,97,97,100),
UnEmployed = c(40,15,5,3,3,0))
Employement_df

Employement_df$Total = apply(Employement_df[,2:3],1,sum)

Now, I want to create a stacked bar chart from this which I am unable to do.

Please help.
 

Attachments

  • Dataframe.PNG
    Dataframe.PNG
    5.8 KB · Views: 4

Shailya

Active Member
I have created this data frame:

Employement_df = data.frame(Age_Group = c("18-25","25-35","35-45","45-55","55-65","65Plus"),
Employed = c(60,85,95,97,97,100),
UnEmployed = c(40,15,5,3,3,0))
Employement_df

Employement_df$Total = apply(Employement_df[,2:3],1,sum)

Now, I want to create a stacked bar chart from this which I am unable to do.

Please help.
Found the Solution to this myself, if anyone's interested:

mat1 = as.matrix(Employement_df[,c(-1,-4)]) (Creating a matrix from dataframe, dropping 1st column as it is in character and dropping last column as it in unnecessary from chart)

mat1

rownames(mat1) = Employement_df$Age_Group
(Adding first column of age groups to matrix as simply rownames.)
mat1

mat2 = t(mat1)
(Creating transpose of mat1 so that it can be plotted as stacked bars in chart.)
mat2

barplot(mat2)
 

Attachments

  • Solution.PNG
    Solution.PNG
    50.8 KB · Views: 4
We have only few classes left. Should we practice on few problem solutions. If we get them right, it would be helpful in real life scenario
 
I tried KNN. But keep getting

# Getting error - Error in mjob_outcome[train_ind, ] : incorrect number of dimensions.
Adding the code here
#Introduction to k-Nearest Neighbors
 

Attachments

  • UploadCOde.txt
    5.3 KB · Views: 3

Shailya

Active Member
I am stuck at finding whether my data distribution is Normally distributed or not? If no, then I have to normalize it.
How can both things be done.
Please Help.

(Project: College Admission)
 
Hi
I am not able to create a separate column of month to be extracted from date. how to do that?
pls help.
Project 7:Comcast telecom customer complaints
 

Shailya

Active Member
Hi
I am not able to create a separate column of month to be extracted from date. how to do that?
pls help.
Project 7:Comcast telecom customer complaints
If your variable is date type, simply use following to extract month:

month_var = format(df$datecolumn, "%m") # this will give output like "09"
month_var = format(df$datecolumn, "%b") # this will give output like "Sep"
month_var = format(df$datecolumn, "%B") # this will give output like "September"


Cheers..
 

Support Simplilearn(4685)

Moderator
Staff member
Alumni
Hi Learners,

Kindly refer to the below project mentoring recordings.

# Project - College Admission - Project Mentoring :

# Project - Web Data Analysis - Project Mentoring :

# Project - Insurance factors identification - Project Mentoring :

# Project - Healthcare cost analysis - Project Mentoring :

Happy Learning !!!
 

Shailya

Active Member
Hi guys.
Hope you all are done with project submission.
I am interested to know how are you going to prepare for simulation test. I am a bit confused as to how to prepare for the test.
Any and all guidelines will be appreciated.
Cheers. :)
 
Top