Git Product home page Git Product logo

fgeo.misc's People

Contributors

maurolepore avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

fgeo.misc's Issues

glimpse2

glimpse2 <- function(.data) {
  purrr::imap_dfr(
    .data, 
    ~tibble::tibble(
      name = .y,
      type = typeof(.x),
      unique_head = paste0(as.character(head(unique(.x))), collapse = ", ")
    )
  )
}

print(glimpse2(mtcars),n = 40)
#> # A tibble: 11 x 3
#>    name  type   unique_head                             
#>    <chr> <chr>  <chr>                                   
#>  1 mpg   double 21, 22.8, 21.4, 18.7, 18.1, 14.3        
#>  2 cyl   double 6, 4, 8                                 
#>  3 disp  double 160, 108, 258, 360, 225, 146.7          
#>  4 hp    double 110, 93, 175, 105, 245, 62              
#>  5 drat  double 3.9, 3.85, 3.08, 3.15, 2.76, 3.21       
#>  6 wt    double 2.62, 2.875, 2.32, 3.215, 3.44, 3.46    
#>  7 qsec  double 16.46, 17.02, 18.61, 19.44, 20.22, 15.84
#>  8 vs    double 0, 1                                    
#>  9 am    double 1, 0                                    
#> 10 gear  double 4, 3, 5                                 
#> 11 carb  double 4, 1, 2, 3, 6, 8

print(glimpse2(iris),n = 40)
#> # A tibble: 5 x 3
#>   name         type    unique_head                  
#>   <chr>        <chr>   <chr>                        
#> 1 Sepal.Length double  5.1, 4.9, 4.7, 4.6, 5, 5.4   
#> 2 Sepal.Width  double  3.5, 3, 3.2, 3.1, 3.6, 3.9   
#> 3 Petal.Length double  1.4, 1.3, 1.5, 1.7, 1.6, 1.1 
#> 4 Petal.Width  double  0.2, 0.4, 0.3, 0.1, 0.5, 0.6 
#> 5 Species      integer setosa, versicolor, virginica

Created on 2018-10-08 by the reprex package (v0.2.1)

FFF data consolidation

Hi Mauro,
Working on consolidating our new files from our recensus. I'm also having trouble with reprex, so including Markdown style code with a Dropbox link to two of the data files (let me know if that works!). I think right now the main issues are: we aren't using 'tag' for a column name and after consolidating the worksheets into one workbook we can't combine them into one file as the xl_to_df function isn't found. We also need to add another sheet to the workbook to be consolidated with the rest: secondary_recruits. This will function very much like the 'new_secondary_stems' sheet and the recruits page will have a 'New_Secondary' True/False column just like the 'original_stems' sheet.
Thanks!
Jess

library(fgeo.tool)
library(fgeo.base)
library(reprex)
library(fgeo.misc)

devtools::install_github("forestgeo/fgeo.misc")

files.directory <- "C:/Users/jessh/Dropbox (Smithsonian)/SERC_recensus_2019/FFF_output"

files.export <- "C:/Users/jessh/Dropbox (Smithsonian)/SERC_recensus_2019/FFF_output/consolidated"
Create single worksheet from workbooks with multiple sheets
fgeo.misc::xlff_to_xl(files.directory, files.export, first_census = FALSE)
Error: Column `tag` not found in `.data`
Call `rlang::last_error()` to see a backtrace
In addition: Warning messages:
1: Unknown or uninitialised column: 'new_stem'. 
2: Length of logical index must be 1 or 64, not 0 
3: `new_secondary_stems` has cero rows. 
4: Filling every cero-row dataframe with NAs (new_secondary_stems). 
Compile the single sheet quadrat files into one file
serc_test <- xl_to_df("C:/Users/jessh/Dropbox (Smithsonian)/SERC_recensus_2019/FFF_output/consolidated")
Error in xl_to_df("C:/Users/jessh/Dropbox (Smithsonian)/SERC_recensus_2019/FFF_output/consolidated") : 
could not find function "xl_to_df"

library(writexl)

write_xlsx(serc_test, "C:/Users/shuej/Dropbox (Smithsonian)/SERC_recensus_2019/FFF_output/consolidated_test.xlsx")

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.