Package 'suryulib'

Title: Shinya Uryu's Personal R Packages
Description: More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description.
Authors: Shinya Uryu [aut, cre]
Maintainer: Shinya Uryu <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-30 05:19:19 UTC
Source: https://github.com/uribo/suryulib

Help Index


Get the latest since_id of tweets for a query in a file

Description

Get the latest since_id of tweets for a query in a file

Usage

detect_tweet_latest_since_id(dir, query)

Arguments

dir

A character string indicating the directory path where tweet data is stored.

query

A character string indicating the query used to search for tweets.

Value

A tibble with two columns, "since_id" and "file". "since_id" column contains the latest since_id for the query, and "file" column contains the name of the file that contains the tweet data.

Examples

## Not run: 
detect_tweet_latest_since_id("data-raw", "rstats")

## End(Not run)

Request to openBD API

Description

Request to openBD API

Usage

get_openbd(isbn)

Arguments

isbn

isbn code

Examples

## Not run: 
get_openbd("9784478108536")

## End(Not run)

html showing the reading of the word

Description

html showing the reading of the word

Usage

html_yomi(x, yomi, style = "space")

Arguments

x

word

yomi

character

style

style for yomi text

Examples

html_yomi("CRAN", "The Comprehensive R Archive Network", "parenthesis")

Japanese font

Description

Japanese font

Usage

jpfont()

Ruby in html

Description

Ruby in html

Usage

kanji_ruby(x, view = FALSE)

Arguments

x

word

view

View html output in the viewer

Examples

kanji_ruby("\u8af8\u884c\u7121\u5e38")

Line Notification

Description

Line Notification

Usage

line_notify(token, message, img_file = NULL, .disabled = FALSE)

Arguments

token

Personal access token

message

text

img_file

path to upload image file

.disabled

option


Color scale for data science plot

Description

Color scale for data science plot

Usage

scale_color_ds(
  palette = "main",
  discrete = TRUE,
  reverse = FALSE,
  na.value = "gray60",
  ...
)

scale_fill_ds(
  palette = "main",
  discrete = TRUE,
  reverse = FALSE,
  na.value = "gray60",
  ...
)

Arguments

palette

main

discrete

discrete variables

reverse

color order

na.value

na color

...

path to other functions


Tidy summary for data.frame

Description

Alternative broom::tidy() for data.frame.

Usage

summary_df(data, .trim = NULL, na.rm = TRUE)

Arguments

data

data.frame

.trim

Option.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.


Theme of data science for dark mode

Description

Theme of data science for dark mode

Usage

theme_ds_dark(base_size = 11, ...)

Arguments

base_size

base font size

...

Other arguments passed to [theme_light][ggplot2::theme_light]


Search recent tweets and save to RDS

Description

Search recent tweets and save to RDS

Usage

write_search_tweets_rds(dir, query, since_id, ...)

Arguments

dir

A character string indicating the directory path where tweet data is stored.

query

A character string indicating the query used to search for tweets.

since_id

A character string. This argument is used to retrieve only tweets that have been posted after a specific tweet. If 'since_id' is 'NA', it is set to 'NULL'.

...

Additional arguments to be passed to the 'write_search_tweets_rds' function.

Examples

## Not run: 
write_search_tweets_rds("data-raw", "rstats", since_id = "1621390633146667008")

## End(Not run)

Write twitter query status to CSV

Description

This function retrieves the latest 'since_id' for each query and writes the results to a CSV file.

Usage

write_twitter_query_status(dir, query)

Arguments

dir

A character string indicating the directory path where tweet data is stored.

query

A character string indicating the query used to search for tweets.

Examples

## Not run: 
write_twitter_query_status("data-raw", c("#rstats", "#datascience"))

## End(Not run)