-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0600_usefulthings.Rmd
More file actions
216 lines (104 loc) · 5.57 KB
/
0600_usefulthings.Rmd
File metadata and controls
216 lines (104 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# (PART) Useful Things {-}
```{r include = FALSE}
source("common.R")
# install.packages("devtools")
if (!require("tweetrmd")) devtools::install_github("gadenbuie/tweetrmd")
library(tweetrmd) #... embedding tweets
```
```{r links, child="content/links.md"}
```
# Software
This wikipage contains the collective lab knowledge about software and coding. Sections are kind of organized logically.
## R & Rstudio
There are tons more stuff about R in my [Data Science for Psychologists class.](https://datascience4psych.github.io/DataScience4Psych/)
### Base R
### R studio
### R Code
This subsection contains R code that I have googled more than once.
#### How do I export a dataframe?
Description: export a dataframe to specific data type?
Source: [Quick-R](https://www.statmethods.net/input/exportingdata.html)
- dat
> write.table(mydata, "mydata.dat", sep="\t")
- csv
> write.csv(mydata,"mydata.csv", row.names = FALSE)
#### How do I merge a list of dataframes?
Description: Merges list of dataframes into a single dataframe
Source: [stackoverflow]( https://stackoverflow.com/questions/2851327/convert-a-list-of-data-frames-into-one-data-frame/38509685)
> bind_rows(list_of_dataframes, .id = "column_label")
Note: .id = "column_label" adds the unique row names based on the list element names
#### How do I produce all combinations of list elements?
Description: produce all combinations of list elements
Source: [rdrr.io](https://rdrr.io/r/base/expand.grid.html)
```{r}
require(utils)
expand.grid(height = seq(60, 80, 5),
weight = seq(100, 300, 50),
type = c("Cat","Dog"))
```
#### How to remove scientific notation?
Description: Stop R from printing tiny decimals as strings
Source: [stackoverflow](https://stackoverflow.com/questions/5352099/how-to-disable-scientific-notation)
```{r}
options(scipen = 999)
```
# Browsers/Internet
## Google
This section contains google-related code that I have googled more than once
### Search Operators
[Source]( https://ahrefs.com/blog/google-advanced-search-operators/)
#### cache
Description: Returns the most recent cached version of a web page
> cache:
#### filetype
Description: Restrict results to those of a certain filetype. e.g., PDF, DOCX, TXT, PPT, etc.
> filetype:
#### site
Description: Limit results to those from a specific website.
> site:
#### related
Description: Find sites related to a given domain.
> related:
#### intitle
Description: Find pages with a certain word (or words) in the title.
> intitle:
#### Proximity
Description: Proximity search. Find pages containing two words or phrases within X words of each other.
> AROUND(X)
## Javascript Bookmarklets
A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser.
(Source: [Wikipedia](https://en.wikipedia.org/wiki/Bookmarklet))
### WFU Related
Description: Redirects you to the WFU proxied version of the website
> javascript:void(location.href="http://go.libproxy.wakehealth.edu/login?url="+location.href)
Source: Mason
### Google Related
#### Switch google accounts
Description: If you have multiple google accounts, you can add "?authuser=1" to switch to your 2nd account.
> javascript:window.location.href=window.location.href+'?authuser=1'
Source: Mason
#### Google Cache
Description: Text-only version of google Cache
> javascript:(function(){var loc=window.location;if (window.location.protocol != "https:"){loc=window.location.toString().replace(/^http:\/\//,'http://webcache.googleusercontent.com/search?q=cache:');}else{loc=window.location.toString().replace(/^https:\/\//,'https://webcache.googleusercontent.com/search?q=cache:');}window.location.replace(loc + '&num=1&strip=1&vwsrc=0')})()
Source: [Online Techtips](https://www.online-tech-tips.com/cool-websites/the-12-best-bookmarklets-every-browser-should-have/)
### Google Translate
Description: Autodetect language and translate into English
> javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text=' t '&hl=en&langpair=auto|en&tbb=1&ie=' e;}else{location.href='http://translate.google.com/translate?u=' escape(location.href) '&hl=en&langpair=auto|en&tbb=1&ie=' e;};
Source: [Online Techtips](https://www.online-tech-tips.com/cool-websites/the-12-best-bookmarklets-every-browser-should-have/)
### Not Otherwise Specified
#### Waybackmachine
Description: "If the webpage you're wanting to read is no longer available, is throwing an error, or the website as a whole has been taken down, you might still have luck finding it on Wayback Machine."
> javascript:location.href='https://web.archive.org/web/*/'+location.href
Source: [Online Techtips](https://www.online-tech-tips.com/cool-websites/the-12-best-bookmarklets-every-browser-should-have/)
## Userscripts
What are user scripts?
User scripts put you in control of your browsing experience. Once installed, they automatically make the sites you visit better by adding features, making them easier to use, or taking out the annoying bits. The user scripts on Greasy Fork were written by other users and posted to share with the world. They're free to install and easy to use.
(Source: [GreasyFork](https://greasyfork.org/en/help/installing-user-scripts))
<!--
# Template
## Name
Description:
> CODE
Note: Additional comments
Source: [URL](https://google.com)
-->