similar to: converting string vector to integer/numeric vector

Displaying 20 results from an estimated 4000 matches similar to: "converting string vector to integer/numeric vector"

2006 May 19
5
Converting character strings to numeric
I assume that I have missed something fundamental and that it is there in front of me in "An Introduction to R", but I need someone to point me in the right direction. > x1 <- "1159 1129 1124 -5 -0.44 -1.52" > x2 <- c("1159","1129","1124","-5","-0.44","-1.52") > x3 <- unlist(strsplit(x1,"
2011 Jul 23
2
Create a map
Hello: I'm using the library of maps, however, I need to use a map of Puerto Rico, but apparently does not exist. I wanted to know if there is any way that I can create that map? Thanks, Amy [[alternative HTML version deleted]]
2019 Feb 07
3
Bug Report: read.table with UTF-8 encoded file imports infinity symbol as Integer 8
I can confirm that it doesn't happen on Ubuntu 18.04.1 so Peter is most likely correct; it looks like its Windows specific. On Thu, 7 Feb 2019 at 12:55, peter dalgaard <pdalgd at gmail.com> wrote: > > This doesn't seem to be happening on MacOS, neither in Terminal nor RStudio, (R 3.5.1, R-devel, R-patched). So probably Windows specific. > > -pd > > > On 7 Feb
2018 Feb 15
2
writeLines argument useBytes = TRUE still making conversions
On Thu, Feb 15, 2018 at 11:19 AM, Kevin Ushey <kevinushey at gmail.com> wrote: > I suspect your UTF-8 string is being stripped of its encoding before > write, and so assumed to be in the system native encoding, and then > re-encoded as UTF-8 when written to the file. You can see something > similar with: > > > tmp <- '?' > > tmp <- iconv(tmp,
2008 May 21
1
rawToChar(raw(0))
Hi, right now we have (on R v2.7.0 patched (2008-04-23 r45466)) that: > rawToChar(raw(0)) [1] "" > rawToChar(raw(0), multiple=TRUE) character(0) Is this intended or should both return character(0)? Personally, I would prefer that an empty input vector returns an empty output vector. Same should then apply to charToRaw(), but right now we get: > x <- character(0) >
2008 Apr 28
4
R 2.7.0, match() and strings containing \0 - bug?
Hi, A piece of my code that uses readBin() to read a certain file type is behaving strangely with R 2.7.0. This seems to be because of a failure to match() strings after using rawToChar() when the original was terminated with a "\0" character. Direct equality testing with == still works as expected. I can reproduce this as follows: > x <- "foo" > y <-
2018 Feb 17
1
writeLines argument useBytes = TRUE still making conversions
Of course, right after writing this e-mail I tested on my Windows machine and did not see what I expected: > charToRaw(before) [1] c3 a9 > charToRaw(after) [1] e9 so obviously I'm misunderstanding something as well. Best, Kevin On Sat, Feb 17, 2018 at 2:19 PM, Kevin Ushey <kevinushey at gmail.com> wrote: > From my understanding, translation is implied in this line of ?file
2019 Feb 08
3
Bug Report: read.table with UTF-8 encoded file imports infinity symbol as Integer 8
I can reproduce this behavior on my Windows 10 system in RGui (cp1252): when I paste the Unicode infinity symbol into the console, it is treated as number 8. This is caused by Windows "best fit" default behavior in conversion of unicode characters to characters in the current native encoding: at some point in the past, 8 has been chosen as a good fit for infinity in Windows. In my
2012 Jul 20
1
subRaw?
Hello, All: Do you know of any capability to substitute more then one byte in an object of class Raw? Consider the following: > let4 <- paste(letters[1:4], collapse='') > (let4Raw <- charToRaw(let4)) [1] 61 62 63 64 > (let. <- sub('bc', '--', let4Raw)) [1] "61" "62" "63" "64" > # no
2011 Aug 22
3
automatic file input
Dear all, I have 100 files which are used as input.and I have to input the name of my files again and again.the name of the files are 1.out, 2.out......100.out. I want to know if there is anything like perl so that i can use something like this- for($f = 1; $f <= 100; $f++) { $file = $f.".out"; I have tried this thing in R but it does not work.Can somebody please help me.
2009 May 10
2
In C, a fast way to slice a vector?
Hello, Suppose in the following code, PROTECT(sr = R_tryEval( .... )) sr is a RAWSXP vector. I wish to return another RAWSXP starting at position 13 onwards (base=0). I could create another RAWSXP of the correct length and then memcpy the required bytes and length to this new one. However is there a more efficient method? Regards Saptarshi Guha
2012 Nov 21
2
[LLVMdev] Extended Inline asm with double data type crashes clang
Thanks Rafael, Hello All, Could anyone please comment, which part in selectiondag need to be understood/modified to fix this. Regards, Rajesh On Wed, Nov 21, 2012 at 2:38 AM, Rafael EspĂ­ndola < rafael.espindola at gmail.com> wrote: > I reported http://llvm.org/pr14393 to track it. > > On 20 November 2012 05:18, rajesh viswabramana > <viswabramana.rajesh at
2018 Feb 15
2
writeLines argument useBytes = TRUE still making conversions
I think this behavior is inconsistent with the documentation: tmp <- '?' tmp <- iconv(tmp, to = 'UTF-8') print(Encoding(tmp)) print(charToRaw(tmp)) tmpfilepath <- tempfile() writeLines(tmp, con = file(tmpfilepath, encoding = 'UTF-8'), useBytes = TRUE) [1] "UTF-8" [1] c3 a9 Raw text as hex: c3 83 c2 a9 If I switch to useBytes = FALSE, then
2003 Aug 12
4
rsync problem
Hi all, I've installed rsync-2.5.6 on a sun box (solaris 8). When I run rsync using the command rsync -a ssh /opt/local/pkgs/httpd/htdocs/ root@remotemachine:/mnt/ I get the error rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(165) What could be the reason? Any help would be appreciated. Thanks, Rajesh.
2012 Aug 20
5
automatically detaching PCI host devices from guest for SRIOV usage.
Dear List , We are using intel 82599EB based SRIOV capable 10GbE cards on the host machine.The VFs are being assigned to the guest in pass through mode and are providing the network connectivity as expected. However when we shutdown the guest the connectivity does not comes back via the VFs on the guest in next boot unless the VFs are detached from the *guest* *before* initiating a shutdown of
2002 Jan 28
4
commands to see Entire Configuration
Hi all, This may sound strange, but i have a question.. is there any commands which we can use to see the entire TC configurations.. iam new to this TC , thanks, Rajesh Rajesh Revuru, Res:105 smith lane,#33, Syracuse-NY 13210. Ph.315-422-8908(R) Ph.315-443-9120(O) --------------------------------- Do You Yahoo!? Yahoo! Auctions Great stuff seeking new owners! Bid now!
2012 Nov 20
2
[LLVMdev] Extended Inline asm with double data type crashes clang
Hi, Clang crashes when below snippet of code is compiled (used latest svn version) *double func1() { double x ;* * asm ( "" : "=r"(x) : "0"(x) ); return x; }* > *clang -S test1.c* > *Assertion failed: (PartVT.isInteger() || PartVT == MVT::x86mmx) && ValueVT.isInteger() && "Unknown mismatch!", file
2019 Mar 12
2
Query about JIT
Hi Alexey, Thank you very much for your detailed reply, will look into the resources indicated. I'd like to avoid C++ if possible, let me see how it goes. Regards, Rajesh Jayaprakash On Tue 12 Mar, 2019, 6:35 PM Sachkov, Alexey, <alexey.sachkov at intel.com> wrote: > Hi Rajesh, > > If I understand correctly, libclang is a C interface to Clang features, > not LLVM. That
2011 Apr 17
1
converting data.frame into a numeric ( integer) form
Hi Everyone, I am relatively new to R and would appreciate your help on this problem that I encontered this morning. When running an ordinal IRT model using Ratings package on R, I keep getting this error message. ord.out<-ordrating(UNORD, burnin = 1000, mcmc = 40,000, thin = 400, tune = 1, verbose = 1000, seed = NA) Error in as.vector(as.integer(Y)) : (list) object cannot be coerced to
2012 Jun 08
2
remove leading slash
Hello, How do I change this: > cnt_str [1] "\002" "\001" "\102" ...to this: > cnt_str [1] "2" "1" "102" Having trouble because of this: > nchar(cnt_str[1]) [1] 1 Thanks! Ben [[alternative HTML version deleted]]