mirror of
				https://github.com/msberends/AMR.git
				synced 2025-11-04 04:34:02 +01:00 
			
		
		
		
	try to support older R versions
This commit is contained in:
		@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
# Setting up R deps
 | 
			
		||||
language: r
 | 
			
		||||
r: 3.2
 | 
			
		||||
r: 3.1
 | 
			
		||||
r_packages: covr
 | 
			
		||||
cache: packages
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ Description: Functions to simplify the analysis of Antimicrobial Resistance (AMR
 | 
			
		||||
    on antibiograms according to Leclercq (2013)
 | 
			
		||||
    <doi:10.1111/j.1469-0691.2011.03703.x>.
 | 
			
		||||
Depends:
 | 
			
		||||
    R (>= 3.2.0)
 | 
			
		||||
    R (>= 3.1.0)
 | 
			
		||||
Imports:
 | 
			
		||||
    dplyr (>= 0.7.0),
 | 
			
		||||
    data.table (>= 1.10.0),
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,7 @@ exportMethods(print.tbl)
 | 
			
		||||
exportMethods(print.tbl_df)
 | 
			
		||||
exportMethods(summary.mic)
 | 
			
		||||
exportMethods(summary.rsi)
 | 
			
		||||
importFrom(data.table,data.table)
 | 
			
		||||
importFrom(dplyr,"%>%")
 | 
			
		||||
importFrom(dplyr,all_vars)
 | 
			
		||||
importFrom(dplyr,any_vars)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								NEWS.md
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS.md
									
									
									
									
									
								
							@@ -9,6 +9,7 @@
 | 
			
		||||
- New print format for tibbles and data.tables
 | 
			
		||||
 | 
			
		||||
#### Changed
 | 
			
		||||
- Support for older R versions, only R 3.1.0 and later is needed
 | 
			
		||||
- Renamed dataset `ablist` to `antibiotics`
 | 
			
		||||
- Renamed dataset `bactlist` to `microorganisms`
 | 
			
		||||
- Added more microorganisms to `bactlist`
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								R/freq.R
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								R/freq.R
									
									
									
									
									
								
							@@ -337,7 +337,7 @@ freq <- function(x,
 | 
			
		||||
                 '; ',
 | 
			
		||||
                 (Count.rest / length(x)) %>% percent(force_zero = TRUE),
 | 
			
		||||
                 ')'),
 | 
			
		||||
          '. Use `nmax` to show more rows.\n\n', sep = '')
 | 
			
		||||
          '. Use `nmax` to show more rows.\n', sep = '')
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
      print(
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								R/misc.R
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								R/misc.R
									
									
									
									
									
								
							@@ -111,3 +111,12 @@ size_humanreadable <- function(bytes, decimals = 1) {
 | 
			
		||||
  out <- paste(sprintf(paste0("%.", decimals, "f"), bytes / (1024 ^ factor)), size[factor + 1])
 | 
			
		||||
  out
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# strrep is only available in R 3.3 and later
 | 
			
		||||
# and we want to support R 3.2 too, so:
 | 
			
		||||
strrep <- function(x, times) {
 | 
			
		||||
  for (i in 1:length(x)) {
 | 
			
		||||
    x[i] <- paste(rep(x[i], times[i]), collapse = "")
 | 
			
		||||
  }
 | 
			
		||||
  x
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user