r

Error in dyn.load(dllfile) — problem with building a package linking to Rcpp

拥有回忆 提交于 2021-02-11 15:38:35
问题 My package will not install, either on my machine or on travis-ci.org. The only update from the version on CRAN is that I added a vignette. I have been following the examples of Rcpp - package and R-packages; compiled code. The error is related to these prior questions but not a duplicate. Q40922814 -- problem here was the use of both C and C++ code. I only use C++ code Q36952571 -- I'm on Mac OS, so no access to ldconfig , though perhaps my problem is related. Error: from the package

How to define search queries in rtweet fullarchive and 30day search

你离开我真会死。 提交于 2021-02-11 15:38:11
问题 It's not in the Rtweet-documentation how to do this properly with the additional operators available for search_fullarchive and search_30days. It just says that the string should follow directly after the operator: , for example: place:California. And that OR can be used to search for multiple phrases. My attempts: queryohio <- '(place:OH OR place:Ohio OR place:Columbus)(corona OR covid19 OR virus)' queryohio2 <- 'corona OR covid19 OR virus place:Ohio OR place:Columbus OR place:OH'

R's padr package claiming the “datetime variable does not vary” when it does vary

≯℡__Kan透↙ 提交于 2021-02-11 15:38:07
问题 library(tidyverse) library(lubridate) library(padr) df #> # A tibble: 828 x 5 #> Scar_Id Code Type Value YrMo #> <chr> <chr> <chr> <date> <date> #> 1 0070-179 AA Start_Date 2020-04-22 2020-04-01 #> 2 0070-179 AA Closure_Date 2020-05-23 2020-05-01 #> 3 1139-179 AA Start_Date 2020-04-23 2020-04-01 #> 4 1139-179 AA Closure_Date 2020-05-23 2020-05-01 #> 5 262-179 AA Start_Date 2019-08-29 2019-08-01 #> 6 262-179 AA Closure_Date 2020-05-23 2020-05-01 #> 7 270-179 AA Start_Date 2019-08-29 2019-08-01

predict function for MaxEnt(Software R)

浪子不回头ぞ 提交于 2021-02-11 15:35:19
问题 I'm trying to use predict function for predict potencial occurrence points in space transfer. For this I using dismo package loaded with presence points in original space, 17 raster layers for original space and 17 raster layer for transfer space. All the rasters are identicals in extent, grid resolution and dimension, differing only in geographic coords. The original space and the transfer space are located in different continents and I have used kfold techinque for partitioning of my

predict function for MaxEnt(Software R)

让人想犯罪 __ 提交于 2021-02-11 15:34:24
问题 I'm trying to use predict function for predict potencial occurrence points in space transfer. For this I using dismo package loaded with presence points in original space, 17 raster layers for original space and 17 raster layer for transfer space. All the rasters are identicals in extent, grid resolution and dimension, differing only in geographic coords. The original space and the transfer space are located in different continents and I have used kfold techinque for partitioning of my

Customizing bin widths in plotly's histogram function in R

╄→гoц情女王★ 提交于 2021-02-11 15:30:08
问题 I have a dataset that dates and call volume per day. When I plotted them using the plotly R package, all except for 1 of them had each date separated into a different bin. However, this one tricky subset of the data instead grouped bins into 2 day intervals, which isn't very useful information. I'm sure it's an easy fix, but I'm not quite sure how to change the bin width. a <- as.Date(c("2019-02-01", "2019-01-14", "2019-01-15", "2019-01-24", "2019-01-31", "2019-01-22","2019-01-14", "2019-01

Make a existing function generic

瘦欲@ 提交于 2021-02-11 15:29:45
问题 I want to make an existing function generic. Thereby the default case should be the same as before, but I want to add a case for my own data structure. Thereby I came around setGeneric. For classes like data.frame it works like expected, but for my own class (class attribute set) it just calls the default function: > setGeneric('dim') > dim.data.frame <- function(x) 42 > df <- read.csv('test.csv') > dim(df) 42 If I exchange data.frame with my own class it doesn't work and just calls the

Make a existing function generic

元气小坏坏 提交于 2021-02-11 15:29:07
问题 I want to make an existing function generic. Thereby the default case should be the same as before, but I want to add a case for my own data structure. Thereby I came around setGeneric. For classes like data.frame it works like expected, but for my own class (class attribute set) it just calls the default function: > setGeneric('dim') > dim.data.frame <- function(x) 42 > df <- read.csv('test.csv') > dim(df) 42 If I exchange data.frame with my own class it doesn't work and just calls the

pivot_wider does not seem to work with missing values. How to turn spread() into pivot_wider() when there is missing values

旧时模样 提交于 2021-02-11 15:28:06
问题 as the spread() function is being replaced by the new pivot_wider() function, I was trying to use the pivot_wider() from now on but it does not seem to work because of the missing values. Any help is much appreciated # This is an example I saw on the web surveys <- read.csv("http://kbroman.org/datacarp/portal_data_joined.csv", stringsAsFactors = FALSE) library(dplyr) surveys %>% filter(taxa == "Rodent", !is.na(weight)) %>% group_by(sex,genus) %>% summarize(mean_weight = mean(weight)) %>%

ggiraph: tooltip with hyperlink?

风格不统一 提交于 2021-02-11 15:27:57
问题 I am trying to create an interactive scatterplot with ggiraph where the tooltip allows me to navigate to a webaddress (which pertains to the specific selected dot). Any idea whether this is actually possible and how to go about it? Many thanks for any advice! library(tidyverse) library(ggiraph) my_df <- data.frame(stringsAsFactors=FALSE, x = c(0.5, 0.1), y = c(0.2, 0.9), link = c("bbcnews.com", "nyt.com"), link_name = c("bbc news", "nytimes") ) my_plot <- my_df %>% ggplot()+ geom_point