R help: fviz_nbclust’ is not available (for R version 3.5.2)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

R help: fviz_nbclust’ is not available (for R version 3.5.2)

MeriamNF
Hello,
I'm struggling to install a function called "fviz_nbclus".

My code is the following:
pkgs <- c("factoextra",  "NbClust")
install.packages(pkgs)
library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
library(FunCluster)

install.packages("fviz_nbclust")
#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘fviz_nbclust’ is not available (for R version 3.5.2)

Best,
Meriam

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R help: fviz_nbclust’ is not available (for R version 3.5.2)

Sarah Goslee
Hi,

fviz_nbclust is a function within the package factoextra. Once you
have installed the package and loaded it, you do not need to
explicitly install the function.

You probably also don't need FunCluster - I think you may be confusing
that package with the FUNcluster argument to the fviz_nbclust
function.

Do take a look at
?fviz_nbclust
for help and a working example.

library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Sarah

On Wed, Jan 16, 2019 at 2:00 PM N Meriam <[hidden email]> wrote:

>
> Hello,
> I'm struggling to install a function called "fviz_nbclus".
>
> My code is the following:
> pkgs <- c("factoextra",  "NbClust")
> install.packages(pkgs)
> library(factoextra)
> library(NbClust)
> # Standardize the data
> load("df4.rda")
> library(FunCluster)
>
> install.packages("fviz_nbclust")
> #fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))
>
> Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> (as ‘lib’ is unspecified)
> Warning in install.packages :
>   package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
> Best,
> Meriam
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Sarah Goslee (she/her)
http://www.numberwright.com

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R help: fviz_nbclust’ is not available (for R version 3.5.2)

Jeff Newmiller
In reply to this post by MeriamNF
Concept 1: You don't install functions... you install packages that have functions in them. There is a function fviz_nbclust in factoextra.

Concept 2: Once a package is installed, you do NOT have to install it again, e.g. every time you want to do that analysis. Making the installation part of your script is not advised.

Concept 3: Typically we do use the library function with a package name at the beginning of every session where we want to use functions from that package. However, that is optional... you could also just invoke the function directly using factoextra::fviz_nbclust(...blahblah...). Having the library function shortens this and if the package is not installed it provides a clear error message that can be a reminder to the user to install the package.

Execute your code line by line and solve the first error you encounter by examining the error message and reviewing what that line of code is designed to do.

On January 16, 2019 11:00:07 AM PST, N Meriam <[hidden email]> wrote:

>Hello,
>I'm struggling to install a function called "fviz_nbclus".
>
>My code is the following:
>pkgs <- c("factoextra",  "NbClust")
>install.packages(pkgs)
>library(factoextra)
>library(NbClust)
># Standardize the data
>load("df4.rda")
>library(FunCluster)
>
>install.packages("fviz_nbclust")
>#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>"gap_stat"))
>
>Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>(as ‘lib’ is unspecified)
>Warning in install.packages :
>  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
>Best,
>Meriam
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R help: fviz_nbclust’ is not available (for R version 3.5.2)

MeriamNF
Thanks for your valuable clarifications.
I tried all the steps again but the problem remains.
In fact,  "fviz_nbclust" is a function inside the package "factoextra".
I run each step very carefully but the problem remains...It doesn't
make sense because I have installed factoextra.

This warning appears:
could not find function "fviz_nbclust"

On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller <[hidden email]> wrote:

>
> Concept 1: You don't install functions... you install packages that have functions in them. There is a function fviz_nbclust in factoextra.
>
> Concept 2: Once a package is installed, you do NOT have to install it again, e.g. every time you want to do that analysis. Making the installation part of your script is not advised.
>
> Concept 3: Typically we do use the library function with a package name at the beginning of every session where we want to use functions from that package. However, that is optional... you could also just invoke the function directly using factoextra::fviz_nbclust(...blahblah...). Having the library function shortens this and if the package is not installed it provides a clear error message that can be a reminder to the user to install the package.
>
> Execute your code line by line and solve the first error you encounter by examining the error message and reviewing what that line of code is designed to do.
>
> On January 16, 2019 11:00:07 AM PST, N Meriam <[hidden email]> wrote:
> >Hello,
> >I'm struggling to install a function called "fviz_nbclus".
> >
> >My code is the following:
> >pkgs <- c("factoextra",  "NbClust")
> >install.packages(pkgs)
> >library(factoextra)
> >library(NbClust)
> ># Standardize the data
> >load("df4.rda")
> >library(FunCluster)
> >
> >install.packages("fviz_nbclust")
> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
> >"gap_stat"))
> >
> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> >(as ‘lib’ is unspecified)
> >Warning in install.packages :
> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
> >
> >Best,
> >Meriam
> >
> >______________________________________________
> >[hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.



--
Meriam Nefzaoui
MSc. in Plant Breeding and Genetics
Universidade Federal Rural de Pernambuco (UFRPE) - Recife, Brazil

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R help: fviz_nbclust’ is not available (for R version 3.5.2)

Jeff Newmiller
Indeed, if you repeat the code you provided before then the problem will not go away because you are not using the knowledge we have given you. You need to show us what you are trying differently based on the explanations provided on the mailing list. If you don't do this then we cannot move forward to more specific answers.

As a reminder:

> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.

On January 16, 2019 11:48:03 AM PST, N Meriam <[hidden email]> wrote:

>Thanks for your valuable clarifications.
>I tried all the steps again but the problem remains.
>In fact,  "fviz_nbclust" is a function inside the package "factoextra".
>I run each step very carefully but the problem remains...It doesn't
>make sense because I have installed factoextra.
>
>This warning appears:
>could not find function "fviz_nbclust"
>
>On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller
><[hidden email]> wrote:
>>
>> Concept 1: You don't install functions... you install packages that
>have functions in them. There is a function fviz_nbclust in factoextra.
>>
>> Concept 2: Once a package is installed, you do NOT have to install it
>again, e.g. every time you want to do that analysis. Making the
>installation part of your script is not advised.
>>
>> Concept 3: Typically we do use the library function with a package
>name at the beginning of every session where we want to use functions
>from that package. However, that is optional... you could also just
>invoke the function directly using
>factoextra::fviz_nbclust(...blahblah...). Having the library function
>shortens this and if the package is not installed it provides a clear
>error message that can be a reminder to the user to install the
>package.
>>
>> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.
>>
>> On January 16, 2019 11:00:07 AM PST, N Meriam <[hidden email]>
>wrote:
>> >Hello,
>> >I'm struggling to install a function called "fviz_nbclus".
>> >
>> >My code is the following:
>> >pkgs <- c("factoextra",  "NbClust")
>> >install.packages(pkgs)
>> >library(factoextra)
>> >library(NbClust)
>> ># Standardize the data
>> >load("df4.rda")
>> >library(FunCluster)
>> >
>> >install.packages("fviz_nbclust")
>> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>> >"gap_stat"))
>> >
>> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>> >(as ‘lib’ is unspecified)
>> >Warning in install.packages :
>> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>> >
>> >Best,
>> >Meriam
>> >
>> >______________________________________________
>> >[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> >https://stat.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide
>> >http://www.R-project.org/posting-guide.html
>> >and provide commented, minimal, self-contained, reproducible code.
>>
>> --
>> Sent from my phone. Please excuse my brevity.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.