Tag: c

57 votes
8 answers
526 views
Cluster analysis in R: determine the optimal number of clusters

Being a newbie in R, I'm not very sure how to choose the best number of clusters to do a k-means analysis

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
61 votes
13 answers
908 views
How to find out which package version is loaded in R?

I am in a process of figuring out how to use my university cluster. It has 2 versions of R installed. System w

avatar
Tuan
0 1 0 9
asked 07 September, 2021
63 votes
7 answers
2.7K views
Run R script from command line

I have a file, called a.r, it has a chmod of 755, sayHello <- function(){ print('hello') } s

avatar
Keith
0 1 0 9
asked 07 September, 2021
59 votes
7 answers
2.1K views
Test if a vector contains a given element

How to check if a vector contains a given value?

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
46 votes
15 answers
710 views
Drop unused factor levels in a subsetted data frame

I have a data frame containing a factor. When I create a subset of this dataframe using subset or another inde

avatar
Omar
0 1 0 9
asked 07 September, 2021
49 votes
12 answers
2.6K views
The difference between bracket [ ] and double bracket [[ ]] for accessing the elements of a list or dataframe

R provides two different methods for accessing the elements of a list or data.frame: [] and [[]]. What is the

avatar
Xavier
0 1 0 9
asked 07 September, 2021
57 votes
12 answers
2.6K views
How to unload a package without restarting R

I'd like to unload a package without having to restart R (mostly because restarting R as I try out differ

avatar
Vi
0 1 0 9
asked 07 September, 2021
57 votes
8 answers
2.2K views
What is the difference between require() and library()?

What is the difference between require() and library()?

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
53 votes
18 answers
825 views
How should I deal with "package &apos;xxx&apos; is not available (for R version x.y.z)" warning?

I tried to install a package, using install.packages("foobarbaz") but received the warning Warning message

avatar
Percy
0 1 0 9
asked 07 September, 2021
44 votes
11 answers
1K views
How can I view the source code for a function?

I want to look at the source code for a function to see how it works. I know I can print a function by typing

avatar
Elicia
0 1 0 9
asked 07 September, 2021
61 votes
11 answers
1.1K views
How to convert a factor to integer umeric without loss of information?

When I convert a factor to a numeric or integer, I get the underlying level codes, not the values as numbers.

avatar
Royal
0 1 0 9
asked 07 September, 2021
51 votes
15 answers
1.8K views
Link and execute external JavaScript file hosted on GitHub

When I try to change the linked reference of a local JavaScript file to a GitHub raw version my test file stop

avatar
Margo
0 1 0 9
asked 07 September, 2021
60 votes
13 answers
2.4K views
Why is a git &apos;pull request&apos; not called a &apos;push request&apos;?

The terminology used to merge a branch with an official repository is a 'pull request'. This is conf

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
58 votes
4 answers
406 views
How can I reference a commit in an issue comment on GitHub?

I find a lot of answers on how to reference a GitHub issue in a git comment (using the #xxx notation). I'

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
51 votes
16 answers
2.4K views
Can you get the number of lines of code from a GitHub repository?

In a GitHub repository you can see “language statistics”, which displays the percentage of the project tha

avatar
Stacia
0 1 0 9
asked 07 September, 2021
58 votes
5 answers
1.3K views
How to update a pull request from forked repo?

So I first forked a repo and then made a commit to that forked repo. I then opened a pull request. The pull re

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
52 votes
5 answers
3.1K views
When does Git refresh the list of remote branches?

Using git branch --all shows all remote and local branches. When does Git refresh this list? On pull/push? An

avatar
Solomon
0 1 0 9
asked 07 September, 2021
55 votes
12 answers
844 views
How to git-cherry-pick only changes to certain files?

If I want to merge into a Git branch the changes made only to some of the files changed in a particular commit

avatar
Kisha
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.9K views
Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
53 votes
12 answers
1.5K views
Git pull a certain branch from GitHub

I have a project with multiple branches. I've been pushing them to GitHub, and now that someone else is w

avatar
Carmelina
0 1 0 9
asked 07 September, 2021