Skip to content

Instantly share code, notes, and snippets.

View arsilva87's full-sized avatar
💭
Always in beta

Anderson R da Silva arsilva87

💭
Always in beta
  • Goiano Federal Institute
  • Urutaí, Brazil
View GitHub Profile
@arsilva87
arsilva87 / app.r
Last active June 22, 2023 18:44
A shiny to predict nitrogen in rice plants using spectral data
library(shiny)
library(terra)
library(mgcv)
# load the trained model
# GAM, predictor: ni ( r425/(r655+r965) )
# R2 = 0.79
model_gam <- readRDS(url("https://raw.githubusercontent.com/arsilva87/misc/main/gam_model_ntotal.rds"))
# set the max file size to 200 MB
install.packages(c('rgdal', 'sp', 'raster', 'mapview', 'spdep', 'gstat'))
@arsilva87
arsilva87 / app.r
Last active March 9, 2022 16:05
Shiny app for testing the package hydropaper online
library(shiny)
library(EBImage)
# ----------------------------------------
load(url("https://raw.githubusercontent.com/arsilva87/misc/main/model_nnet.rda"))
ANALYZEPAPER <- function(x,
paper_dim = c(76, 26), distance = 0.7,
display.it = FALSE, align.x = FALSE)
{
@arsilva87
arsilva87 / app.r
Last active December 21, 2021 14:23
Simula PQ-Agro
library(shiny)
library(shinydashboard)
library(MASS)
model <- readRDS(url("https://github.com/arsilva87/misc/raw/main/model_PQ.rds"), "rb")
# UI
about <- mainPanel(
helpText("Este é apenas um SIMULADOR do resultado de julgamento de propostas
@arsilva87
arsilva87 / install.R
Last active March 8, 2023 13:41
Script nonparametric comparisons of groups
install.packages(c("PMCMRplus", "dunn.test", "agricolae", "readxl", "ExpDes"))
@arsilva87
arsilva87 / app.r
Last active February 19, 2022 12:09
WRC_App
library(rhandsontable)
library(shiny)
library(shinydashboard)
# -------------------------------------------------------------------
# automatically find the best fit WRC using maximum likelihood
findWRC = function(w, h,
mod2fit = c(TRUE, TRUE, TRUE, TRUE, TRUE))
{
y = w; x = h
@arsilva87
arsilva87 / install.R
Last active December 8, 2021 16:34
quiz_nonpar
install.packages(c("learnr", "rmarkdown"))
# Script R para simular distâncias sistemáticas entre pontos amostrais em grid espacial misto
dists <- c(5, 10, 20, 40) # metros
props <- c(0.2, 0.2, 0.3, 0.3)
npts <- 90
pts <- npts * props
x <- rep(dists, times = pts)
table(x)/npts
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.