- Nov 2024
-
en.wikipedia.org en.wikipedia.org
-
13 counties 3 cities 6 special municipalities
Special municipalities Counties Cities Kaohsiung City New Taipei City Taichung City Tainan City Taipei City Taoyuan City Changhua County Chiayi County Hsinchu County Hualien County Miaoli County Nantou County Pingtung County Taitung County Yilan County Yunlin County Chiayi City Hsinchu City Keelung City
-
-
-
The pattern
"台北市立第一女子高級中學" <br /> "北一女" <br /> "北一女中" <br /> "北一女高"
"台北市立松山高級中學" <br /> "新北市立一級棒女子高級中學" "新北一女" <br /> "一級棒女中"
-
Extract the string from string_df$taiwan_address that fits the following pattern: it has three to five traditional Chinese characters of which the ending character is one of "鄉", "鎮", "區", or "里".
從
string_df$taiwan_address
提取符合以下模式的字串: 包含2到5個繁體中文,且結尾的字(包含在2到5之間)為「鄉」、「鎮」、「區」或「里」其中的一個。原AI答案 ``` library(stringr)
提取符合模式的字串
extracted_strings <- str_extract(string_df$taiwan_address, "[\u4e00-\u9fa5]{2,5}(鄉|鎮|區|里)$") ``` 改成
``` library(stringr)
提取符合模式的字串
extracted_strings <- str_extract(string_df$taiwan_address, "[\u4e00-\u9fa5]{1,4}(鄉|鎮|區|里)") ```
-
three
error:
should be two
-
"(台|臺)中市"
如果寫成
"台|臺中市"
是指: 單單"台",或 "臺中市"
-
-
github.com github.com
-
as.character
if you use
lubridate
's parsing function, you don't have to worry about it. But if you use R's basicas.Date
parsing function, you need to make sure the source is a character. -
yyyymmdd
original date like 20210321.
For others, such as "2021-03-21", you can say it is in "yyyy-mm-dd" format.
-
select(1:4)
select the first four variables
-
- Oct 2024
-
academy.datawrapper.de academy.datawrapper.de
-
Consider the color grey as the most important color in Data Vis.
-
-
github.com github.com
-
Date
yyyy 西元年寫法 mm 月 dd 日 q季
-
-
-
levels
類別資料的類別
-
%>%
將被 |> 取代。
-
-
github.com github.com
-
aes(x = Year, y = Counts, color = `細分`))
mapping 資料 成為 美學的表現
其中
color
為"線"的顏色,若geometry有填色可能的話,填色的美學為fill
. -
Bar Chart
geom_bar
-
Column Chart
geom_col
-
Area Chart
geom_area
-
labs
labs = labels<br /> 經濟學人習慣會有
subtitle = "..." 用來說明Y軸的單位,
caption = "..." 用來說明資料的出處。
-
-
-
%>%
ChatGPT's commonly choice
-
-
-
Annotate
my note
-
- Oct 2023
-
docs.midjourney.com docs.midjourney.com
-
2. Subscribe to a Midjourney Plan
-
-
tpemartin.github.io tpemartin.github.io
-
Common naming styles:
-
A regular valid name starts with:
-
-
tpemartin.github.io tpemartin.github.io
-
One advantage of teaching R to understand your data collection as a data frame is that you have one more retrieval operator to use [.row, .col]
-
- Jun 2023
-
books.ropensci.org books.ropensci.org
-
tar_target(file, "data.csv", format = "file"),
Don't start with
tar_target(data, get_data("data.csv"))
- change of
data.csv
won't trigger rerun, because "data.csv" is not hashed.
- change of
-
- May 2023
-
24h.pchome.com.tw 24h.pchome.com.tw
-
《真心良品x樹德》典雅貨櫃屋組裝收納箱2入組
2 stars
-
- Mar 2023
-
www.economist.com www.economist.com
-
plunged, too. Credit Suisse, which faces other woes, saw its stock fall by 24% on March 15th and on March 16th it sought liquidity support from the Swiss ce
test
-
- Sep 2022
-
tpemartin.github.io tpemartin.github.io
-
Aesthetics?
fill stroke
-
Geometries?
Point
-
-
tpemartin.github.io tpemartin.github.io
-
the entire car parts other than its dashboard.
my note
-
- Mar 2022
-
tpemartin.github.io tpemartin.github.io
-
concatenate
put values consecutively on top of each other
-
of the same type.
Atomic vector
-
- May 2020
-
bookdown.org bookdown.org
-
# 先將類別資料設定成可排序類別資料 list_victimAges_female$年齡層 <- ordered(list_victimAges_female$年齡層)
[05-02] 新增
-
- Aug 2019
-
www.economist.com www.economist.com
-
Another problem is that any law can require Mr Johnson only to ask for an extension. He might do so on terms that allow him to refuse any offer from the EU, though Brussels is keen to avoid any blame for a no-deal Brexit.
-
Even if a similar bill passes the Commons in a single day, as then, it is hard to break a filibuster in the Lords, where the timetable for debate is less easily curtailed.
-
The plan is to ask Mr Bercow for an emergency debate under standing order 24 and use this to follow the precedent of the Cooper-Letwin bill that was passed in March. Back then, MPs took control of the Commons agenda for a day to bring in this bill, which required the prime minister to request an extension of the original Brexit deadline of March 29th.
-
Many concede that no-deal Brexiteers are better organised and more ruthless than their opponents.
-
Any talks would be on a different legal basis from Article 50, which governs the current negotiations, requiring a fresh negotiating mandate, the unanimous approval of EU governments and ratification by national and regional parliaments.
-
Manufacturers fret about the effect on just-in-time supply chains of tariffs and non-tariff barriers. Farmers and fishers are worried about duties on sheep, beef and fish exports. Service businesses and the NHS talk of recruitment problems.
-
The government’s leaked “Operation Yellowhammer” analysis talks of possible shortages of fresh food, medicine and petrol, disruption to ports and the risk of civil unrest, especially in Northern Ireland
-
-
pandas.pydata.org pandas.pydata.org
-
The correct way to swap column values is by using raw values:
把右側改成非data frame即不會產生index alignment作用
-
df.loc[:, ['B', 'A']] = df[['A', 'B']]
.loc
會以axis 2先進行=兩側的index alignment之後才做value assignment
-
-
www.economist.com www.economist.com
-
July 31st Mr Powell announced America’s first interest-rate cut in over a decade,
-
there are limits to how much the Fed can depart from the global trend before it starts causing problems in capital markets.
-
A strengthening dollar, wobbling equity markets or tightening credit conditions could then bounce the Fed into a further burst of loosening.
-
The Trump administration’s trade policy, not the cost of capital, is holding businesses back, she thinks.
-
A further cut would not be universally welcome.
-
Finally, as Mr Powell emphasised on July 31st, inflation is uncomfortably weak. On a measure that excludes volatile food and energy prices, it sagged to 1.6% in June, well below the Fed’s 2% target.
-
But businesses do not appear to share consumers’ confidence.
-
On July 22nd politicians agreed on a deal to raise America’s debt limit, and to avoid steep spending cuts.
-
After dipping a little, earlier in the year, consumer confidence is almost back to its post-recovery peak.
-
The move was widely expected, though not universally understood.
-
- Jul 2019
-
www.economist.com www.economist.com
-
the world needs to create a system of laws to govern the heavens—both in peacetime and, should it come to that, in war.
-
-
-
據家總設計的「長期照顧安排假」,每位勞工在失能、失智家人核定列入長期照顧人口的期間,最長可申請180天,前30日給予處理最忙亂的照顧安排,並由就業保險來補助六成的投保薪資,比照「育嬰留職停薪津貼」的作法,至少在前30日給付「長期照顧安排留職停薪津貼」;其餘150日為彈性請假,允許半天或一天的彈性請假,以因應臨時性的照顧。
-
-
bookdown.org bookdown.org
-
By Product
if your header is in other non-western language, you need to set id tag. For example:
第二節
should be
第二節{#section2}
This is because tab's hyperlink can not take Chinese characters, you have to specify its non-Chinese link name yourself.
-
-
rich-iannone.github.io rich-iannone.github.io
-
For the edge operations, a directed graph must specify an edge using the edge operator -> while an undirected graph must use the -- operator.
-
The graph statement (graph_stmt), the node statement (node_stmt), and the edge statement (edge_stmt) are the three most commonly used statements
-
strict. This forbids the creation of multi-edges (i.e., there can be at most one edge with a given tail node and head node in the directed case).
-
a directed graph (digraph) or an undirected graph (graph)
-
-
www.economist.com www.economist.com
-
A trade truce ought to cool the war of words over exchange rates, too—but not for long. Interest rates are low. The use of fiscal policy is constrained by either politics or debt burdens. A cheaper currency is one of the few ways left to gin up an economy. A world of sluggish GDP growth is one that is primed for a currency war.
-
- Jun 2019
-
www.economist.com www.economist.com
-
The Tory selectocrats who will choose Britain’s next prime minister would, polling suggests, prefer a no-deal Brexit over staying in the EU by three to one; the electorate as a whole swings three to two the other way.
-
The Brexit referendum weakened the parties; the parties, for their part, have weakened Parliament.
-
on the back of the Fixed-term Parliaments Act of 2011. Before this a prime minister whose flagship legislation was voted down—just once, never mind repeatedly—would have been expected to call an election. If he or she had not, a vote of confidence would have followed which a minority government would have been near certain to lose.
-
The decision to resort to a referendum that produced a result capable of many interpretations cannot take the whole blame for the current chaos.
-
Parliament could thus do what it wanted, including overturning what previous parliaments had thought good. This vision offered little scope for referendums.
-
Mr Blair’s government also used Europe to provide constitutional protections. Should Britain leave the EU, the Charter of Fundamental Rights, which allows judges to poke their noses into any legislation that touches EU competencies, will no longer apply. Thus Britain is shifting back from a protected constitution, in which rights are guaranteed by a judiciary, to an unprotected one where they are at the mercy of Parliament
-
Attempts to leave the EU show up constitutional shortcomings in part because membership helped to hide them.
-
Mr Blair and Mr Cameron, by contrast, came to power when history was said to have come to an end. They saw no need to take particular care of the constitution. The constitution was just another archaic part of public life to modernise according to the dehistoricised dictates of the age—or to mess with for short-term advantage.
-
In the 19th century Britons watched countries such as France and the United States tear themselves apart. In the first part of the 20th century, they saw the rise of totalitarianism. They recognised that the delicate British constitution had to be taken seriously
-
- May 2019
-
tpemartin.github.io tpemartin.github.io
-
ymd_hms(allCommitDates) -> allCommitDates with_tz(allCommitDates, tzone="Asia/Taipei") -> allCommitDatesTW
常看見另一種寫法,在這題的allCommitDates字串寫法下兩種寫法都會對,但一換寫法,只有老師這裡的答案會保持正確。
同學的另一種"視狀況才會對"的作法(不建議的作法)是:
ymd_hms(allCommitDates,tz="Asia/Taipei) -> allCommitDatesTW
同學試試看, 以下兩個相同UTC時間,只有老師的參考答案會永遠給出正確答案:
allCommitDates1 <- "2019-04-17T16:38:56Z" allCommitDates2 <- "2019-04-17T16:38:56"
結論是: ymd_hms裡的tz指的是你給它的字串是來自什麼時區。 with_tz裡的tzone指的是你要它顯示出什麼時區時間。
ymd_hms裡的input字串本身若帶有"時間字串來自時區(如Z表示UTC時區)"訊息時以字串時區為主; 若與tz設定有衝突(即同學的第二種寫法),以字串時區為主,tz設定功能變成轉換顯示時區用。
-