search for: na_character_

Displaying 20 results from an estimated 87 matches for "na_character_".

2010 Aug 13
1
assign multiple variables at once
...P", NA, NA, NA, NA, "RG", "WP", "WP"), ESP2 = c(NA, "RB", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "SMB", "YP", "YP"), ESP3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "RB", "RBS", NA), ESP4 = c(NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_), ESP5 = c(NA_character_, NA_character_, NA_character_, NA_character_, NA_ch...
2009 Aug 17
2
help with expression()
Hello. I have a vector and within that vector is one expression. When I display this vector it comes up as expression(NA_character_, NA_character_, "Null Effect", "Pooled effect", NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, paste("Het Contours ", I^2, sep = ""), 0.4, 0.41, 0.42, 0.45, NA_character_) Where the part in bold is the element which...
2017 Nov 22
1
mystery "158"
...t;), class = "factor"), minuty = structure(c(2L, 3L, 4L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 2L, 3L, 4L, 2L, 3L, 2L, 3L, 2L, 3L, 2L, 3L), .Label = c("180", "240", "300", "360", "420", "480" ), class = "factor"), fff = c(NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_, NA_character_...
2017 Nov 21
0
mystery "158"
Your data frame fam contains factors. Turn it into character strings using fam$Family = as.character(fam$Family) and try again. It may be helpful if you read up on R's factors, see ?factor. HTH, Peter On Tue, Nov 21, 2017 at 2:14 PM, Glen Forister <gforister at gmail.com> wrote: > This is a simple problem, but a mystery to me. > I'm trying to grab $Family
2017 Nov 21
2
mystery "158"
This is a simple problem, but a mystery to me. I'm trying to grab $Family "Scelionidae" from one dataframe and put it into another dataframe occupied with NA in $Family. The result is a "158" ends up there instead of Scelionidae. Simply put fam$Family[1] <- least$Family[1] If I have made a mistake here, can somebody point it out. I've included the simple
2011 Feb 19
1
Accessing Package NEWS (NEWS.Rd)
...e[2]> debug: if (!all(ind)) warning("Cannot extract version info from the following section titles:\n", Browse[2]> ind [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE Browse[2]> debug: NULL Browse[2]> debug: .make_news_db(cbind(ifelse(ind, sub(re_v, "\\1", nms), NA_character_), ifelse(grepl(re_d, nms), sub(re_d, "\\1", nms), NA_character_), db[, 2L], sub("\n*$", "", db[, 3L])), logical(nrow(db)), "news_db_from_Rd") Browse[2]> debugging in: .make_news_db(cbind(ifelse(ind, sub(re_v, "\\1", nms), NA_chara...
2011 Jul 04
1
Prevent 'R CMD check' from reporting "NA"/"NA_character_" missmatch?
Hello, I'm writing a package am running 'R CMD check' on it. Is there any way to make 'R CMD check' not warn about a missmatch between 'NA_character_' (in the function definition) and 'NA' (in the documentation)? Thanks for any help. Sincerely, Joh
2012 Feb 08
0
Error in data.frame(srcfile = NA_character_ ...) using R CMD check
...-12-22) * using platform: i386-pc-mingw32 (32-bit) * using session charset: ISO8859-1 * checking for file 'pkg/DESCRIPTION' ... OK * this is package 'disco' version '1.1' ... (all OK's here) * checking R code for possible problems ... NOTE Error in data.frame(srcfile = NA_character_, frow = NA_integer_, lrow = NA_integer_, : node stack overflow Calls: <Anonymous> ... as.data.frame -> as.data.frame.list -> eval -> eval -> data.frame Execution halted I tried to find a solution but I couldn't find any extra information on this. A previous discussion http...
2019 Aug 15
4
Feature request: non-dropping regmatches/strextract
...havior is to drop empty matches, which results in mismatches in column length if reassignment is done without subsetting. For consistency with other R functions and compatibility with this use case, it would be nice if regmatches did not automatically drop empty matches and would instead insert an NA_character_ value (similar to stringr::str_extract). This alternative regmatches could be implemented through an optional drop argument, a new function, or mentioned in the documentation (a la resample in ?sample).? Alternatively, at the moment, there is a non-exported function strextract in utils which is ve...
2017 Oct 14
2
Another issue with Sys.timezone
...of this, e.g. as below, it would be useful on such systems as mine and the regression test would pass. my.Sys.timezone <- function (location = TRUE) { tz <- Sys.getenv("TZ", names = FALSE) if (!location || nzchar(tz)) return(Sys.getenv("TZ", unset = NA_character_)) lt <- normalizePath("/etc/localtime") if (grepl(pat <- "^/usr/share/zoneinfo/", lt) || grepl(pat <- "^/usr/share/zoneinfo.default/", lt)) sub(pat, "", lt) else if (lt == "/etc/localtime") if (!file.exi...
2017 Oct 18
2
Another issue with Sys.timezone
...gression test would pass. > > > my.Sys.timezone <- > > function (location = TRUE) > > { > > tz <- Sys.getenv("TZ", names = FALSE) > > if (!location || nzchar(tz)) > > return(Sys.getenv("TZ", unset = NA_character_)) > > lt <- normalizePath("/etc/localtime") > > if (grepl(pat <- "^/usr/share/zoneinfo/", lt) || > > grepl(pat <- "^/usr/share/zoneinfo.default/", lt)) > > sub(pat, "", lt) > > else if (...
2011 Jul 05
1
Circumventing code/documentation mismatches ('R CMD check')
...(!(is.character(Argument1))){ stop("Wrong class.") } } # Function Body cat("Hello World\n") } Documentation of this is straight forward: ... \usage{test(Argument1=NA)} ... However writing the function could be made more concise like so: test2 <- function(Argument1=NA_character_){ # Prerequisite testing if(!(is.character(Argument1))){ stop("Wrong class.") } # Function Body cat("Hello World\n") } To prevent confusion I do not want to use 'NA_character_' in the user- exposed documentation and using ... \usage{test2(Argument1=NA)} ... le...
2016 May 24
2
Suggestion: mkString(NULL) should be NA
Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) character() rather than the NA_character_? An empty string and NULL aren't the same. It seems reasonable for Rf_mkChar to give NA_character_ though. ~G On Tue, May 24, 2016 at 8:42 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote: > On Thu, May 12, 2016 at 1:20 PM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> > w...
2017 Oct 16
0
Another issue with Sys.timezone
...systems as mine and the > regression test would pass. > my.Sys.timezone <- > function (location = TRUE) > { > tz <- Sys.getenv("TZ", names = FALSE) > if (!location || nzchar(tz)) > return(Sys.getenv("TZ", unset = NA_character_)) > lt <- normalizePath("/etc/localtime") > if (grepl(pat <- "^/usr/share/zoneinfo/", lt) || > grepl(pat <- "^/usr/share/zoneinfo.default/", lt)) > sub(pat, "", lt) > else if (lt == "/etc/localtim...
2016 May 24
2
Suggestion: mkString(NULL) should be NA
...May 24, 2016 at 9:30 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote: > On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbecker at ucdavis.edu> > wrote: > > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) > character() > > rather than the NA_character_? > > No. It should still be safe to assume that mkString() always returns a > character vector of exactly length one. Anything else could lead to > type errors. > Well the thing is you're passing an invalid pointer, that doesn't point to a C string, to a constructor expecti...
2019 Aug 15
2
Feature request: non-dropping regmatches/strextract
...comparable array language. Alternatively, perhaps a nomatch (or maybe emptymatch) argument in the spirit of `[.data.table`? That is, an argument nomatch where nomatch = NULL (the default) results in drops for vector outputs and character(0) for list outputs and nomatch = NA results in insertion of NA_character_, and nomatch = '' results in insertion of empty string. I can submit proposed patch code if others think this is a good idea. What are your thoughts on the proposed alteration to (currently nonexported) strextract? I assume (maybe wrongly) that the plan is to eventually export that functi...
2017 Oct 19
0
Another issue with Sys.timezone
...t;> >> > my.Sys.timezone <- >> > function (location = TRUE) >> > { >> > tz <- Sys.getenv("TZ", names = FALSE) >> > if (!location || nzchar(tz)) >> > return(Sys.getenv("TZ", unset = NA_character_)) >> > lt <- normalizePath("/etc/localtime") >> > if (grepl(pat <- "^/usr/share/zoneinfo/", lt) || >> > grepl(pat <- "^/usr/share/zoneinfo.default/", lt)) >> > sub(pat, "", lt) >>...
2019 Aug 15
0
Feature request: non-dropping regmatches/strextract
Changing the default behavior of regmatches would break its use with gregexpr, where the number of matches per input element faries, so a zero-length character vector makes more sense than NA_character_. > x <- c("John Doe", "e e cummings", "Juan de la Madrid") > m <- gregexpr("[A-Z]", x) > regmatches(x,m) [[1]] [1] "J" "D" [[2]] character(0) [[3]] [1] "J" "M" > vapply(.Last.value, function(x)past...
2014 Apr 25
0
Preventing $R_HOME/site-library/ via R_LIBS_SITE=":" (no other way?)
...believe the issue is that the system/global Rprofile (src\library\profile\Common.R) does: Sys.setenv(R_LIBS_SITE = .expand_R_libs_env_var(Sys.getenv("R_LIBS_SITE"))) Here this information on whether R_LIBS_SITE is unset or empty is lost. Sys.getenv("R_LIBS_SITE", NA_character_) would distinguish the two cases. However, NA_character_ is coerced to "NA" in Sys.setenv(R_LIBS_SITE = ...), which means a site library cannot be "NA". I assume my above "hack" could be done as: local({ libs <- Sys.getenv("R_LIBS_SITE", NA_character_)...
2016 May 25
0
Suggestion: mkString(NULL) should be NA
...ooms at stat.ucla.edu> > wrote: >> On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbecker at ucdavis.edu> >> wrote: >> > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) >> character() >> > rather than the NA_character_? >> >> No. It should still be safe to assume that mkString() always returns a >> character vector of exactly length one. Anything else could lead to >> type errors. >> > Well the thing is you're passing an invalid pointer, that doesn&...