Tag: io

57 votes
13 answers
1.9K views
Side-by-side plots with ggplot2

I would like to place two plots side by side using the ggplot2 package, i.e. do the equivalent of par(mfrow=c(

avatar
Omar
0 1 0 9
asked 07 September, 2021
53 votes
13 answers
1.7K views
Write lines of text to a file in R

In the R scripting language, how do I write lines of text, e.g. the following two lines Hello World to a fi

avatar
Santiago
0 1 0 9
asked 07 September, 2021
54 votes
12 answers
1.9K views
How can two strings be concatenated?

How can I concatenate (merge, combine) two values? For example I have: tmp = cbind("GAD", "AB") tmp # [,

avatar
Alphonso
0 1 0 9
asked 07 September, 2021
61 votes
6 answers
1.9K views
How do I install an R package from source?

A friend sent me along this great tutorial on webscraping NYtimes with R. I would really love to try it. Howev

avatar
Louetta
0 1 0 9
asked 07 September, 2021
52 votes
5 answers
2.7K views
How to write trycatch in R

I want to write trycatch code to deal with error in downloading from the web. url <- c( "http://stat.e

avatar
Brianne
0 1 0 9
asked 07 September, 2021
61 votes
13 answers
903 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
53 votes
18 answers
821 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
25 answers
2.7K views
How do I replace NA values with zeros in an R dataframe?

I have a data frame and some columns have NA values. How do I replace these NA values with zeroes?

avatar
Alba
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
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
60 votes
30 answers
2.2K views
Download single files from GitHub

I guess most of you, developers, use any VCS, and I hope some of you use Git. Do you have any tip or trick how

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
948 views
Git push results in "Authentication Failed"

I have been using Github for a little while and I have been fine with git add, git commit, and git push so far

avatar
Royal
0 1 0 9
asked 07 September, 2021
47 votes
30 answers
2.7K views
How can I delete all Git branches which have been merged?

I have many Git branches. How do I delete branches which have already been merged? Is there an easy way to del

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
52 votes
15 answers
1.5K views
How do I see what character set a MySQL database / table / column is?

What is the (default) charset for: MySQL database MySQL table MySQL column

avatar
Keith
0 1 0 9
asked 07 September, 2021
58 votes
4 answers
2.5K views
SQL injection that gets around mysql_real_escape_string()

Is there an SQL injection possibility even when using mysql_real_escape_string() function? Consider this samp

avatar
Don
0 1 0 9
asked 07 September, 2021
58 votes
11 answers
1.8K views
How can I find all the tables in MySQL with specific column names in them?

I have 2-3 different column names that I want to look up in the entire database and list out all tables which

avatar
Yolando
0 1 0 9
asked 07 September, 2021
55 votes
8 answers
2.4K views
What&apos;s the difference between utf8_general_ci and utf8_unicode_ci?

Between utf8_general_ci and utf8_unicode_ci, are there any differences in terms of performance?

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
60 votes
17 answers
3.1K views
open() in Python does not create a file if it doesn&apos;t exist

What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it

avatar
Benton
0 1 0 9
asked 07 September, 2021
56 votes
9 answers
2K views
Redirect all output to file in Bash

I know that in Linux, to redirect output from the screen to a file, I can either use the > or tee. How

avatar
Cortez
0 1 0 9
asked 07 September, 2021