Tags » Qin

Dialogue with Emperor Qin.

     
Dialogue with Emperor Qin : China EU exhibition
Photo credit by Ivibites photography

Photography

How can I seperate all maximum length values in a character vector in R

I have made a function, which basically outputs multiple length strings, i.e., for example,

"110110" "110"    "101"    "011" 

Now, I assigned the output of the function in a variable a, 96 more words

Stackoverflow

VB Script - Find duplicate within same text file

I’m new to VBScript and I’m trying to:

-Read a text file and find duplicates
-Copy the duplicate line to another text file

I’ve already have the following code. 75 more words

Stackoverflow

How can I replace numeric values by characters in R?

I have a file like this.

"1" 10 2 0 0 0 0 0 0 0 0 0 0 0 4 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0
"2" 10 3 6 17 11 15 8 17 14 1 42 21 22 15 9 9 17 12 9 16 4 8 12 29 23 11 0 0 0 0
"3" 10 4 39 39 14 33 16 23 37 21 29 22 46 26 16 26 21 22 21 10 16 3 10 14 20 12 6 0 0 0
"4" 100 18 0 0 0 1 0 0 0 0 0 0 2 0 0 1 0 2 8 5 2 1 2 4 9 6 4 3 0 0
..................... 177 more words
Stackoverflow

How can I replace numeric values by characters in R?

I have a file like this.

"1" 10 2 0 0 0 0 0 0 0 0 0 0 0 4 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0
"2" 10 3 6 17 11 15 8 17 14 1 42 21 22 15 9 9 17 12 9 16 4 8 12 29 23 11 0 0 0 0
"3" 10 4 39 39 14 33 16 23 37 21 29 22 46 26 16 26 21 22 21 10 16 3 10 14 20 12 6 0 0 0
"4" 100 18 0 0 0 1 0 0 0 0 0 0 2 0 0 1 0 2 8 5 2 1 2 4 9 6 4 3 0 0
..................... 177 more words
Stackoverflow

How can I replace numeric values by characters in R?

I have a file like this.

"1" 10 2 0 0 0 0 0 0 0 0 0 0 0 4 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0
"2" 10 3 6 17 11 15 8 17 14 1 42 21 22 15 9 9 17 12 9 16 4 8 12 29 23 11 0 0 0 0
"3" 10 4 39 39 14 33 16 23 37 21 29 22 46 26 16 26 21 22 21 10 16 3 10 14 20 12 6 0 0 0
"4" 100 18 0 0 0 1 0 0 0 0 0 0 2 0 0 1 0 2 8 5 2 1 2 4 9 6 4 3 0 0
..................... 178 more words
Stackoverflow

PSWhy is this code in R not working properly?

reps <- function(s, n) paste(rep(s, n), collapse = "") # repeat s n times

find.string <- function(string, th = 3, len = floor(nchar(string)/th)) {        
    for(sublen in len:1) 
    {
        for(inlen in 0:sublen) 
        {
            pat <- paste0("((.{", sublen-inlen, "})(.)(.{", inlen, "}))", reps("(\\2.\\4)", th-1))
            r <- regexpr(pat, string, perl = TRUE)
            if (attr(r, "capture.length")[1] > 0)
            {
                if (r > 0) 
                {
                    substring(string, r, r + attr(r, "capture.length")[1] - 1)
                }  
            }
        }             
    }             
}
… 113 more words
Stackoverflow