similar to: how to split several objects' names

Displaying 20 results from an estimated 20000 matches similar to: "how to split several objects' names"

2020 Apr 04
4
Legality of transformation
Please consider the following C code: * #define SZ 2048 int main(void) { int A[SZ]; int B[SZ]; int i, tmp; for (i = 0; i < SZ; i++) { tmp = A[i]; B[i] = tmp; } assert(A[SZ/2] == B[SZ/2]); }* On running -O1 followed by -reg2mem I get the following IR: *define dso_local i32 @main() local_unnamed_addr #0 {entry: %A = alloca [2048
2009 Apr 10
4
split a character variable into several character variable by a character
Dear Mao Jianfeng, "r-help-owner" is not the place for help, but: r-help at r-project.org (CC-ed here) In any case, strsplit() does the job, i.e.: > unlist(strsplit("BCPy01-01", "-")) [1] "BCPy01" "01" You can work with the whole variable, like: splitpop <- strsplit(df1$popcode, "-") then access the first part with >
2005 Jul 14
2
help: how to change the size of a window after it has been created
Hello, I wish to plot some figures in a window in turn, but the size of these figures is different, so how can I change the size of the window by resetting the parameters before each plotting? Thank you, Shengzhe
2008 Feb 07
1
How to split a factor (unique identifier) into several others?
Hello, I have a data frame with a factor column, which uniquely identifies the observations in the data frame and it looks like this: sample1_condition1_place1 sample2_condition1_place1 sample3_condition1_place1 . . . sample3_condition3_place3 I want to turn it into three separate factor columns "sample", "condition" and "place". This is what I did so far: #
2006 Apr 04
1
extending strsplit(): supply pattern to keep, not to split by
strsplit() is a convenient way to get a list of items from a string when you have a regular expression for what is not an item. E.g., > strsplit("1.2, 34, 1.7e-2", split="[ ,] *") [[1]]: [1] "1.2" "34" "1.7e-2" However, sometimes is it more convenient to give a pattern for the items you do want. E.g., suppose you want to pull
2005 Aug 25
3
Converting characters to numbers in data frames
I'm sure I'm missing something obvious here, but I can't find the solution (including in the FAQ etc.). I have a vector of names of variables like this: NRes.x.y. where x and y are numbers. I want to extract these numbers as numbers to use elsewhere. I can extract the numbers as a list of characters using strsplit(), and convert that to a data frame, e.g.:
2003 Mar 31
4
Convert char vector to numeric table
I'm a great fan of read.table(), but this time the data had a lot of cruft. So I used readLines() and editted the char vector to eventually get something like this: " 23.4 1.5 4.2" " 19.1 2.2 4.1" and so on. To get that into a 3 col numeric table, I first just used: writeLines(data,"tempfile")
2005 Jul 12
1
help: how to use tkevent.generate(...)
Hello, I use package "tcltk" to do some GUI programming, and want to find a function which can do the operation "click a button", just like using a mouse to click. If tkevent.generate can do that? I tried it as below, but failed. Please give me a hint! tt <- tktoplevel() tkwm.title(tt,"Simple Dialog") onOK <- function(){print("OK")} onCancel <-
2005 Jun 21
1
test for equality of two data sets with multidimensional variables
Hello there, I have two data sets with 14 variables each, and wish to do the test for equality of their covariance matrices and mean vectors. Normally these tests should be done by chi square test (box provided) and Hotelling's T square test respectively. Which R functions could do this kind of test? I just find some functions could do for one dimension, but no for multidimension. Some one
2009 Sep 07
2
using an array of strings with strsplit, issue when including a space in split criteria
Dear all, I'm having a problem understanding why a split does not occur with in the 2nd use of the function strsplit below: # text strings > txt <- c("sales to 23 August 2008 published 29 August", + "sales to 6 September 2008 published?11 September") # first use > strsplit(txt, 'published', fixed=TRUE) [[1]] [1] "sales to 23 August 2008 "
2012 Jan 12
3
strsplit() does not split on "."?
Any ideas what is wrong? > strsplit("a.b", ".") # generates empty strings with split="." [[1]] [1] "" "" "" > strsplit("a b", " ") # seems to work fine with split=" ", and other characters... [[1]] [1] "a" "b" > > R.Version() $platform [1]
2013 Sep 18
2
strsplit with a vector split argument
Hi, I find this behavior unexpected: --8<---------------cut here---------------start------------->8--- > strsplit(c("a,b;c","d;e,f"),c(",",";")) [[1]] [1] "a" "b;c" [[2]] [1] "d" "e,f" --8<---------------cut here---------------end--------------->8--- I thought that it should be identical to this:
2005 Jul 13
1
help: how to plot a circle on the scatter plot
Hello, I have a data set with 15 variables, and use "pairs" to plot the scatterplot of this data set. Then I want to plot some circles on the small pictures with high correlation(e.g. > 0.9). First, I use "cor" to obtain the corresponding correlation matrix (x) for this scatterplot. Second, use "seq(along = x)[x > 0.9]" to find the positions of the small
2011 Dec 06
2
split date nad time
Dear R Users, given that: > AggDateTime[960:962] [1] "2011-08-25 23:59:00 BST" "2011-08-26 00:00:00 BST" [3] "2011-08-26 00:01:00 BST" > unlist(strsplit(as.character(AggDateTime[960])," ", fixed=TRUE)) [1] "2011-08-25" "23:59:00" > unlist(strsplit(as.character(AggDateTime[962])," ", fixed=TRUE)) [1]
2009 May 07
1
extending strsplit to handle missing text that doesn't have the target on which to split
I am sure there is an obvious answer to this that I'm missing but I can't find it. I'm parsing headers of Emails and most have a date like this: "Wed, 16 Nov 2005 05:28:00 -0800" and I can parse that using: tmp.dat.data <- matrix(unlist(strsplit(headers$Date.line,",")), ncol = 2, byrow = TRUE) before going on to look at the day and date/time data.
2005 Jun 29
2
How to convert "c:\a\b" to "c:/a/b"
I couldn't resist adding a more literal answer unback <- function(x) { chars <- unlist(strsplit(deparse(x),"")) chars <- chars[-c(1,length(chars))] paste(gsub("\\\\","/",chars),collapse="") } unback("\n") | David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph:
2005 Jun 29
2
How to convert "c:\a\b" to "c:/a/b"
I couldn't resist adding a more literal answer unback <- function(x) { chars <- unlist(strsplit(deparse(x),"")) chars <- chars[-c(1,length(chars))] paste(gsub("\\\\","/",chars),collapse="") } unback("\n") | David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph:
2013 Apr 28
2
Multiple assignment to several columns in dataset
Hello! I've time stamp ('time') field in dataset ('dt') with values like "18:10", "19:43", .... I need to split time field into hour and minutes and add both as new columns to dataset. We are able to do it in bash+awk, but curious to stay within R codebase as much as possible. For now we are using such solution: tstamp <- strsplit(dt$time,
2023 Apr 12
3
Split String in regex while Keeping Delimiter
Hello List, ? I have a dataset consisting of strings that I want to split while saving the delimiter. ? Some example data: ?leucocyten + gramnegatieve staven +++ grampositieve staven ++? ?leucocyten ? grampositieve coccen +? ? I want to split the strings such that I get the following result: c(?leucocyten +?, ??gramnegatieve staven +++?, ??grampositieve staven ++?) c(?leucocyten ??, ?grampositieve
2010 Aug 02
1
read the middle of a file
Hello, The other day Justin Peter presented a mini program to plot a topographic map with an overlay of the worldHires. I seemed interesting so I checked the ETOPO5 site and find that there is a new file ETOPO1 with a 1 minute grid. I downloaded it and tried a similar procedure. Now the ETOPO1.gz is 1 Gb and the uncompressed file is 5 Gb. They do not fit into my laptop. I tried the following