search for: tolower

Displaying 20 results from an estimated 283 matches for "tolower".

2007 Jul 30
2
apply, lapply and data.frame in R 2.5
Hello everyone, A recent (in 2.5 I suspect) change in R is giving me trouble. I want to apply a function (tolower) to all the columns of a data.frame and get a data.frame in return. Currently, on a data.frame, both apply (for arrays) and lapply (for lists) work, but each returns its native class (resp. matrix and list): apply(mydat,2,tolower) # gives a matrix lapply(mydat,tolower) # gives a list and sapp...
2024 Mar 29
1
Question regarding .make_numeric_version with non-character input
...h/r-source/blob/66b91578dfc85140968f07dd4e72d8cb8a54f4c6/src/library/base/R/version.R#L50-L56) runs the following steps in case of non-character input: 1. It creates a message named msg using gettextf. 2. Such object is then passed to stop(msg) or warning(msg) according to the following condition tolower(Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false") However, I don't understand the previous code since the output of Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false" is just a boolean value and tolower() w...
2024 Apr 24
1
Question regarding .make_numeric_version with non-character input
.../R/version.R#L50-L56) runs the following steps in case of non-character input: >>> | >>> | 1. It creates a message named msg using gettextf. >>> | 2. Such object is then passed to stop(msg) or warning(msg) according to the following condition >>> | >>> | tolower(Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false") >>> | >>> | However, I don't understand the previous code since the output of Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false" is just a...
2012 Sep 14
1
please comment on my function
this function is supposed to canonicalize the language: --8<---------------cut here---------------start------------->8--- canonicalize.language <- function (s) { s <- tolower(s) long <- nchar(s) == 5 s[long] <- sub("^([a-z]{2})[-_][a-z]{2}$","\\1",s[long]) s[nchar(s) != 2 & s != "c"] <- "unknown" s } canonicalize.language(c("aa","bb-cc","DD-abc","eee","ff_FF",&...
2012 Dec 02
2
Change case of factor in data frame
...frame by index, then it returns class "data.frame" but if it is referenced by name, it returns class "factor" or whatever the column actually is: dat[1] returns class "data.frame" but dat$name returns class "factor" The problem is that, when one applies the tolower() and toupper() functions, dat$name will return a column of lower/uppercase returns (now class "character") but dat[1] will return an array of factor level indexes. Specifying dat[1] as.character during the function call does not work (e.g. tolower(as.character(dat[1]))). So, I would lo...
2024 Apr 25
1
Question regarding .make_numeric_version with non-character input
...s in case of non-character input: >> | >> | 1. It creates a message named msg using gettextf. >> | 2. Such object is then passed to stop(msg) or warning(msg) according to the following condition >> | >> | tolower(Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false") >> | >> | However, I don't understand the previous code since the output of Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "fals...
2024 Apr 25
2
Question regarding .make_numeric_version with non-character input
...) runs the following steps in case of non-character input: > | > | 1. It creates a message named msg using gettextf. > | 2. Such object is then passed to stop(msg) or warning(msg) according to the following condition > | > | tolower(Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false") > | > | However, I don't understand the previous code since the output of Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false" is...
2014 Nov 22
2
Problemas con tm
Estimados compañeros tengo un problema con la librería tm o con windows 8.1 o con algo que no controlo. Hace tiempo con windows 7 y una versión anterior de R ejecutaba este código: library(tm) data("crude") crude <- tm_map(crude, tolower) tdm<-TermDocumentMatrix(crude) y sin problemas me creaba tdm. Ahora si lo ejecuto me da el siguiente error: Error: inherits(doc, "TextDocument") is not TRUE Pero si quito la línea de código crude <- tm_map(crude, tolower) Me crea tdm sin problema. ¿Qué está pasando? Muchas...
2018 Jan 30
0
[lldb-dev] Adding DWARF5 accelerator table support to llvm
...g should be done according the the "Caseless matching" Section of the Unicode standard (whose implementation is basically a long list of special cases). While certainly possible, implementing this would be much more complicated (and would probably make the code a bit slower) than a simple tolower(3) call. And the benefits of this are not really clear to me. Do you know if we already make any promises or assumptions about the encoding and/or locale of the symbol names (and here I mainly mean the names in the debug info metadata, not llvm symbols). If we don't already have a policy abou...
2001 Sep 28
0
openssh-2.9.9p2 subscript violation problems with ctype macros
...revision 2.9.9.2.0.1 diff -pu -r2.9.9.2 -r2.9.9.2.0.1 --- canohost.c 2001/06/25 05:01:24 2.9.9.2 +++ canohost.c 2001/09/28 18:48:11 2.9.9.2.0.1 @@ -87,8 +87,8 @@ get_remote_hostname(int socket, int reve * of this software). */ for (i = 0; name[i]; i++) - if (isupper(name[i])) - name[i] = tolower(name[i]); + if (isupper((unsigned char)name[i])) + name[i] = tolower((unsigned char)name[i]); if (!reverse_mapping_check) return xstrdup(name); =================================================================== RCS file: match.c,v retrieving revision 2.9.9.2 retrieving revision 2.9.9.2.0...
2010 Oct 11
1
grep triggering error on unicode character
...ecause the unicode mapping for ? [a-acute] is U+00E1. The problem arises when I attempt to manipulate the text in the file. For example: > grep("XXX", X[213]) integer(0) Warning message: In grep("XXX", X[213]) : input string 1 is invalid in this locale Worse, yet: > tolower(X[213]) Error in tolower(X[213]) : invalid multibyte string 1 I am focussing on resolving the first problem, i.e., identifying a line containing XXX. If I can do so, I can remove the offending lines before I execute the tolower command. However, I am stumped as to how to resolve either problem...
2012 Sep 24
5
Memory usage in R grows considerably while calculating word frequencies
...hy is R using so much memory? Is there a better way to do this that will minimize memory usage. I am very new to R, so I would appreciate some tips on how to improve my program or a better way to do it. R program: # Read in the entire file and convert all words in text to lower case words.txt<-tolower(scan("text_file","character",sep="\n")) # Extract words pattern <- "(\\b[A-Za-z]+\\b)" match <- gregexpr(pattern,words.txt) words.txt <- regmatches(words.txt,match) # Create a vector from the list of words words.txt<-unlist(words.txt) # Calcula...
2018 Jan 30
2
[lldb-dev] Adding DWARF5 accelerator table support to llvm
...ording the the "Caseless matching" Section > of the Unicode standard (whose implementation is basically a long list > of special cases). While certainly possible, implementing this would > be much more complicated (and would probably make the code a bit > slower) than a simple tolower(3) call. And the benefits of this are > not really clear to me. Assuming a UTF-8 encoding, will tolower(3) destroy any non-ASCII characters in the process? In Swift, for example, we allow a wide range of unicode characters in identifiers and I want to make sure that this doesn't cause any p...
2008 May 20
2
need some help in plotting xy graph
...m$month), two_digits(m$day), sep="-") at.lbls <- paste(dd, hh, sep="\n") } list(x=list(at = at.x, rot=rot, labels = at.lbls)) } "celnet.theme" <- function() { celnet.theme <- canonical.theme("pdf", color = TRUE) if(tolower(.Device) =="png") celnet.theme$background$col <- "white" else canonical.theme("pdf", color = TRUE) celnet.theme$background$col <- "transparent" celnet.theme } "celnet.trellis.device" <- function(device, file,...
2008 May 21
2
need some help in plotting xy graph
...m$month), two_digits(m$day), sep="-") at.lbls <- paste(dd, hh, sep="\n") } list(x=list(at = at.x, rot=rot, labels = at.lbls)) } "celnet.theme" <- function() { celnet.theme <- canonical.theme("pdf", color = TRUE) if(tolower(.Device) =="png") celnet.theme$background$col <- "white" else canonical.theme("pdf", color = TRUE) celnet.theme$background$col <- "transparent" celnet.theme } "celnet.trellis.device" <- function(device, file,...
2010 Jun 17
3
RODBC in R
When I am connecting to the server via ODBC I got the following error. >library(RODBC) channel <- odbcConnect("my server", uid="***" , case="*****") Error in switch(case, toupper = case <- 1L, tolower = case <- 2L, postgresql = case <- 2L, : Invalid case parameter: nochange | toupper | tolower | common db names How to fix this error? Thanks -- View this message in context: http://r.789695.n4.nabble.com/RODBC-in-R-tp2258510p2258510.html Sent from the R help mailing list archive at N...
2018 Jan 19
3
[lldb-dev] Adding DWARF5 accelerator table support to llvm
> On Jan 18, 2018, at 7:52 AM, Pavel Labath via lldb-dev <lldb-dev at lists.llvm.org> wrote: > > Thank you for all the responses. Unfortunately I wasn't able to make > any progress on creating the patches today. I'll be sure to add > everyone who expressed interest here to the phabricator diff once I > have them ready. > > Jonas, do you have any dsymutil
2019 Jun 21
2
Suggested Patch: Library returns matching installed packages when typo present
...verbose = verbose) if(length(pkgpath) == 0L) { - if(length(lib.loc) && !logical.return) + if(length(lib.loc) && !logical.return) { + allpkgs <- .packages(TRUE, lib.loc) + if (!is.na(w <- match(tolower(package), tolower(allpkgs)))) + warning(sprintf("Perhaps you meant %s ?", + sQuote(allpkgs[w])), call. = FALSE, domain = NA) stop(packageNotFoundError(package, lib.loc, sys.call())) + }...
2004 Dec 05
2
String manipulation---mixed case
...to get R to convert a string which is all upper case to a string where the first letter in each word is upper case and all others are lower case? I suspect the solution is to begin by parsing the string, convert the appropriate letters to upper and lower case using "toupper" and "tolower", and then to paste the pieces back together. Moreover, given the elegance and power of R, I'll bet this can be coded very tersely. Before I embarked on trying to code this, I thought I would tap the R braintrust to see if this has already been done. Any help greatly appreciated, Damian...
2024 Apr 25
1
Question regarding .make_numeric_version with non-character input
.../R/version.R#L50-L56) runs the following steps in case of non-character input: >>> | >>> | 1. It creates a message named msg using gettextf. >>> | 2. Such object is then passed to stop(msg) or warning(msg) according to the following condition >>> | >>> | tolower(Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false") >>> | >>> | However, I don't understand the previous code since the output of Sys.getenv("_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_") != "false" is just a...