-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
146 lines (146 loc) · 4.57 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
example(source) # defines the sourceDir() function
try(roxygen2::roxygenize(load_code = sourceDir), silent = TRUE)
roxygen2::roxygenize()
devtools::install()
roxygen2::roxygenize()
devtools::install(quick=FALSE)
devtools::install()
devtools::install()
devtools::check()
roxygen2::roxygenize()
devtools::install()
roxygen2::roxygenize()
devtools::install()
devtools::check()
roxygen2::roxygenize()
devtools::install()
devtools::check()
roxygen2::roxygenize()
devtools::install()
roxygen2::roxygenize()
devtools::install()
devtools::install()
library(greencrab.toolkit)
install.packages('rstan')
install.packages('rstan')
install.packages("rstan")
install.packages("~/rstan_2.26.23.tar.gz", repos = NULL, type = "source")
install.packages('QuickJSR')
install.packages("~/rstan_2.26.23.tar.gz", repos = NULL, type = "source")
pkgbuild::clean_dll()
pkgbuild::compile_dll()
pkgbuild::compile_dll()
pkgbuild::compile_dll()
pkgbuild::compile_dll()
devtools::document()
.libpaths()
libpaths()
.libpaths()
.libPaths()
library(eDNAjoint)
data("greencrabData")
data <- greencrabData
'%>%' <- magrittr::`%>%`
#convert qPCR data to long format
qPCR_all <- as.data.frame(data$qPCR.N) %>%
dplyr::mutate(L=1:dim(data$qPCR.N)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='N') %>%
tidyr::drop_na()
qPCR.K_df <- as.data.frame(data$qPCR.K) %>%
dplyr::mutate(L=1:dim(data$qPCR.K)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='K') %>%
tidyr::drop_na()
qPCR_all$K <- qPCR.K_df$K
#convert count data to long format
count_all <- as.data.frame(data$count) %>%
dplyr::mutate(L=1:dim(data$count)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='count') %>%
tidyr::drop_na()
#if q==TRUE, add count type data to count df
if(q==TRUE){
count.type_df <- as.data.frame(data$count.type) %>%
dplyr::mutate(L=1:dim(data$count.type)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='count.type') %>%
tidyr::drop_na()
count_all$count.type <- count.type_df$count.type
#create vector of q coefficient names
counttypes <- unique(count_all$count.type)
names <- counttypes[!counttypes==q_ref]
q_names <- paste0('q_',names)
#add dummy variables for count type
for(i in seq_along(q_names)){
count_all[,q_names[i]] <- ifelse(count_all$count.type==names[i],1,0)
}
}
#if present, prepare covariate data
if(all(cov!='None')){
site_mat <- as.data.frame(data$site.cov[,cov])
site_mat <- cbind(as.data.frame(rep(1,length(site_mat[,1]))),site_mat)
colnames(site_mat) <- c('int',cov)
}
q_names
q <- TRUE
#if q==TRUE, add count type data to count df
if(q==TRUE){
count.type_df <- as.data.frame(data$count.type) %>%
dplyr::mutate(L=1:dim(data$count.type)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='count.type') %>%
tidyr::drop_na()
count_all$count.type <- count.type_df$count.type
#create vector of q coefficient names
counttypes <- unique(count_all$count.type)
names <- counttypes[!counttypes==q_ref]
q_names <- paste0('q_',names)
#add dummy variables for count type
for(i in seq_along(q_names)){
count_all[,q_names[i]] <- ifelse(count_all$count.type==names[i],1,0)
}
}
q_ref <- 1
#if q==TRUE, add count type data to count df
if(q==TRUE){
count.type_df <- as.data.frame(data$count.type) %>%
dplyr::mutate(L=1:dim(data$count.type)[1]) %>%
tidyr::pivot_longer(cols=!L,values_to='count.type') %>%
tidyr::drop_na()
count_all$count.type <- count.type_df$count.type
#create vector of q coefficient names
counttypes <- unique(count_all$count.type)
names <- counttypes[!counttypes==q_ref]
q_names <- paste0('q_',names)
#add dummy variables for count type
for(i in seq_along(q_names)){
count_all[,q_names[i]] <- ifelse(count_all$count.type==names[i],1,0)
}
}
q_names
length(q_names)
data$count.type /1
min(data$count.type)
min(data$count.type,na.rm=TRUE)
4 %% 3
data$count.type %% 1
data$count.type %% 2
data$count.type %% 1 == 0 | data$count.type %% 1 == NA
data$count.type %% 1 %in% c(0,NA)
all(data$count.type %% 1 %in% c(0,NA))
!all(data$count.type %% 1 %in% c(0,NA))
roxygen2::roxygenize()
.libPaths()
install.packages('methods')
install.packages("methods")
install.packages("methods")
install.packages('methods')
install.packages("methods")
install.packages("Rcpp")
install.packages('methods')
.libPaths()
install.packages('methods',lib="/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
install.packages("methods", lib = "/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
install.packages("methods", lib = "/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
install.packages("methods", lib = "/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
install.packages("methods", lib = "/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
install.packages("methods", lib = "/home/abby/R/x86_64-pc-linux-gnu-library/4.3")
.libPaths()
roxygen2::roxygenize()
.libPaths()