Skip to content

Commit c02fdff

Browse files
author
David Lawrence Miller
committed
example clarification
1 parent f79ac24 commit c02fdff

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

R/Distance-package.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ NULL
8080
#' # Load the Excel file, note that header=FALSE and we add column names after
8181
#' minke <- read.xls(minke.filepath, stringsAsFactor=FALSE,header=FALSE)
8282
#' names(minke) <- c("Region.Label", "Area", "Sample.Label", "Effort","distance")
83-
#' minke$Effort <- as.numeric(minke$Effort) # overcome problem in R 3.1.0
8483
#' # One may want to call edit(minke) or head(minke) at this point
8584
#' # to examine the data format
8685
#'
8786
#' # Due to the way the file was saved and the default behaviour in R
8887
#' # for numbers stored with many decimal places (they are read as strings
89-
#' # rather than numbers, see str(minke)).
88+
#' # rather than numbers, see str(minke)). We must coerce the Effort column
89+
#' # to numeric
9090
#' minke$Effort <- as.numeric(minke$Effort)
9191
#'
9292
#' ## perform an analysis using the exact distances

man/flatfile.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ names(minke) <- c("Region.Label", "Area", "Sample.Label", "Effort","distance")
4646

4747
# Due to the way the file was saved and the default behaviour in R
4848
# for numbers stored with many decimal places (they are read as strings
49-
# rather than numbers, see str(minke)).
49+
# rather than numbers, see str(minke)). We must coerce the Effort column
50+
# to numeric
5051
minke$Effort <- as.numeric(minke$Effort)
5152

5253
## perform an analysis using the exact distances

0 commit comments

Comments
 (0)