Skip to content

Commit 8982f53

Browse files
committed
Fixes #574 and other CRAN submission issues
1 parent 56f870c commit 8982f53

File tree

11 files changed

+50
-9
lines changed

11 files changed

+50
-9
lines changed

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
Package: gmum.r
22
Version: 0.2
3-
Date: 2015-08-05
3+
Date: 2015-09-25
44
Title: Efficient C++ Implementations of SVM, GNG and CEC Models
55
Type: Package
66
Author: Wojciech Czarnecki, Stanislaw Jastrzebski, Marcin Data, Igor Sieradzki, Mateusz Bruno-Kaminski, Karol Jurek, Piotr Kowenzowski, Michal Pletty, Konrad Talik, Maciej Zgliczynski
77
Maintainer: Stanislaw Jastrzebski <[email protected]>
88
Description: Package focusing on efficiency (C++ implementations) and intuitive API. gmum.r is a close collaboration between GMUM group members (http://gmum.net) and students.
99
License: MIT + file LICENSE
1010
Repository: CRAN
11-
Depends:
11+
Imports:
1212
ggplot2 (>= 1.0.0),
1313
stats,
1414
igraph,
1515
SparseM,
16-
httr,
1716
Matrix,
18-
MASS (>= 7.3),
17+
httr,
1918
Rcpp (>= 0.11.6)
2019
LinkingTo: Rcpp, RcppArmadillo, BH
2120
NeedsCompilation: yes

NAMESPACE

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,22 @@ importFrom(ggplot2,scale_colour_brewer)
8080
importFrom(ggplot2,scale_fill_brewer)
8181
importFrom(ggplot2,scale_size_continuous)
8282
importFrom(ggplot2,scale_size_identity)
83+
importFrom(grDevices,rainbow)
84+
importFrom(graphics,hist)
85+
importFrom(graphics,pairs)
86+
importFrom(graphics,par)
87+
importFrom(graphics,plot)
88+
importFrom(graphics,plot.new)
89+
importFrom(graphics,points)
90+
importFrom(graphics,title)
91+
importFrom(httr,GET)
92+
importFrom(httr,content)
93+
importFrom(stats,na.omit)
94+
importFrom(stats,prcomp)
95+
importFrom(stats,predict)
96+
importFrom(stats,rnorm)
97+
importFrom(stats,runif)
98+
importFrom(stats,update)
99+
importFrom(utils,data)
100+
importFrom(utils,read.csv)
83101
useDynLib(gmum.r)

R/gmum.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#' @importFrom grDevices rainbow
2+
#' @importFrom graphics hist pairs par plot plot.new points title
3+
#' @importFrom stats na.omit prcomp predict rnorm runif update
4+
#' @importFrom utils data read.csv
5+
NULL
6+
17
# Lazy loading to allow for discovery of all files
28
evalqOnLoad( {
39
# Autocompletion override
@@ -12,7 +18,7 @@ evalqOnLoad( {
1218
.DollarNames.Rcpp_CecModel <<- autocompl
1319

1420
# Workaround RStudio bug
15-
if(exists(".rs.getAnywhere")) {
21+
if(exists(".rs.getAnywhere") && !exists(".rs.getAnywhere.original")) {
1622
.rs.getAnywhere.original <<- .rs.getAnywhere
1723
.rs.getAnywhere <<- function(a, envir=.GlobalEnv){ .rs.getAnywhere.original(a, .GlobalEnv) }
1824
}

R/gng.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ library(methods)
44
#' @importFrom ggplot2 scale_size_continuous scale_size_identity geom_point aes ggplot geom_tile scale_fill_brewer scale_alpha_identity scale_colour_brewer geom_abline
55
NULL
66

7-
87
#' Use first two spatial coordinates as position in layout
98
#'
109
#' @note You can pass any igraph layout algorithm to plot
@@ -113,8 +112,10 @@ gngLoad <- NULL
113112
#' @param community.detection.algorithm Used algorithm from igraph package, by default spinglass.community
114113
#'
115114
#' @examples
115+
#' \dontrun{
116116
#' gng <- GNG(gng.preset.sphere(100))
117117
#' print(node(gng, calculateCentroids(gng)[1])$pos)
118+
#' }
118119
calculateCentroids <- NULL
119120

120121
#' Find closest node
@@ -128,11 +129,12 @@ calculateCentroids <- NULL
128129
#' @param x Can be either \code{vector} or \code{data.frame.}
129130
#'
130131
#' @examples
132+
#' \dontrun{
131133
#' gng <- GNG(gng.preset.sphere(100))
132134
#' # Find closest centroid to c(1,1,1)
133135
#' found.centroids <- calculateCentroids(gng)
134136
#' findClosests(gng, found.centroids, c(1,1,1))
135-
#'
137+
#' }
136138
findClosests <- NULL
137139

138140
#' Check if GNG is running
@@ -421,6 +423,7 @@ clustering.Rcpp_GNGServer <- NULL
421423
#' @param seed Seed for internal randomization
422424
#'
423425
#' @examples
426+
#' \dontrun{
424427
#' X <- gng.preset.sphere(100)
425428
#' y <- round(runif(100))
426429
#' # Train in an offline manner
@@ -436,7 +439,7 @@ clustering.Rcpp_GNGServer <- NULL
436439
#' terminate(gng)
437440
#' # Plot
438441
#' plot(gng)
439-
#'
442+
#' }
440443
GNG <- NULL
441444

442445
#' @title convertToIGraph

R/gng.utils.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#' @importFrom httr GET content
2+
13
#' @export
24
#' @rdname print.gng
35
#' @method print Rcpp_GNGServer

man/calculateCentroids.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Using passed community.detection finds communities and for each community pick n
1919
Get centroids
2020
}
2121
\examples{
22+
\dontrun{
2223
gng <- GNG(gng.preset.sphere(100))
2324
print(node(gng, calculateCentroids(gng)[1])$pos)
2425
}
26+
}
2527

man/findClosests.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ Finds closest node from given list to vector. Often used together with calculate
2020
Find closest node
2121
}
2222
\examples{
23+
\dontrun{
2324
gng <- GNG(gng.preset.sphere(100))
2425
# Find closest centroid to c(1,1,1)
2526
found.centroids <- calculateCentroids(gng)
2627
findClosests(gng, found.centroids, c(1,1,1))
2728
}
29+
}
2830

man/gng.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ see \url{http://sund.de/netze/applets/gng/full/tex/DemoGNG/node20.html}}
5252
Construct GNG object. Can be used to train offline, or online.
5353
}
5454
\examples{
55+
\dontrun{
5556
X <- gng.preset.sphere(100)
5657
y <- round(runif(100))
5758
# Train in an offline manner
@@ -68,4 +69,5 @@ terminate(gng)
6869
# Plot
6970
plot(gng)
7071
}
72+
}
7173

src/packThis.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ rm -r $destination/..Rcheck
4343
rm -r $destination/.git
4444
rm -r $destination/.idea
4545
rm -r pkg/pkg
46+
rm -r pkg/doc
47+
rm -r pkg/cmake
48+
rm -r pkg/libs

src/svmlight/svm_learn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ CFLOAT *kernel_cache_clean_and_malloc(KERNEL_CACHE *kernel_cache,
37143714
}
37153715
kernel_cache->invindex[result]=docnum;
37163716
kernel_cache->lru[kernel_cache->index[docnum]]=kernel_cache->time; /* lru */
3717-
return((CFLOAT *)((long)kernel_cache->buffer
3717+
return((CFLOAT *)((intptr_t)kernel_cache->buffer
37183718
+(kernel_cache->activenum*sizeof(CFLOAT)*
37193719
kernel_cache->index[docnum])));
37203720
}

0 commit comments

Comments
 (0)