Welcome to the Simplilearn Community

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

Sign Up

Data Science with R | Sumeet | Sept 26 - Oct 25 (2020)

Sir, I am facing this error -" Error in 2 || y = 2 : target of assignment expands to non-language object" when I give input x=2||y=2 where x=1 and y=2
 
Hey Sumeet, I have an Issue while importing the excel file i am getting below mentioned error...
help(read.xls)
> read.xls(gdata)
Error in path.expand(xls) : object 'gdata' not found
Error in file.exists(tfn) : invalid 'file' argument
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls("Attribute.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> this_data = read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

Restarting R session...

> this_data = read.xls("Attribute data.xls")
Error in read.xls("Attribute data.xls") :
could not find function "read.xls"
 
Hello Sumeet, unable to use this Command

> help("read.xls")
> my_data = read.xls("C:\Users\1990d\OneDrive\Documents\New folder\Attribute data.xls")
Error: '\U' used without hex digits in character string starting ""C:\U"
> setwd("C:\Users\1990d\OneDrive\Documents\New folder")
Error: '\U' used without hex digits in character string starting ""C:\U"
> setwd('C:\Users\1990d\OneDrive\Documents\New folder')
Error: '\U' used without hex digits in character string starting "'C:\U"
> setwd("c\user\1990d\OneDrive\Documents\New folder")
Error: '\u' used without hex digits in character string starting ""c\u"
>
 

Sumeet Vyas

Active Member
Sir, I am facing this error -" Error in 2 || y = 2 : target of assignment expands to non-language object" when I give input x=2||y=2 where x=1 and y=2

Try x==2||y==2. If you are using logical operator, make sure that you are using Logical/Boolean Data types i.e for x==2 which is a boolean as it is a True or a False. x=2 is assignment operation.
 

Sumeet Vyas

Active Member
Hey Sumeet, I have an Issue while importing the excel file i am getting below mentioned error...
help(read.xls)
> read.xls(gdata)
Error in path.expand(xls) : object 'gdata' not found
Error in file.exists(tfn) : invalid 'file' argument
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls("Attribute.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> this_data = read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

Restarting R session...

> this_data = read.xls("Attribute data.xls")
Error in read.xls("Attribute data.xls") :
could not find function "read.xls"


If you see in the second line above it says - object 'gdata' not found. You need to install gdata package first. Use the following commands to install and import gdata package -
install.packages("gdata")
library(gdata)
 

Sumeet Vyas

Active Member
Hello Sumeet, unable to use this Command

> help("read.xls")
> my_data = read.xls("C:\Users\1990d\OneDrive\Documents\New folder\Attribute data.xls")
Error: '\U' used without hex digits in character string starting ""C:\U"
> setwd("C:\Users\1990d\OneDrive\Documents\New folder")
Error: '\U' used without hex digits in character string starting ""C:\U"
> setwd('C:\Users\1990d\OneDrive\Documents\New folder')
Error: '\U' used without hex digits in character string starting "'C:\U"
> setwd("c\user\1990d\OneDrive\Documents\New folder")
Error: '\u' used without hex digits in character string starting ""c\u"
>


Use forward slashes while specifying the file path.
For example like the one listed below -
setwd("D:/DATA SCIENCE/CCPP-Linear regression")
 

_89730

Member
Hello sir
We cannot use byrow = true function in arrays?
i'm getting this error by doing so
v1 = c(1,2,3)
> v2 = c(22,33,45,48,25,69)
> arr = array(c(v1,v2),dim = c(3,3,2),byrow = TRUE)
Error in array(c(v1, v2), dim = c(3, 3, 2), byrow = TRUE) :
unused argument (byrow = TRUE)


What i have done wrong in this sir?
can u please guide..
i have taken one vector and trying to get value from that but only till 82 so i wrote this program.
x
[1] 2 5 28 24 51 76 42 4 48 4 82 7 48 786 78 5
> for (y in x){print(y)
+ if y == 82
Error: unexpected symbol in:
"for (y in x){print(y)
if y"
> break}
Error: unexpected '}' in " break}"
> for(y in x){print(y) if y == 82 break}
Error: unexpected 'if' in "for(y in x){print(y) if"
 
Sumeet,

Facing the below error message. Any idea?

> setwd("F:\OFICIAL\Study Materials\DataScience - Simplilearn\Datasets\Datasets\Lesson 3_Data Structures")
Error: '\O' is an unrecognized escape in character string starting ""F:\O"

I dont see session menu also.. this is R version 4.0.2
 
Use forward slashes while specifying the file path.
For example like the one listed below -
setwd("D:/DATA SCIENCE/CCPP-Linear regression")


> install.packages("gdata")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/1990d/OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/gdata_2.18.0.zip'
Content type 'application/zip' length 1264063 bytes (1.2 MB)
downloaded 1.2 MB

package ‘gdata’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\1990d\AppData\Local\Temp\RtmpO0vFUa\downloaded_packages
> libraby(gdata)
Error in libraby(gdata) : could not find function "libraby"
> libraby("gdata")
Error in libraby("gdata") : could not find function "libraby"
> library(gdata)
gdata: Unable to locate valid perl interpreter
gdata:
gdata: read.xls() will be unable to read Excel XLS and XLSX files unless
gdata: the 'perl=' argument is used to specify the location of a valid
gdata: perl intrpreter.
gdata:
gdata: (To avoid display of this message in the future, please ensure perl
gdata: is installed and available on the executable search path.)
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: ‘gdata’

The following object is masked from ‘package:stats’:

nobs

The following object is masked from ‘package:utils’:

object.size

The following object is masked from ‘package:base’:

startsWith

> my_data = read.xls("Attribute data")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

COuld you please check this is the issue i am facing
 
> install.packages("gdata")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/1990d/OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/gdata_2.18.0.zip'
Content type 'application/zip' length 1264063 bytes (1.2 MB)
downloaded 1.2 MB

package ‘gdata’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\1990d\AppData\Local\Temp\RtmpO0vFUa\downloaded_packages
> libraby(gdata)
Error in libraby(gdata) : could not find function "libraby"
> libraby("gdata")
Error in libraby("gdata") : could not find function "libraby"
> library(gdata)
gdata: Unable to locate valid perl interpreter
gdata:
gdata: read.xls() will be unable to read Excel XLS and XLSX files unless
gdata: the 'perl=' argument is used to specify the location of a valid
gdata: perl intrpreter.
gdata:
gdata: (To avoid display of this message in the future, please ensure perl
gdata: is installed and available on the executable search path.)
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: ‘gdata’

The following object is masked from ‘package:stats’:

nobs

The following object is masked from ‘package:utils’:

object.size

The following object is masked from ‘package:base’:

startsWith

> my_data = read.xls("Attribute data")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

COuld you please check this is the issue i am facing
Use forward slashes while specifying the file path.
For example like the one listed below -
setwd("D:/DATA SCIENCE/CCPP-Linear regression")
 
> setwd("E:/Data Science/New folder")
> ver2 = read.xls("Attribute data.xls")
Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method, :
Intermediate file 'C:\Users\1990d\AppData\Local\Temp\RtmpslSeRk\file1d7c297b45bf.csv' missing!
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '"C:\Perl64\bin\perl.exe" "C:/Users/1990d/OneDrive/Documents/R/win-library/4.0/gdata/perl/xls2csv.pl" "Attribute data.xls" "C:\Users\1990d\AppData\Local\Temp\RtmpslSeRk\file1d7c297b45bf.csv" "1"' had status 2
Error in file.exists(tfn) : invalid 'file' argument
> ver2 = read.xls("Attribute data.xls", verbose = FALSE)
Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method, :
Intermediate file 'C:\Users\1990d\AppData\Local\Temp\RtmpslSeRk\file1d7c8c82171.csv' missing!
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '"C:\Perl64\bin\perl.exe" "C:/Users/1990d/OneDrive/Documents/R/win-library/4.0/gdata/perl/xls2csv.pl" "Attribute data.xls" "C:\Users\1990d\AppData\Local\Temp\RtmpslSeRk\file1d7c8c82171.csv" "1"' had status 2
Error in file.exists(tfn) : invalid 'file' argument


I reinstalled perl and R both but its not working kindly assist​
 
> setwd("~/DATASET")
> setwd("C:/Users/1990d/OneDrive/Documents/DATASET")
> d1 = read.xls("demo1.xls")
Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method, :
Intermediate file 'C:\Users\1990d\AppData\Local\Temp\RtmpuuFZin\file267015544836.csv' missing!
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '"C:\Perl64\bin\perl.exe" "C:/Users/1990d/OneDrive/Documents/R/win-library/4.0/gdata/perl/xls2csv.pl" "demo1.xls" "C:\Users\1990d\AppData\Local\Temp\RtmpuuFZin\file267015544836.csv" "1"' had status 2
Error in file.exists(tfn) : invalid 'file' argument
>
i tried to read different file on different location it didnt work..
 

Hitesh H S

Well-Known Member
Staff member
Simplilearn Support
having problems installing packages and setting working directory. image attached.
Hi Mohamed,

Please note that you cannot set the local path as your working directory on the Simplilearn lab. As the labs is a cloud-based version, you need to upload the files to the lab, and then from there, you'll be able to read the files. The Packages are already installed on our labs and you just need to call the library to use those packages. For example:
library(readxl)

I hope this helps you.

Happy Learning !!!!
 

Sriraksha G

Well-Known Member
Staff member
Simplilearn Support
Hey Sumeet, I have an Issue while importing the excel file i am getting below mentioned error...
help(read.xls)
> read.xls(gdata)
Error in path.expand(xls) : object 'gdata' not found
Error in file.exists(tfn) : invalid 'file' argument
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls(Attribute.xls)
Error in path.expand(xls) : object 'Attribute.xls' not found
Error in file.exists(tfn) : invalid 'file' argument
> setwd("~/New folder")
> read.xls("Attribute.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument
> this_data = read.xls("Attribute data.xls")
Error in findPerl(verbose = verbose) :
perl executable not found. Use perl= argument to specify the correct path.
Error in file.exists(tfn) : invalid 'file' argument

Restarting R session...

> this_data = read.xls("Attribute data.xls")
Error in read.xls("Attribute data.xls") :
could not find function "read.xls"


Hey Vijay,

Please try the below steps to import data in Excel files format (xls|xlsx),
-Copying data from Excel and import into R
-Importing Excel files into R using readxl package
-Importing Excel files using xlsx package

ex.
# Use readxl package to read xls|xlsx
library("readxl")
my_data <- read_excel("my_file.xlsx")
# Use xlsx package
library("xlsx")
my_data <- read.xlsx("my_file.xlsx")

To write data from R to Excel files (xls|xlsx), you can do the following:

Package: install.packages(“xlsx”) & function: write.xlsx()
ex:
library("xlsx")
# Write the first data set in a new workbook
write.xlsx(USArrests, file = "myworkbook.xlsx",
sheetName = "USA-ARRESTS", append = FALSE)

Hope this helped. Stay safe!!
 

Sriraksha G

Well-Known Member
Staff member
Simplilearn Support
how do we get permission for writeable library?

having problems installing packages and setting working directory. image attached.

Hey Aijazudin,

I referred to the screenshot that you have shared.
Firstly check your current working directory by using the getwd functin, then use the setwd function to set the working directory according to your preference.

However, if you are still facing an error, it means that you don't have permission to write to that directory.
Are you an admin on your computer? If so, you should be able to change the permissions to give you Read & Write access.

Hope this helped. Stay safe!!
 
Hey Sumeet,
Need Assistance.. I am getting below mentioned error. Attribute_1 is an excel sheet, Recommendation is a column. I need to use apply() on column.
> apply(df, 2)
Error in match.fun(FUN) : argument "FUN" is missing, with no default
> apply(df$Attribute_1.Recommendation, 2)
Error in match.fun(FUN) : argument "FUN" is missing, with no default
 

Hitesh H S

Well-Known Member
Staff member
Simplilearn Support
Sumeet,

Facing the below error message. Any idea?

> setwd("F:\OFICIAL\Study Materials\DataScience - Simplilearn\Datasets\Datasets\Lesson 3_Data Structures")
Error: '\O' is an unrecognized escape in character string starting ""F:\O"

I dont see session menu also.. this is R version 4.0.2
Hi Dhineshraja,

Please note that you cannot use a backward slash while you're setting the path. Please use forward slash "/" instead of backward slash while setting a path.

I hope this helps you.

Happy Learning !!!!
 

Hitesh H S

Well-Known Member
Staff member
Simplilearn Support
Hello sir
We cannot use byrow = true function in arrays?
i'm getting this error by doing so
v1 = c(1,2,3)
> v2 = c(22,33,45,48,25,69)
> arr = array(c(v1,v2),dim = c(3,3,2),byrow = TRUE)
Error in array(c(v1, v2), dim = c(3, 3, 2), byrow = TRUE) :
unused argument (byrow = TRUE)


What i have done wrong in this sir?
can u please guide..
i have taken one vector and trying to get value from that but only till 82 so i wrote this program.
x
[1] 2 5 28 24 51 76 42 4 48 4 82 7 48 786 78 5
> for (y in x){print(y)
+ if y == 82
Error: unexpected symbol in:
"for (y in x){print(y)
if y"
> break}
Error: unexpected '}' in " break}"
> for(y in x){print(y) if y == 82 break}
Error: unexpected 'if' in "for(y in x){print(y) if"
Hi Learner,

Please find the below explanation for function "Array"
array(data = NA, dim = length(data), dimnames = NULL)

V1 <- c(1,2,3)
V2 <- c(22,33,45,48,25,69)
arr = array(c(V1,V2), dim = c(3,3,2))
arr

matrix(c(V1,V2),nrow = 3,ncol = 3,byrow = TRUE)


x = c(2,5,28,24,51,76,42,4,48,4,82,7,48,786,78,5)
x
for (y in x){
if (y == 82){
print(paste("Coming out from for loop Where i = ", y))
break
}
print(paste("Values are : ", y))
}

I hope this helps you.

Happy Learning!!!
 

_52453

Active Member
Hi Sumeet,

I have below queries:

1) You need to get back on why y axis is less in your below eg. for heat map as discussed in class-

heatmap(df, scale = "none")

2) You need to get back on why 8 breaks are not seen in your below eg. as discussed in class-

hist(mtcars$mpg, breaks=8,col="darkgreen")

Regards
 

_52453

Active Member
Hi Sumeet,

I had below queries:

1) In your below eg. of ggplot-

ggplot(data = mtcars,aes(x=cyl,fill=factor(gear)))+geom_bar()

Though the values of cyl on x axis are 4,6 and 8; the bars on x axis seem to cover lot of values like from 3 to 9. I hope, you get my query

2) I guess, saving a graphic input to file as in slide 49 of lesson 4 seems to be left off. Are, you going to explain that in class?

Regards
 

_52453

Active Member
Hi Sumeet,

I had below queries:

1) In our ebook lesson 4 and page 22, there are values shown in x-axis like 'N=32 Bandwidth=2.477'. What are these values on the x-axis?

2) What does the scale function do as I found it difficult to understand from help(scale)? You may explain with your following example-

heatmap(df, scale = "none")

Regards
 

Sumeet Vyas

Active Member
Hey Sumeet,
Need Assistance.. I am getting below mentioned error. Attribute_1 is an excel sheet, Recommendation is a column. I need to use apply() on column.
> apply(df, 2)
Error in match.fun(FUN) : argument "FUN" is missing, with no default
> apply(df$Attribute_1.Recommendation, 2)
Error in match.fun(FUN) : argument "FUN" is missing, with no default


Hi Learner,
apply function is used to apply a function over a collection of data. For example -
apply(df, 2, mean)
The 2 here signifies the dimension and mean specified the function. Hope that clarifies!
 

