Giter Site home page Giter Site logo

schmidtpaul / dsfair Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 4.0 26.51 MB

archived: Data Science for Agriculture in R; has been succeeded by https://schmidtpaul.github.io/dsfair_quarto/

Home Page: https://schmidtpaul.github.io/DSFAIR/

R 5.74% HTML 90.19% JavaScript 3.20% CSS 0.87%

dsfair's Introduction

DSFAIR - Data Science for Agriculture in R

πŸ“ŠπŸŒ± DSFAIR - Data Science for Agriculture in R provides a cookbook with statistical analyses of typical examples in life sciences (focus on agriculture/biology). It can be seen as the smaller brother of πŸ“ˆπŸŒ± MMFAIR - Mixed Models for Agriculture in R, because it deals with more basic analyses.

Where possible, I try to use example data/analyses that have been published in university lecture notes or peer-reviewed journals.

Note that πŸ“‰πŸŒ± R fΓΌr Bio- und Agrarwissenschaftler is the German predecessor of this website.

dsfair's People

Contributors

schmidtpaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dsfair's Issues

Github Site Content To Do List

It would be nice to have these things in the future:

Chapters

Add complete chapters on this

  • simple linear regression πŸ“‘ ❓
  • correlation πŸ“‘ ❓
  • outliers πŸ“‘ ❓
  • how to prepare for online courses
    • install R & RStudio
    • update R & RStudio
    • download & unzip data/resource folder
  • how to reprex/stackoverflow πŸ“‘ ❓
  • how to export πŸ“‘ ❓
    • broom/broom.mixed
    • openxlsx quick/proper
    • format p-values
    • ggsave/gg_export
  • polynomial regression πŸ“‘ ❓
  • actually helpful covariates πŸ“‘ ❓
  • better example for subsampling - maybe pigs?
  • discussion on p-values and significance (german version)
  • discussion on t-test, Tukey-test (german version)
  • discussion on interactions (german version)
  • discussion on model diagnostics/residuals, transformations and generalized models (german version)
  • discussion on random effects, mixed models and covariance structures (german version, also this and this)
  • discussion on adjusted means cite this
  • discussion on contrasts between (adjusted) means cite this
  • discussion on compact letter display
  • discussion on Coefficient of Variance (CV)
  • Rmarkdown
    • useful links for the first time setup for PDF and Word
    • useful links for using it
  • Github
    • useful links to packages etc.
    • useful links to getting started with git in R

Examples

Add DIY examples at the end of every chapter

  • check which ones are missing
  • check if the purl-generated solutions are fine
  • better example for 1f RCBD (not density as pseudo factor)

Other

  • consistency for loaded packages across chapters
  • most often used ggplot tips
  • ggplot captions using ggtext
  • replace _at & _if with across()

emmeans S4 object issue

Copy pasted this from an email:

Thanks for developing the test examples using DSFAIR! I ran the code you made available on https://schmidtpaul.github.io/DSFAIR/augmented_Pattersen1994.html However, i found several challenges in getting it to work with recent R version (3.6.3 and above) when it comes to use the β€œemmeans” function, specifically this section

mean_comparisons <- mod.fb %>%
  emmeans(pairwise ~ "gen",
          adjust = "tukey") %>%
  pluck("emmeans") %>%
  cld(details = TRUE, Letters = letters) # add letter display

# If cld() does not work, try CLD() instead.
# Add 'adjust="none"' to the emmeans() and cld() statement
# in order to obtain t-test instead of Tukey!

mean_comparisons$emmeans # adjusted genotype means

For unclear reason the provided code work just fine with some older R distributions (3.6) but with most recent ones it would throw a S4 class error (it is an emmGrid object) when running: mean_comparisons$emmeans, such as:

#> mean_comparisons$emmeans # adjusted genotype means
#> Error in mean_comparisons$emmeans : 
#>   $ operator not defined for this S4 class

I could get around problem converting the object using getSlot function but which return different data structure from β€œmean_comparisons”. Wondered if you are aware of such issue and if you could suggest a more elegant way to get around? I am running R on a mac, using Rswitch which includes R version 3.6, 3.6.3, 4.0.2

If I decide to drop those markers that are present in less than 2% of lines, or equivalently those that are present in 98% of lines, because they behave almost as constants. How do we do that?

Hello sir
I am facing an issue in multivariant to remove the 2% of the markers from lines...
here is my initial code.

LDA

clean start

rm(list=ls())

installing and loading specialized libraries

library(lattice)
tryCatch({library(ggplot2)}, error = function(e) {install.packages("ggplot2")},finaly = library(ggplot2))
tryCatch({library(MASS)}, error = function(e) {install.packages("MASS")},finaly = library(MASS))
tryCatch({library(caret)}, error = function(e) {install.packages("caret")},finaly = library(caret))
#tryCatch({library(tidyverse)}, error = function(e) {install.packages("tidyverse")},finaly = library(tidyverse))

#library(gmodels)

Are you in the appropriate working directory?

getwd()

were are the test data

dir("Data/")

#reading data
Data=read.table("SunFlowerGenotypes.txt",header = T,sep="\t")

#showing header of data
head(Data)
colnames(Data)

#List of proportions line have
sapply(Data[,-1],mean)

#Eleminate the 2% of lines from markers
sapply(Data[,-1],mean)<0.02

I need help in to remove the 2% of markers from lines.
Here is the data
SunFlowerGenotypes.txt
I will be happy if you help me to figure out the code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.