This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
library(tibble) | |
# read table | |
tab <- read.csv("results/calving_period_bn.csv") | |
# this is not necessary but I find it easier to read data.frames as tibbles | |
tab <- tibble::as_tibble(tab) | |
tab <- dplyr::rename(tab, rowid = X) | |
tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File 1: Rmd template | |
--- | |
title: "Untitled" | |
author: "Bernardo, Yves" | |
date: "3/24/2022" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# library(devtools) | |
# devtools::install_github("bniebuhr/landscapemetrics", ref = "multibuffer") | |
# devtools::install_github("bniebuhr/landscapetools", ref = "multibuffer") | |
# packages | |
library(dplyr) | |
library(readxl) | |
library(ggplot2) | |
library(forcats) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# packages | |
library(dplyr) | |
library(landscapemetrics) | |
library(sf) | |
library(terra) | |
# Load data - Latlon, WGS84, | |
forest_1985 <- raster::raster("data/mapbiomas_v06_1985_forest.tif") | |
# CRS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import grass.script as gscript | |
def main(): | |
# Define input: roads maps | |
input = "roadsmajor@PERMANENT" | |
# Set region - 30m res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import modules | |
import grass.script as grass | |
def export_statistics(input_map = ''): | |
''' | |
Function to calculate and export statistics (using r.stats) from landscape metrics maps. | |
Results are given in hectares. | |
Parameters | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TEXT_RESET='\e[0m' | |
TEXT_YELLOW='\e[0;33m' | |
TEXT_RED_B='\e[1;31m' | |
sudo apt-get update | |
echo -e $TEXT_YELLOW | |
echo 'APT update finished...' | |
echo -e $TEXT_RESET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solucao Maumau | |
p = int(input("Digite o primeiro número: ")) | |
s = int(input("Digite o segundo número: ")) | |
m = 0 | |
x = 0 | |
if p < 0 and s < 0: | |
while x < abs(p): | |
m = m + abs(s) | |
x = x + 1 | |
print("A multiplicação utilizando apenas a soma é: %d" % (m)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Classe(): | |
def __init__(self): | |
Classe.var1 = 10 | |
Classe.var2 = 3 | |
def printClasse(self): | |
print 'multiply = ' + str(Classe.var1*Classe.var2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
class Form1(wx.Panel): | |
def __init__(self, parent, id): | |
wx.Panel.__init__(self, parent, id) | |
self.button =wx.Button(self, 10, "MULTIPLICA", wx.Point(20,10)) | |
wx.EVT_BUTTON(self, 10, self.OnClick) | |
self.button =wx.Button(self, 20, "SOMA", wx.Point(20,100)) |