Sumeet Vyas

Active Member
Hi Sumeet,

I had below queries:

1) In our ebook lesson 4 and page 22, there are values shown in x-axis like 'N=32 Bandwidth=2.477'. What are these values on the x-axis?

2) What does the scale function do as I found it difficult to understand from help(scale)? You may explain with your following example-

heatmap(df, scale = "none")

Regards


Hi Learner,
1. The Bandwidth parameter in the graph indicates the bandwidth of the smoothing kernel used to smoothen out the code. Intuitionally, it just affects the smoothness of the curve plotted. You can try the following piece of code to understand the difference in Bandwidth as per the values.

x <- rnorm(1000, 10, 2)
par(mfrow = c(2,2))
plot(density(x)) #A bit bumpy
plot(density(x,adjust = 10))
plot(density(x,adjust = .1))

Make sure to observe the values of Bandwidth parameter in the graph

2. The scale function scales / converts the values between the range of 0 to 1. The parameter is scaled such that the max value of a parameter (for eg - temp(max) is 38.6 degree C) would be converted to 1 and min value(for eg - if temp(min) is 30.2 degree C) would be converted to zero, and likewise, other values should fall in the range of 0 to 1 after scaling.
 

Sumeet Vyas

Active Member
Hi Sumeet,

I have below queries:

1) You need to get back on why y axis is less in your below eg. for heat map as discussed in class-

heatmap(df, scale = "none")

2) You need to get back on why 8 breaks are not seen in your below eg. as discussed in class-

hist(mtcars$mpg, breaks=8,col="darkgreen")

Regards



Hi Learner,

1. The reason Your output does show all the rows, but the y-labels are less/reduced in the heatmap graph is because they would overlap too much and be unreadable. You can try to export a heatmap to a file/image and then try to view all the rows, but the ideal scenarios in which heatmap is used is for lower values in the heatmap matrix.

2. The reason you don’t get the exact number of bins because the hist() function uses a parameter “pretty” which are chosen so that the graph looks aesthetically better and doesn’t ruin your graph in terms of weird/abrupt breaks. One way to resolved this is specify breaks as a vector -

breaks = seq(-1, 10, 1) or breaks = seq(0, 10, 0.5)

Please refer to the following that provides an indepth explaination of the pretty values and how to use them - https://stat.ethz.ch/R-manual/R-devel/library/base/html/pretty.html
 

Sumeet Vyas

Active Member
Hello Sumeet,
If we need to merge two excel sheet or if compare the two sheets so what would be the steps???


The ideal way to do this would be to read two files in a dataframes and then append one dataframe to another, and then eventually carry out your comparisons. This has the limitation that both the dataframes should have the same number of columns, to append to each other to make sense. Hope this clarifies!
 

