similar to: Split String in regex while Keeping Delimiter

Displaying 20 results from an estimated 400 matches similar to: "Split String in regex while Keeping Delimiter"

2023 Apr 12
1
Split String in regex while Keeping Delimiter
On Wed, 12 Apr 2023 08:29:50 +0000 Emily Bakker <emilybakker at outlook.com> wrote: > 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 ++?) >
2023 Apr 12
2
Split String in regex while Keeping Delimiter
I thought replacing the spaces following instances of +++,++,+,- with "\n" and then reading with scan should succeed. Like Ivan Krylov I was fairly sure that you meant the minus sign to be "-" rather than "?", but perhaps your were using MS Word as an editor which is inconsistent with effective use of R. If so, learn to use a proper programming editor, and in any case
2023 Apr 13
1
Split String in regex while Keeping Delimiter
Dear Emily, Using a look-behind solves the split problem in this case. (Note: Using Regex is in most/many cases the simplest solution.) str = c("leucocyten + gramnegatieve staven +++ grampositieve staven ++", "leucocyten ? grampositieve coccen +") tokens = strsplit(str, "(?<=[-+])\\s++", perl=TRUE) PROBLEM The current expression does NOT work for a different
2023 Dec 18
3
Function with large nested list
Hello list, I want to make a large rulebased algorithm, to provide decision support for drug prescriptions. I have defined the algorithm in a function, with a for loop and many if statements. The structure should be as follows: 1. Iterate over a list of drug names. For each drug: 2. Get some drug related data (external dataset). Row of a dataframe. 3. Check if adaptions should be made to
1999 Dec 04
7
Samba newbie question
I am a newbie to Samba and have read the HOWTO-SMB and README files. Before you say RTFM, I have some very basic questions. The goal for me is to use the NT systems local printer, CD-R and scanner devices. The SMB documents talk a lot about the Client and Server. The source I have downloaded will create a smbd and nmbd. 1. Do I need anything running on the NT? 2. Do I need any special options
2004 Nov 11
5
expressions and paste
I have written a function to plot data which will be used for various different chemistries. A simplified version is: plot_data <- function(risk,levels,chem,sd2,measure){ plot(risk, levels,main=paste ("per", sd2, measure, "\n in usual", chem)) } The problem is with the title. This works fine if the variable "chem" is just text, but if it is an expression then
2000 Jun 16
3
login reporting (utmp?) problem on Linux
I have recently compiled and installed openssh-2.1.1p1 on a linux box. The login reporting does not seem to work properly. When logging into the box via ssh (protocol 1) utmp shows the user logged in and the tty properly, but the field for the login date/time and the field for originating host contain all NULLs. Is anyone else seeing this same behavior, or have I just done something really
2018 Aug 07
2
id <username> - doesnt list all groups
Hello, my enviroment: All Servers are Ubuntun 16.04-18.04 SAMBA AD DC Server and several SAMABA DOMAIN MEMBER (connected via WINBIND). In ADDC I've created a group "restrictaccess" and added some users. Now when im typing "id <username>" on a Domain Member, for some users the group "restrictaccess" are listed for some not! For example: ON DC: #
2019 Apr 22
2
Icecast not connecting
Hello, I’m reaching out because our online radio station (sites.up.edu/kdup/) has stopped streaming in the last week - the website itself works fine but when anyone attempts to listen to the live music stream they receive a message that says “cannot connect to the server “icecast.up.edu.” Do we need to update the server, or is this a problem that someone else can take care of? Let me know if I
2010 Aug 15
2
legend outside plot area
Hi, please can you help me. When I add a legend to a boxplot it appears inside the plot area, how do you get it into the margins? I have already changed the parameters so there is space for it on the margin on the right hand side of the graph. Thanks, Emily [[alternative HTML version deleted]]
2012 Mar 15
1
Equation as a character string
I'm trying to figure out if it's possible to use a character string as an equation, e.g: eqn1string <- "x^2 + x + 5" Then I want to tell R: 1) that eqn1string is actually an equation (even though it was stored as a character string), and 2) to apply the equation to a specified value of x (e.g. given x <- 6, what is the result of the equation). Thanks in advance for any
2002 Jul 28
2
timestamp on symlink
rsync does not sync the timestamp on symlink (Solaris 8). It is probablly due to the limitation of Unix implementation of symlink, but I would like to know why rsync/Unix does not do this, and what we can do about it. Is the conclusion that "rsync syncs everything except the timestamp on symlink"? Why do I need timestamp on symlink? Supposed something stopped working because something
2010 Oct 06
3
what is the "NOT IN" operator
Good day, I need to subset a data by removing several rows. I know the %in% operator, i.e. sub <- mydata[group %in% c("A","B","E","G"), ] What I need is the opposite, that is remove rows and/or columns. What is the operator for "NOT IN"? I tried (i)! %in% and (ii) ^%in% and both resulted in a "could not find function" error.
2007 Jun 07
1
new data frame for loop
I have a data frame with three columns, one coded as a factor. I would like to separate my data out into separate data frames according to the factor level. Below is a simple example to illustrate. I can get R to return the data in the correct format but cannot work out how to get separate data frames. I am a newcommer to programming in R so am not sure what I am missing! Thanks, Emily
2010 Nov 05
1
newbie question on importing and parsing file by row
Hi, I'm new to R and I have a file with many rows of values. Each row contains a title and values for a contingency table e.g. row 1= title 8 0 37796 47 which is a table called 'title' with values 8 0 37796 47 I would like to know how I can import this using R and for each row calculate a p value using the fisher test. Using each p value I will do multiple a correction. I am
2012 Jun 18
1
Changing many csv files using apply?
Dear all, I have many csv files whose contents I want to change a bit en masse. So far, I've written code that can change them in a for loop, like so: # Subset of files in the folder I want to change subset = "somestring" # Retrieve list of files to change filelist=list.files() filelist = filelist[grep(subset, filelist)] for(i in 1:length(filelist)){ setwd(readdir)
2012 Jan 07
2
glm or transformation of the response?
Hi Dr. Snow, I am a graduate student working on analyzing data for my thesis and came across your post on an R forum: The default link function for the glm poisson family is a log link, which means that it is fitting the model: log(mu) ~ b0 + b1 * x But the data that you generate is based on a linear link. Therefore your glm analysis does not match with how the data was generated
2013 Jul 01
1
Male and female signs as subscript in plot
Hello, I'd like to add labels to my plot that include a male or female symbol as subscript. I'm working in Windows Vista and R 3.0.0. I am able to add the male symbol to the plot as regular text (NOT as subscript), e.g. with: mtext("Male\u2642") This displays the word "Male" followed by the male symbol on the plot. But "\u2642" does not work when I try to
2013 Apr 05
2
Text Encoding
Dear R-Help, I am using the RDF package/ R 2.14 with the RDF package to download data from a website, and then use R to manipulate it. Text on the website is UTF-8. The RDF package's rdf_load command is converting it into a different encoding, which converts non-ASCII characters to unicode codes. On the webpage/sparql RDF: "4.5µg of cDNA was used" In R, the RDF triple gives:
2006 Apr 04
4
strange problem with table displayed
Hi I have a strange problem maybe someone have similar experience? I have a simple ruby program that grabs some datat from database and displays it in browser. It displays a column of number and gives a total at the bottom. For some reason when viewing the page in browser it cuts off about have the table and gives no total. And even some of the data in the table is wrong like instead of