forestgeo / fgeo.misc Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous Functions
Home Page: https://forestgeo.github.io/fgeo.misc/.
Miscellaneous Functions
Home Page: https://forestgeo.github.io/fgeo.misc/.
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)
When attempting to load fgeo.misc using devtools, I receive the following error. Is there a way to redirect to the correct URL?
devtools::install_github("forestgeo/fgeo.misc")
Error: Failed to install 'fgeo.misc' from GitHub:
(converted from warning) unable to access index for repository https://forestgeo.github.io/drat/src/contrib:
cannot open URL 'https://forestgeo.github.io/drat/src/contrib/PACKAGES'
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"
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).
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")
we would like to have the "Team" column from the root worksheet added to each stem similar to the date.
--Jess
When running the code without the root_columns command to add “team” the data consolidates properly. However, when I try to add the team column the data is repeated for each quadrat – one with the team included and one has NA’s for team.
-- @jess-shue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.