Sumeet Vyas

Active Member
The ideal way to do this would be to read two files in a dataframes and then append one dataframe to another, and then eventually carry out your comparisons. This has the limitation that both the dataframes should have the same number of columns, to append to each other to make sense. Hope this clarifies!


Correction - Read files in two seperate dataframes*
 
Hi Sumeet,
i am using R studio, if i restart my laptop i have to set all the time path can we make it default.
after restarting R studio i have reinstall all the packages. can you help me..
 

Sumeet Vyas

Active Member
Hi Sumeet,
i am using R studio, if i restart my laptop i have to set all the time path can we make it default.
after restarting R studio i have reinstall all the packages. can you help me..


Hello Vijay,
Seems this is an installation issue as R studio retains the package once it is installed. Please check if the installation done is as per the guide specified in the course materials. Also check the directory in which the package is installed - using ".libPaths()" command. It is common after an update to have a new directory path.
 
help me out in handling "dress sales" data sheet. I have imported the data set and all. Converted sales count to num data type which were char. Need to know is it enough to show just the trend of the sales whether it is increasing or decreasing so that we have to buy some stock or how is it?
 

_52453

Active Member
Hi Sumeet,

I had posted these queries before but no reply, I am posting again. I had below queries:

1) In your below eg. of ggplot-

