Code Monkey home page Code Monkey logo

strbook's People

Contributors

andrewzm avatar clintidau avatar huyanhdinhsw avatar macgirvin avatar michaelyc avatar

Stargazers

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

Watchers

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

strbook's Issues

warning and error installing package

When I tried to install the package I got the warning and error message below. When I did sessionInfo() no STRbook package was listed. I pasted my sessionInfo output below the warning.
How can I install the STRbook package?
Thanks,
Mike

install_github("andrewzm/STRbook")
Downloading GitHub repo andrewzm/STRbook@master
1 [main] tar 12456 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem to
the public mailing list [email protected]
cygwin warning:
MS-DOS style path detected: C:\Users\mmcmanus\AppData\Local\Temp\Rtmp0Q8ou4\file3de02cf17642.tar.gz
Preferred POSIX equivalent is: /cygdrive/c/Users/mmcmanus/AppData/Local/Temp/Rtmp0Q8ou4/file3de02cf17642.tar.gz
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Error: Does not appear to be an R package (no DESCRIPTION)

sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] usethis_1.4.0 devtools_2.0.1

loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 rstudioapi_0.9.0 knitr_1.21
[4] magrittr_1.5 pkgload_1.0.2 R6_2.2.2
[7] rlang_0.3.1 tools_3.4.3 pkgbuild_1.0.2
[10] xfun_0.3 sessioninfo_1.1.1 cli_1.0.1
[13] withr_2.1.2 remotes_2.0.2 yaml_2.2.0
[16] assertthat_0.2.0 digest_0.6.16 rprojroot_1.3-2
[19] crayon_1.3.4 processx_3.2.0 callr_2.0.4
[22] fs_1.2.6 ps_1.1.0 curl_3.2
[25] testthat_2.0.0 glue_1.3.0 memoise_1.1.0
[28] compiler_3.4.3 desc_1.2.0 backports_1.1.2
[31] prettyunits_1.0.2

INLA: Fail to get good enough initial values using MOcarolinawren_long example data

library(INLA)
library(dplyr)
library(tidyr)
library(ggplot2)
#install_github("andrewzm/STRbook")
data("MOcarolinawren_long",package="STRbook")
coords<-unique(MOcarolinawren_long[c("loc.ID","lon","lat")])

par(mfrow=c(3,3))
boundary<-inla.nonconvex.hull(as.matrix(coords[,2:3]))

MOmesh <- inla.mesh.2d(boundary = boundary,max.edge = c(5,10),cutoff=3)
plot(MOmesh,asp=1,main="")

spde<-inla.spde2.pcmatern(mesh=MOmesh,alpha=2,prior.range=c(1,0.01),
                          prior.sigma=c(4,0.01))

A.est<-inla.spde.make.A(mesh=MOmesh,loc=as.matrix(coords[,2:3]))
spde<-inla.spde2.matern(mesh=MOmesh,alpha=2)
simple_nontemporal_formula=y ~ -1 + intercept + f(spatial.field, model=spde)
inla_model=inla(formula = simple_nontemporal_formula,data=list(y=MOcarolinawren_long$cnt, intercept= rep(1,nrow(MOcarolinawren_long)),spatial.field=1:spde$n.spde),control.predictor = list(A=A.est,compute=T) )

Error in inla.core(formula = formula, family = family, contrasts = contrasts,  : 
  MPredictor == ny is not TRUE

 *** inla.core.safe:  inla.program has crashed: rerun to get better initial values. try=1/2 
Error in inla.core(formula = formula, family = family, contrasts = contrasts,  : 
  MPredictor == ny is not TRUE

 *** inla.core.safe:  inla.program has crashed: rerun to get better initial values. try=2/2 
Error in inla.core(formula = formula, family = family, contrasts = contrasts,  : 
  MPredictor == ny is not TRUE
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : 
  *** Fail to get good enough initial values. Maybe it is due to something else.

"sill" must be positive.??

Excuse me, sorry to bother you. I have met a question when coding.as the code follows.
<loc<-read.csv("F:/1Guichi1991-2015/schdata.SU/location.csv")
<date<-read.csv("F:/1Guichi1991-2015/schdata.SU/date.csv")
<data<-read.csv("F:/1Guichi1991-2015/schdata.SU/data.csv")
 
<library("dplyr")
<library("tidyr")
<library("STRbook")
<library("sp")
<library("spacetime")
 
#STFDF
<spat_part <- SpatialPoints(coords = loc[,c("lon", "lat")])
 
<date$time<-as.character(date$time) 
<temp_part<-date$time   
<temp_part <- as.Date(temp_part)
<class(date$time)
 
<data$VillageID<-as.integer(data$VillageID)
<all(unique(data$VillageID) == loc$VillageID)
<STOBJ1<- STFDF(sp = spat_part,
               time = temp_part,
               data = data)
 
<proj4string(STOBJ1) <- CRS("+proj=longlat +ellps=WGS84")
<library(gstat)
<vv<-variogram(object=p~1,  
              data=STOBJ1,
              width=2,  
              cutoff=28,
              tlags=0.01:6.1,tunit="days")
 
<plot(vv)
#separable model
<sepVgm <- vgmST(stModel = "separable",    
                space = vgm(10, "Exp", 400, nugget = 0.1),
                time = vgm(10, "Exp", 1, nugget = 0.1),
                sill = 20)  
<sepVgm <- fit.StVariogram(vv, sepVgm)
 ##Error in vgmST("separable", space = vgm(1 - par[2], as.character(model$space$model[2]), :
"sill" must be positive.
I can find the problem with my exercise data, could you please help me?
<spat_pred_grid<- expand.grid(
< lon = seq(117, 118, length = 20),
< lat = seq(30, 31, length = 20)) %>%
< SpatialPoints(proj4string = CRS(proj4string(STOBJ1)))
<gridded(spat_pred_grid) <- TRUE
 
<temp_pred_grid <- as.Date("1991-06-01") + seq(1, 6, length = 6)
 
 
<DE_pred<- STF(sp = spat_pred_grid,
                time = temp_pred_grid)
 
<STOBJ1 <- as(STOBJ1[,"1991-06-01::1991-06-25"], "STIDF")
 
<STOBJ1 <- subset(STOBJ1, !is.na(STOBJ1$p))
 
<pred_kriged <- krigeST(p ~ #1,
                       data = STOBJ1,
                       newdata = DE_pred, # prediction grid
                       modelList = sepVgm, # semivariogram
                       computeVar = TRUE)
 ##Error in chol.default(A) : the leading minor of order 88 is not positive definite

Error: Failed to install 'unknown package' from GitHub:

Hi,
I tried installing the STRbook but the following error repeats.
Can you please help me with this error?

Thanks in advance

Nitheshnirmal

devtools::install_github("andrewzm/STRbook")

Downloading GitHub repo andrewzm/STRbook@HEAD
andrewzm-STRbook-347d7e0/data/IDE_Sim2_results.rda: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'unknown package' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
‘tar.exe -xf "C:\Users\Nivi\AppData\Local\Temp\RtmpgTKue0\file3b9ca2e18d7.tar.gz" -C "C:/Users/Nivi/AppData/Local/Temp/RtmpgTKue0/remotes3b9cce259c3"’ returned error code 1
2: In system(cmd, intern = TRUE) :
running command 'tar.exe -tf "C:\Users\Nivi\AppData\Local\Temp\RtmpgTKue0\file3b9ca2e18d7.tar.gz"' had status 1

STRbook package updates

The package is no longer available on the CRAN repository and I couldn't get the content available here (github) to work as a valid package. Any recommendations? are updates available elsewhere?
Thank you.

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.