Displaying 20 results from an estimated 30000 matches similar to: "Read txt File contains character """
2012 Jul 07
11
Splitting a character vector.
I am lousy at simple regex and I have not found a solution to a simple problem.
I have a vector with some character values that I want to split.
Sample data
dd1 <- c( "XXY (mat harry)","XXY (jim bob)", "CAMP (joe blow)", "ALP (max jack)")
Desired result
dd2 <- data.frame( xx = c("XXY", "XXY", "CAMP",
2024 Apr 10
2
Exceptional slowness with read.csv
?s 06:47 de 08/04/2024, Dave Dixon escreveu:
> Greetings,
>
> I have a csv file of 76 fields and about 4 million records. I know that
> some of the records have errors - unmatched quotes, specifically.
> Reading the file with readLines and parsing the lines with read.csv(text
> = ...) is really slow. I know that the first 2459465 records are good.
> So I try this:
>
2012 Mar 01
2
read.table issue with "#"
Hello,
>
> The problem is that I get a the following error bacause anything after the
> # is ignored.
>
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
> :
> line 6 did not have 500 elements
>
> R thinks that line 6 has only 2 elements because of the #.
>
Use 'readLines' instead, followed by 'strsplit'.
In the
2023 Dec 07
1
Convert character date time to R date-time variable.
?s 16:21 de 07/12/2023, Sorkin, John escreveu:
> Colleagues,
>
> I have a matrix of character data that represents date and time. The format of each element of the matrix is
> "2020-09-17_00:00:00"
> How can I convert the elements into a valid R date-time constant?
>
> Thank you,
> John
>
>
>
> John David Sorkin M.D., Ph.D.
> Professor of
2013 Apr 26
3
converting character matrix to POSIXct matrix
I thought this is a common question but rseek/google searches don't yield
any relevant hit.
I have a matrix of character strings, which are time stamps,
> time.m[1:5,1:5]
[,1] [,2] [,3] [,4] [,5]
[1,] "08:00:20.799" "08:00:20.799" "08:00:20.799" "08:00:20.799"
"08:00:20.799"
[2,]
2024 Apr 10
1
Exceptional slowness with read.csv
That's basically what I did
1. Get text lines using readLines
2. use tryCatch to parse each line using read.csv(text=...)
3. in the catch, use?gregexpr to find any quotes not adjacent to a comma
(gregexpr("[^,]\"[^,]",...)
4. escape any quotes found by adding a second quote (using str_sub from
stringr)
6. parse the patched text using read.csv(text=...)
7. write out the parsed
2012 Sep 16
4
two questions about character manipulation
Dear all,
I want to manipulate a character string such as
ex<-"cbind(data$response1,data$response2)"
in R in two ways:
1) extracting the "response1" portion of ex
2) replacing "$" with "."
I am wondering that is it possible efficiently doing these in R?
Best
Ozgur
--
View this message in context:
2023 Apr 12
1
converting a character matrix into numeric....
Isn't this like trying to tie up the horse after it has left the barn? Why not figure all this out _before_ converting to xts?
On April 12, 2023 12:29:49 PM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
>Dear Rui,
> Not working. I have entirely removed the column containing % but am still bootless:
>
>> head(coredata(INFYTX))
> INFY
2023 Apr 12
1
converting a character matrix into numeric....
?s 19:57 de 12/04/2023, akshay kulkarni escreveu:
> Dear members,
> I have an xts object:
>
>> head(INFYTX)
> INFY Historical Data INFY Historical Data.1 INFY Historical Data.2
> 2003-04-16 "47.26" "44.28" "47.56"
> 2003-04-17 "46.30" "44.92"
2023 Apr 12
1
converting a character matrix into numeric....
Dear Rui,
Not working. I have entirely removed the column containing % but am still bootless:
> head(coredata(INFYTX))
INFY Historical Data INFY Historical Data INFY Historical Data INFY Historical Data
[1,] "47.26" "44.28" "47.56" "44.28"
[2,] "46.30" "44.92"
2023 Mar 30
2
single character in R, and how to manipulate it
Hi there,
I just noticed that "crt" is a graphical parameter, which is stated as follows in the help page of "par":
A numerical value specifying (in degrees) how single characters should be rotated. It is unwise to expect values other than multiples of 90 to work...
However, I did not find any code example to demo the usage of "crt", and even know how to present a
2012 Oct 18
4
speeding read.table
R 2.15.1
OS X
Colleagues,
I am reading a 1 GB file into R using read.table. The file consists of 100 tables, each of which is headed by two lines of characters.
The first of these lines is:
TABLE NO. 1
The second is a list of column headers.
For example:
TABLE NO. 1
COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10
2012 Nov 14
5
aggregate combination data
Dear R users,
I want to aggregate all *d *data from all combination of n *plots* taken
by k.
Thank very much!
My data is like that:
plot d 1 14 1 13 1 12 1 14 1 18 1 20 1 21 1
43 1 108 1 43 2 41 2 61 2 83 2 61 2 84 2 45 2 21 2 12 2 11 ... 100
10
100 12
--
---
Catalin-Constantin ROIBU
Forestry engineer, PhD
Forestry Faculty of Suceava
2018 Aug 05
2
Is this a bug in `[`?
Thanks.
This is exactly the doubt I had.
Rui Barradas
?s 05:26 de 05/08/2018, Kenny Bell escreveu:
> This should more clearly illustrate the issue:
>
> c(1, 2, 3, 4)[-seq_len(4)]
> #> numeric(0)
> c(1, 2, 3, 4)[-seq_len(3)]
> #> [1] 4
> c(1, 2, 3, 4)[-seq_len(2)]
> #> [1] 3 4
> c(1, 2, 3, 4)[-seq_len(1)]
> #> [1] 2 3 4
> c(1, 2, 3, 4)[-seq_len(0)]
2018 Aug 04
3
Is this a bug in `[`?
?s 15:51 de 04/08/2018, I?aki ?car escreveu:
> El s?b., 4 ago. 2018 a las 15:32, Rui Barradas
> (<ruipbarradas at sapo.pt>) escribi?:
>>
>> Hello,
>>
>> Maybe I am not understanding how negative indexing works but
>>
>> 1) This is right.
>>
>> (1:10)[-1]
>> #[1] 2 3 4 5 6 7 8 9 10
>>
>> 2) Are these right? They
2013 Jun 23
1
Scaling Statistical
Short question: Is it possible to use statistical tests, like the Augmented
Dickey-Fuller test, in functions with for-loops? If not, are there any
alternative ways to scale measures?
Detailed explanation: I am working with time-series, and I want to flag
curves that are not stationary and which display pulses, trends, or level
shifts.
>df
DATE ID VALUE2012-03-06 1
2013 Oct 31
1
Extracting values from a ecdf (empirical cumulative distribution function) curve
Hi R users,
I am a new user, still learning basics of R. Is there anyway to extract y
(or x) value for a known x (or y) value from ecdf (empirical cumulative
distribution function) curve?
Thanks in advance.
Mano.
[[alternative HTML version deleted]]
2013 Jul 22
4
How to split two levels several times?
Hi,
I have a small problem with the function split() and would appreciate your help.
I have a table called ?XXX? with 2 columns and 49 rows. The 49 rows belong to 8 different levels (electrode1, ...,electrode8). I want to split the table always at the row where ?electrode1? starts again so that I can export 7 individual dataframes (numbered ?dataframe1? to ?dataframe7?) which contain always
2013 Jul 14
4
diallel analysis
sir i could not find the plant breeding libraray in Rgui3.0.0
[[alternative HTML version deleted]]
2012 Nov 19
5
help on matrix column removal based on another matrix results
Hi everyone, now I am trying to finish writing the code (I had asked for
assistance on subtracting arrays)
This is what I what I am running in R:
> source("/home/ie/Documents/TTU/GA_Research/GLUE/R-Project/R_GLUE_Example/NSEr.R")
NSEr <- function (obs, sim)
{
{jjh <- (as.vector(obs) - sim)^2
Xjjhs <- apply(Xjjh, 2, sum)
Yii <- (obs - mean(obs))^2
Yiis <- apply(Yii, 2,