similar to: Which function to use: grep, replace, substr etc.?

Displaying 20 results from an estimated 2000 matches similar to: "Which function to use: grep, replace, substr etc.?"

2018 May 23
2
Pasar palabras de una lista a una variable del dataframe
Muchas gracias Carlos, Me da error al hacerlo. Mi variable donde quiero que localice las palabras de la lista tiene más de una palabra, no se si puede ser por eso. Gracias El Mar, 22 de Mayo de 2018, 20:15, Carlos Ortega escribió: > Hola, > > Aquí tienes un ejemplo (reproducible)... > > #----------------------- >> # Generar nombres de mujer >> library(randNames)
2013 Mar 06
1
print justify
Hi everyone, I'm trying to print a table justified to the left, but it doesn't work. Any hints? KennArt <- data.frame(NR=c(171,172,174,175,176,177,181,411,980), TYP=c("K?rnermais", ?"Corn Cob Mix", "Zuckermais", "Mischanbau (Silo)Mais/Sonnenblumen", ?"Mais mit Bejagungsschneise in gutem landwirtschaftlichen und ?kologischen Zustand",
2012 May 04
1
sem error message
Hello, I tried to do a 'sem' analysis for data of how blueberry consumption by birds is influenced by a pollution gradient, using distance and vegetation structural and composition variables, but I got the following error message: Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : S must be a square triangular or symmetric matrix This may be very
2007 Dec 11
4
EL5.1 client problems
Hi all, I attempted to add an EL5.1 client to our puppet server (EL5), and after signing the client cert, got the error "Certificates were not trusted: hostname not match with the server certificate" I found the mailing list discussion and the relevant page: http://www.reductivelabs.com/trac/puppet/wiki/RubySSL-2007-006 As far as I can tell, my puppermaster''s cert CN matches
2011 Feb 08
4
Interactions in a nls model
I am interested in testing two similar nls models to determine if the lines are statistically different when fitted with two different data sets; one corn, another soybean. I know I can do this in linear models by testing for interactions. See Introductory Statistics with R by Dallgaard p212-218 for an example. I have two different data sets I am comparing to lai. ci.re should have very
2023 Nov 30
1
back tick names with predict function
I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.? I'm trying too construct some nice vectors that can be used for plotting the two types of regression intervals.? I think it works with normal column heading names but it fails when I have "special" back-tick names.? Can anyone help with how I would reference these?? Short of
2011 Oct 13
8
Remove specific rows in a matrix/data.frame
Hi, imagine the following matrix/data.frame Letter Number a 1 a 1 b 1 b 0 c 0 c 1 d 0 d 0 If the numbers for two identical letters are also identical then I want to remove either the first or the second row of that letter. If for a letter the numbers are 1 and 0 I want to remove the row with the 0. That means if the code works I would and up with the following matrix/data.frame Letter
2010 Apr 23
2
read.csv data frame thousands separator
Dear group, Here is my df, trades1 : trades1 <- structure(list(Instrument.Long.Name = c("CORN", "CORN", "CORN", "CORN", "CORN", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "STANDARD LEAD USD", "STANDARD LEAD USD", "SPCL
2023 Nov 30
1
back tick names with predict function
?s 17:38 de 30/11/2023, Robert Baer escreveu: > I am having trouble using back ticks with the R extractor function > 'predict' and an lm() model.? I'm trying too construct some nice vectors > that can be used for plotting the two types of regression intervals.? I > think it works with normal column heading names but it fails when I have > "special"
2011 Oct 06
3
Duplicate elements of a vector
Hi, let's assume I have the following vector a: 1 5 23 How can I use R to duplicate the elements so that my new vector looks like: 1 1 5 5 23 23 Many thanks, Syrvn -- View this message in context: http://r.789695.n4.nabble.com/Duplicate-elements-of-a-vector-tp3879561p3879561.html Sent from the R help mailing list archive at Nabble.com.
2010 Sep 03
5
how to get row name of matrix when result is a vector
Hi, the R code: a <- matrix(c(1,5,4,3,7,10,34,4,3,8,6,5,12,17,45,3,2,45,46,47,3,4,22,12,21), nrow=5) rownames(a) <- c("a","b","c","d","e") a a[which(a[,3] < 8), ] a[which(a[,3] < 6), ] produces the following output: > a [,1] [,2] [,3] [,4] [,5] a 1 10 6 3 3 b 5 34 5 2 4 c 4 4 12 45 22 d
2010 Apr 28
1
gsub,regex and replacing
Dear group, I need to modify some characters in a data frame. I want to use gsub and the regex functionalities to do this. Here is the data frame (df): DESCRIPTION prix quantity 1 CORN Jul/10 -1.5 0 2 CORN May/10 -1082.0 -3 3 ROBUSTA COFFEE (10) Jul/10 11084.0 8 4 SOYBEANS Jul/10 1983.5
2011 Oct 13
3
Create order of numbers based on a given vector
Hello! If I have a vector vec <- c(FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE FALSE) I can I create the following order of numbers based on vector vec: 1, 2, 2, 3, 3, 3, 4, 5 Whenever there is a FALSE I increase the number (starting with 1). Whenever there is a TRUE I set the same number as the previous FALSE has been assigned to. I would be happy for any input Cheers, Syrvn -- View
2010 Jun 01
1
data frame manipulation ddply
Dear group, Here is my data frame: futures <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "LIVE CATTLE Aug/10", "LIVE CATTLE Aug/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11
2010 May 27
1
switch function
Dear group, Here is my df : trades <- structure(list(Trade.Status = c("DEL", "INS", "INS"), Instrument.Long.Name = c("SUGAR NO.11", "CORN", "CORN"), Delivery.Prompt.Date = c("Jul/10", "Jul/10", "Jul/10"), Buy.Sell..Cleared. = c("Sell", "Buy", "Buy"), Volume = c(1L, 2L, 1L),
2010 May 11
1
merging data frame
Dear group, I have 3 data frames I would like to merge. Here they are: pose16 <- structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SUGAR NO.11
2011 Aug 23
3
R system command does not work with objects/variables
Hello! with the R system command I would like to call a perl script which needs an input directory and an output directory in form of a path. When I put in the path directly it works. The script line looks as follows: system("perl '../path1' '../path2' '../path3'") If I store the path in a variable/object and call the perl script again it does not run and I
2010 Apr 28
3
data frame move columns
Dear group, Here is my df: avprix <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), prix = c(-1.5, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0), fees = c(-8.64, -30.24, -26.4, -25.92, -37.5,
2010 May 11
1
merge two data frames
Dear group, I have these 2 following data frame: allcon <- structure(list(DESCRIPTION = structure(1:17, .Label = c("COFFEE C Jul/10", "COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB NATURAL GAS May/10", "ROBUSTA COFFEE (10)
2010 Jun 01
1
data frame manipulation with zero rows
Dear group, Here is the kind of data.frame I obtain every day with my function : futures <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "LIVE CATTLE Aug/10", "LIVE CATTLE Aug/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR