Displaying 20 results from an estimated 11000 matches similar to: "gsub"
2003 Oct 09
1
subsetting objects
I want to be able to exctract a matrix from a data frame that contains repeated measurements for individuals. i.e I want to exctract the second observation for each individual in the study.
Is there a way of doing this?
I guess what I am trying to ask is if there as a multidimensional version of aggregate() as in aggregate(data, list(data[,"ID"]), function(x) x[2,])
but aggregate will
2003 Sep 10
2
coef names in lm
Dear all,
I am interested in finding out how to change the names of coefficients in
the lm function. I have a design matrix which I called "design" where each
variate has its own name. However when I issue the command:
lm.1<-lm(response~design-1, weights=some.weights)
and follow it with:
summary(lm.1)
it seems to paste as a character the names of the variates
with design i.e I
2003 Jul 08
1
readline and R
Dear R users,
I am trying to install R 1.7.1 on a sparc-sun-solaris2.8 system. although
gnu readline is installed and works fine on the parent directory, R is not
recognizing it.
I get the following in the config.log file.
configure:11627: checking for rl_callback_read_char in -lreadline
configure:11658: gcc -o conftest -g -O2 -L/usr/local/lib
conftest.c -lreadline -ldl -ltermcap -lm
2005 Aug 03
4
R CMD build error
Dear list,
I try to update the prabclus package.
R CMD check works nicely, no warnings, good results in all tests.
However, building the package fails:
ginkgo:/disk5/home/chrish/RAusw/libsrc R CMD build prabclus
* checking for file 'prabclus/DESCRIPTION' ... OK
* preparing 'prabclus':
* checking whether 'INDEX' is up-to-date ... OK
* removing junk files
* building
2004 Apr 06
2
percentile-percentile plot
Hi,
Is there a function that does percentile-percentile plot. I do not mean
the qqplot. I need to plot the percentiles rather than points themselves.
I am hoping for a plot that tells me that the x percentile of one data set
corresponds to the y percentile of the other. for example a point on the
plot of (.5, .2) will tell me that the 50th percentile of the first data
and the 20th percentile of
2005 May 20
4
issues with identical()
Hi all, hope you having a nice day,
I ahve this weird results with identical (probably I am not understanding
correctly what it does ...)
I have these two data frames and I issue :
> identical(temp, temp1)
[1] FALSE
However, these data frames are Nx2 and when I issue:
> identical(temp[,2], temp1[,2])
[1] TRUE
> identical(temp[,1], temp1[,1])
[1] TRUE
and the results from str
>
2005 Mar 23
4
non-derivative based optimization and standard errors.
Hi AlL,
I ahve this problem that my objective function is discontinous in the
paramaters and I need to use methods such as nelder-mead to get around
this. My question is: How do i compute standard errors to a problem that
does not have a gradient?
Any literature on this is greatly appreciated.
Jean,
2004 Oct 01
1
dataload for linux
Is there a dataload utility for linux. The link in genstat is down but I
managed to find the utility at:
http://gurukul.ucc.american.edu/econ/gaussres/UTILITYS/DATALOAD.HTM
but this is a dos/windows version.
Thank you
Jean
2004 Feb 05
1
lines and dates
Dear All,
I have the following data.frame
`data.frame': 1563 obs. of 4 variables:
$ Model :Class 'AsIs' chr [1:40] "Astro" "Astro" "Astro" "Astro"
$ Make :Class 'AsIs' chr [1:40] "Chevrolet" "Chevrolet"
$ Production : num 11219 12384 1082 5409 5458 ...
$ date :`POSIXlt', format: chr
2005 Jan 30
3
trellis graphics in loops
I have this awkward problem with trellis (lattice). I am trying to
generate some plots through loops but the .eps file is empty. When I
generate them in a list and print them outside the loop all is fine. this
is an example below:( nothing shows up in foo.eps, but all show up in
foo1.eps)
R vesion 2.0.1, lattice version 0.10-16, on a debian 2.6.8-1 kernel.
X <- data.frame(x=rnorm(10000),
2011 Nov 06
1
Deleting rows dataframe in R conditional to “if any of (a specific variable) is equal to”
Dear list,
I have been struggling for some time now with this code... I have this vector of unique ID "EID" of length 821 extracted from one of my dataframe (skate). It looks like this:
> head(skate$EID)
[1] "896-19" "895-8" "899-1" "899-5" "899-8" "895-7"
I would like to remove the complete rows in another dataframe
2001 Aug 02
1
gsub() and parenthesis symbols
Dear R-users --
I'm using R 1.3.0 on a PC running SuSE Linux 7.1. I'm confused by the
following behavior from the gsub() function. Am I doing something wrong?
## A string of characters
> string<-c("q","w","e","(",")","q","w","e")
## Use gsub to replace `q' with `A'
>
2002 Jul 23
2
sub() and gsub() (PR#1826)
Full_Name: Jerome Asselin
Version: 1.5.1
OS: linux redhat 7.2
Submission from: (NULL) (142.103.173.179)
gsub() return different answers depending on how the input
variables were created. Here is an example of code that
replicates the problem. The vectors y and yy appear to be
the same, but gsub() doesn't return the same answer.
It should remove all the blanks when I use the vector y,
but it
2011 Nov 06
1
Combining some duplicated rows & summing one of their column
Dear list,
I have this dataframe:
> names(events)
[1] "EID" "X" "Y" "trip" "tow" "catch" "effort" "depth"
[9] "season"
Where some of my unique ID "EID" appears more than once in 162 cases.
> length(events$EID)-length(unique(events$EID))
[1] 162
I would like to combined
2012 Jan 24
1
gsub semicolon with double quotation mark
Hi,
I would like to substitute a semicolon with two double quotation marks and
a comma inbetween.
It suppose to look like that:
I have:
FBpp0070086;FBpp0099643;FBpp0112915
I would like to have:
"FBpp0070086","FBpp0099643","FBpp0112915"
I tried with various numbers of backslashes, but noe have worked.
for example:
gsub(";", "\\\",\"",
2011 Jul 17
3
gsub() with unicode and escape character
Dear helpers,
I'm trying to replace a character with a unicode code inside a data
frame using gsub(), but unsuccessfully.
> data.frame(animals=c("dog","wolf","cat"))->my.data
> gsub("o","\u0254",my.data$animals)->my.data$animals
> my.data$animals
[1] "d??g" "w??lf" "cat"
It's not that a data
2004 Aug 27
3
gsub, backslash and xtable
R Version 1.9.1 (2004-06-21)
Mac OS X.3.5 Dual 2GHz PowerPC G5
GUI = "AQUA"
I have a data.frame comprising percentiles with the column headings
containing % characters, e.g.
> (pp <- colnames(temp2))
[1] "5%" "10%" "25%" "50%" "75%" "90%" "95%"
I use xtable to convert the data.frame to Latex but I want to
2018 Feb 17
2
readLines interaction with gsub different in R-dev
| Confirmed for R-devel (current) on Ubuntu 17.10. But ... isn't the regexp
| you use wrong, ie isn't R-devel giving the correct answer?
No, I don't think R-devel is correct (or at least consistent with the
documentation). My interpretation of gsub("(\\w)", "\\U\\1", entry,
perl = TRUE) is "Take every word character and replace it with itself,
converted to
2012 Sep 30
3
How to escape a forward slash with gsub, also does interpolation work with gsub?
I am trying this:
I want to replace all the text in between java comments:
/* start */
replace this text here
/* end */
I''m trying:
text.gsub(//* start */(.*)/* end *//im, replace_with)
But i''m getting errors relating to expecting keyword_end.
How should I be escaping /* and */ ?
Also, does string interpolation work in gsub regex? Say I had variables
like:
start_tag =
2011 May 05
1
Using GSUB to obtain a printing "\"
Hello. I'd like to be able to print variable strings which contain "\" as-is, without interpreting (for example) "abcde\nuvxyz" as having an embedded newline (or whatever other escaped instruction).
To do this, I've tried gsub, and here's some of my output (I've tried all kinds of variations to the arguments):
>