ggplot(data = mtcars,aes(x=cyl,fill=factor(gear)))+geom_bar()

Though the values of cyl on x axis are 4,6 and 8; the bars on x axis seem to cover lot of values like from 3 to 9. I hope, you get my query

2) I guess, saving a graphic input to file as in slide 49 of lesson 4 seems to be left off. Are, you going to explain that in class?

Regards
 

_52453

Active Member
Hi,

I have below queries:

1) I need an understanding of the statement- print(list_data[mat]) on page 26 of Lesson 3_Data Structures.pdf as per screen-shot, Lesson3_page26.

2) While reading an excel file, I am getting below error: var_xls = read.xls("Demo 1_Identifying Data Structures.xls") Error in findPerl(verbose = verbose) : perl executable not found. Use perl= argument to specify the correct path. Error in file.exists(tfn) : invalid 'file' argument. Please revert with complete steps to read an excel file.

Regards
 

Attachments

  • Lesson3_page26.pdf
    77.9 KB · Views: 1

Sumeet Vyas

Active Member
help me out in handling "dress sales" data sheet. I have imported the data set and all. Converted sales count to num data type which were char. Need to know is it enough to show just the trend of the sales whether it is increasing or decreasing so that we have to buy some stock or how is it?

Depends on the goal of analysing the dataset. If you just want to understand the relative trends in between few features, the visualisations must be enough. But if you want to measure the relations; for eg, as in lin-reg by measuring the Beta parameters, a deep dive by using such algorithms will provide more insights.
 
Hello Sir,

When I am trying to import data from excel into R. Date convert into short. When I try to apply function available in R to cnvert them in proper format it returns NA. I have consulted stackoverflow but couldnt reach to any solution.

Regards
 

Attachments

  • New Bitmap Image (2).jpg
    New Bitmap Image (2).jpg
    304.5 KB · Views: 1
Last edited:

_90382

New Member
Hello Sumeet,

Thank you for your sessions. I am doing my project on Web Data Analytics. But I am not able to understand what does each entry of the data correspond to. Whether it corresponds to a Page on website or a particular visitor? Can you please help me with this?!
 

ranatarannum

Member
Alumni
Arthritis$categories=ifelse(Arthritis$Treatment=="Treated" && Arthritis$Improved=="Marked","A","B")
View(Arthritis)
It is giving only B in category field.. what is the problem?
Also , I dont find from where to post the query.. can you help me please?
 

_52453

Active Member
Hi Sumeet,

a) If there is data like below (there may be 10 more columns but this is just an illustration):

City_ID State City Rating
-----------------------------------------------
1 Maharastra Mumbai 3
2 Gujarat Ahmedabad 3

How to convert the categorical value of state and city into numerical value so that linear regression can be applied as linear regression works only on numeric data?

b) How to predict the sales for months of July, August and September based on the data given below:
Jan Feb Mar Apr May Jun Jul
Item 1 10 20 30 40 55 66 68
Item 2 12 17 23 34 42 51 61
Item 3 14 7 28 9 41 51 41

Regards
 

_52453

Active Member
Hi Sumeet,

If there is data like below:

Student_ID School_percentage High_school_percentage College_admission
1 57 65 1
2 45 45 0
3 70 62 1
.
.

where College_admission is a categorical variable where student can get admission, 1 means yes and 0 means no.

I have below queries:

1) How to find out the outliers in the data?
2) How to check if data is normally distributed or not?
3) How to do logistic regression for factors of influence?

Regards
 
Top