Package 'shinyMons'

Title: Shiny App of The Famous 151 First Pokemons
Description: Discover everything you want to know about your favorites pokemon. Data are taken from the awesome API <https://pokeapi.co>.
Authors: David Granjon [aut, cre], RinteRface [cph]
Maintainer: David Granjon <[email protected]>
License: GPL-2
Version: 0.2.0
Built: 2026-05-28 07:48:30 UTC
Source: https://github.com/DivadNojnarg/shinyMons

Help Index


Function that calculates the damages of an attack on a given opponent

Description

Function that calculates the damages of an attack on a given opponent

Usage

calculate_damages(current_attack, current_pokemon, opponent, types)

Arguments

current_attack

The currently selected attack.

current_pokemon

Id of the randomly generated pokemon who is attacking.

opponent

Opponent type. Useful for effectiveness calculations.

types

Object containing all pokemons types strenght and weaknesses.

Note

As already explained, I only consider physical attacks...


Function that calculate a given stat of a pokemon based on its level.

Description

Function that calculate a given stat of a pokemon based on its level.

Usage

compute_stat(level, base_stat)

Arguments

level

Current pokemon level.

base_stat

Stat to be scaled.

Note

To be used in generate_pokemons.


Function that generates a timelineItem for each attack the pokemon does.

Description

Function that generates a timelineItem for each attack the pokemon does.

Usage

fight_History(attacking, opponent, current_attack, damages)

Arguments

attacking

Id of the randomly generated pokemon who is attacking.

opponent

Opponent type. Useful for effectiveness calculations.

current_attack

The currently selected attack.

damages

Result of calculate_damages witht the current_attack. TRUE in this case.


Function that generate 2 random pokemons. Levels are between 1 and 100 and ids are between 1 and 151

Description

Function that generate 2 random pokemons. Levels are between 1 and 100 and ids are between 1 and 151

Usage

generate_pokemons(mainData, sprites, difficulty, attacks)

Arguments

mainData

Object containing the main pokemon data.

sprites

Object containing pokemon images.

difficulty

Game difficulty.

attacks

Object containing pokemon attacks.


Pokemon attacks data

Description

Aggregated list of pokemon attacks data

Usage

poke_attacks

Format

## 'who' A list with 'r length(poke_attacks)' elements.

Source

<https://pokeapi.co/docs/v2>


Pokemon global data

Description

Aggregated list of pokemon data

Usage

poke_data

Format

## 'who' A list with 'r length(poke_data)' elements:

name

Pokemon name

description

Pokemon description

shape

Pokemon shape

...

Source

<https://pokeapi.co/docs/v2>


UI module for generating the pokemon evolution timeline

Description

UI module for generating the pokemon evolution timeline

Server module generating the pokemon evolution timeline

Usage

poke_evol_ui(id)

poke_evol_server(id, selected, shiny)

Arguments

id

character used to specify namespace, see shiny::NS

selected

Input containing the selected pokemon index.

shiny

Whether to display a shiny version. FALSE by default.

Value

a shiny::tagList containing UI elements


Server module generating the pokemon info cards

Description

Server module generating the pokemon info cards

Usage

poke_infos_server(id, selected, shiny)

Arguments

id

Module id.

selected

Input containing the selected pokemon index.

shiny

Whether to display a shiny version. FALSE by default.


UI module for generating the pokemon info cards

Description

UI module for generating the pokemon info cards

Usage

poke_infos_ui(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


UI module for generating the pokemon location card

Description

UI module for generating the pokemon location card

Server module generating the pokemon location card

Usage

poke_locations_ui(id)

poke_locations_server(id, selected)

Arguments

id

character used to specify namespace, see shiny::NS

selected

Input containing the selected pokemon index.

Value

a shiny::tagList containing UI elements


UI module for sorting pokemon

Description

UI module for sorting pokemon

Server module generating the pokemon interface

Usage

poke_moves_ui(id)

poke_moves_server(id, selected)

Arguments

id

character used to specify namespace, see shiny::NS

selected

Input containing the selected pokemon index.

Value

a shiny::tagList containing UI elements


Pokemon network data

Description

Useful data to reconstruct with visNetwork htmlWidget.

Usage

poke_network

Format

## 'who' A list with nodes and edges dataframes. For the node dataframe:

id

Pokemon id

label

Pokemon name

group

Pokemon family

image

Pokemon sprite

shape

Node shape

value

Node value

For edges:

from

Pokemon previous stage

to

Pokemon next stage

title

Evolution detail

arrow

Direction of arrows

Source

<https://pokeapi.co/docs/v2#evolution-section>


Server module generating the pokemon interface

Description

Server module generating the pokemon interface

Usage

poke_select_server(id, selected)

Arguments

id

Module id.

selected

Object containing the selected pokemon in the network, if not NULL.


UI module for sorting pokemon

Description

UI module for sorting pokemon

Usage

poke_select_ui(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Server module generating the pokemon stats chart

Description

Server module generating the pokemon stats chart

Usage

poke_stats_server(id, selected)

Arguments

id

Module id.

selected

Input containing the selected pokemon index.


UI module for generating the pokemon stats chart

Description

UI module for generating the pokemon stats chart

Usage

poke_stats_ui(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


UI module for generating the pokemon type

Description

UI module for generating the pokemon type

Server module generating the pokemon types info boxes

Usage

poke_types_ui(id)

poke_types_server(id, selected)

Arguments

id

character used to specify namespace, see shiny::NS

selected

Input containing the selected pokemon index.

Value

a shiny::tagList containing UI elements


Server module for generating the pokeAttacks section

Description

Server module for generating the pokeAttacks section

Usage

pokeAttack(input, output, session, attacks)

Arguments

input

Shiny inputs.

output

Shiny outputs.

session

Shiny session.

attacks

Data containing all pokemon abilities in the first generation.


UI module for generating the pokeAttacks section

Description

UI module for generating the pokeAttacks section

Usage

pokeAttackUi(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Server module for generating the pokeFight section

Description

Server module for generating the pokeFight section

Usage

pokeFight(input, output, session, mainData, sprites, attacks, types)

Arguments

input

Shiny inputs.

output

Shiny outputs.

session

Shiny session.

mainData

Object containing the main pokemon data.

sprites

Object containing pokemon images.

attacks

Object containing pokemon attacks.

types

Object containing all pokemon types.


UI module for generating the pokeFight section

Description

UI module for generating the pokeFight section

Usage

pokeFightUi(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Server module generating the pokemon gallery interface

Description

Server module generating the pokemon gallery interface

Usage

pokeGallery(input, output, session, mainData, details, shiny)

Arguments

input

Shiny inputs.

output

Shiny outputs.

session

Shiny session.

mainData

Object containing the main pokemon data.

details

Object containing extra pokemon details.

shiny

Whether to display a shiny version. FALSE by default.


UI module for generating the gallery of the first 151 pokemons

Description

UI module for generating the gallery of the first 151 pokemons

Usage

pokeGalleryUi(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Server module for generating the pokeNetwork section

Description

Server module for generating the pokeNetwork section

Usage

pokeNetwork(
  input,
  output,
  session,
  mainData,
  details,
  families,
  groups,
  mobile
)

Arguments

input

Shiny inputs.

output

Shiny outputs.

session

Shiny session.

mainData

All pokemon main data.

details

Object containing extra pokemon details.

families

List containg all pokemon connections.

groups

List containing data for grouping pokemons by evolution family.

mobile

Shiny input checking if the app is running on a cellphone/tablet.


UI module for generating the pokeNetwork section

Description

UI module for generating the pokeNetwork section

Usage

pokeNetworkUi(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Server module generating other stats chart

Description

Server module generating other stats chart

Usage

pokeOther(input, output, session, mainData, details)

Arguments

input

Shiny inputs.

output

Shiny outputs.

session

Shiny session.

mainData

Object containing the main pokemon data.

details

Object containing extra pokemon details.


UI module for generating other stats chart

Description

UI module for generating other stats chart

Usage

pokeOtherUi(id)

Arguments

id

character used to specify namespace, see shiny::NS

Value

a shiny::tagList containing UI elements


Launch the pokemon app

Description

Unleash the pokemon app

Usage

run_pokemons()

Examples

if (interactive()) {
  run_pokemon()
}

Function that list all possible learnable moves for a pokemon and select only 4 moves.

Description

Function that list all possible learnable moves for a pokemon and select only 4 moves.

Usage

select_attacks(mainData, attacks, current_pokemon_id)

Arguments

mainData

Object containing the main pokemon data.

attacks

Object containing all pokemon attacks data.

current_pokemon_id

Id of the randomly generated pokemon.

Note

Limitations: only physical moves are considered for the moment. This function has to be called inside generate_pokemons.


shinyMons

Description

Discover everything you want to know about your favorites pokemon. Data are taken from the awesome API https://pokeapi.co.

Author(s)

Maintainer: David Granjon [email protected]

Other contributors:

  • RinteRface [copyright holder]

See Also

Useful links: