Displaying 20 results from an estimated 1000 matches similar to: "search for string insider a string"
2010 Mar 09
5
data frame select max group by like function
Hi, I have a data frame with 3 columns: ID, year and score. How can I
select for each unique ID, the year that has the max score? For
example, for data frame
ID, year, score
tom, 1995, 88
rick, 1994, 90
mary, 2000, 97
tom, 1998, 60
mary, 1998,100
I shall have
ID, year, score
tom, 1995, 88
rick, 1994, 90
mary, 1998,100
Thanks,
Richard
[[alternative HTML version deleted]]
2009 Apr 13
3
toupper does not work in sub + regex
Hi, I don't know what I am doing wrong to the toupper does not seem
working in sub + regex. The following returns 's' not the upper class
'S' as I expect:
sub("q_([a-z])[a-zA-Z]*",toupper('\\1'),"q_sviRaw")
Can someone tell me where I did wrong?
Thanks,
Richard
[[alternative HTML version deleted]]
2010 Oct 07
3
aggregate text column by a few rows
Hi, R function aggregate can only take summary stats functions, can I
aggregate text columns? For example, for the dataframe below,
> a <- rbind(data.frame(id=1, name='Tom',
hobby='fishing'),data.frame(id=1, name='Tom',
hobby='reading'),data.frame(id=2, name='Mary',
hobby='reading'),data.frame(id=3, name='John',
2010 Sep 16
3
get top n rows group by a column from a dataframe
Hi, is there an R function like sql's TOP key word?
I have a dataframe that has 3 columns: company, person, salary
How do I get top 5 highest paid person for each company, and if I have
fewer than 5 people for a company, just return all of them?
Thanks,
Richard
[[alternative HTML version deleted]]
2009 Jun 08
1
Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number
Hi,
This is not exactly an R question but I am trying to use gsub to replace
a string that contains 5-9 alpha-numeric characters, at least one of
which is a number. Is there a good way to write it in a one line regex?
Thanks,
Richard
2010 Nov 22
2
aggregate a Date column does not work?
Hi, I am trying to aggregate max a Date type column but have weird
result, how do I fix this?
> a <- rbind(
+ data.frame(name='Tom', payday=as.Date('1999-01-01')),
+ data.frame(name='Tom', payday=as.Date('2000-01-01')),
+ data.frame(name='Pete', payday=as.Date('1998-01-01')),
+ data.frame(name='Pete',
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi,
I have a correlation matrix of about 3000 items, i.e., a 3000*3000
matrix. For each of the 3000 items, I want to get the top 50 items that
have the highest correlation with it (excluding itself) and generate a
data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those
3000 items each repeat 50 times, and ID2 is the top 50 correlated items
with ID,
2010 Sep 27
4
Fitting problem
Hi,
I have a function that generates a set of data but I am having problems
determining the parameters using the nls fitting procedure.
####
"MH"<-function(field,diameter,mu=10e-7,sig=0.1,Ms=100,chi=0){
#variables mu, sig, chi, Ms
#input: field and diameter
#all in CGS
rho <- 5
kb <- 1.38e-16
t <- 300
length.d<-length(diameter)
length.H<-length(field)
2009 May 26
1
passing "..." arguments to a function called by eval()
Hi everyone,
I am starting learn to call C code from within R. So far, I've been
trying toy problems to see if I can get them to work. One of the things
I'd like to do is pass an arbitrary R function to C, evaluate the value
in the C code using eval, and then return it. I also want to allow an
arbitrary number of arguments to the function using "...".
The code for my toy
2015 Apr 10
1
How can I have new users/groups to include posixAccount/posixGroup schema automatically?
Greetings, Rowland Penny!
>>>>>>>>> well tough, the smbldap-tools were written to do a job, map windows
>>>>>>>>> users to unix users and vice versa.
>>>>>>>> No. smbldap-tools were doing exactly the same as AD do: kept all users in one
>>>>>>>> database.
>>>>>>>>
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states:
Return an array obtained from an input array by sweeping out a summary statistic.
So what does it mean "weeping out a summary statistic"?
Thank you.
Kevin
2006 Mar 13
3
problem updating mulitple divs with ajax
i''m having some issues updating multiple divs via ajax. perhaps someone can
lend some assistance.
i''ve got 2 divs:
user_list and user_form.
when a person clicks the "edit this user" or "add new user" link the
user_form div is updated via an ajax call and the form is shown in the
user_form div.
this form is a remote form. it submits to either the update
2013 Apr 09
5
Error when using fitdist function in R
Hello everyone,
I was trying to do some distribution fitting with a numerical field called
Tolls. The sample size = 999 rows.
Basically I assigned the Toll data to a new variable K by doing:
k<-dtest$Toll
After that, tried to fit a gamma distribution by doing: fitG<-fitdist(k,
"gamma")
Then the following messages showed (oh and I checked for empty rows before
doing this):
2015 Apr 10
2
How can I have new users/groups to include posixAccount/posixGroup schema automatically?
Greetings, Rowland Penny!
>>>>>>> well tough, the smbldap-tools were written to do a job, map windows
>>>>>>> users to unix users and vice versa.
>>>>>> No. smbldap-tools were doing exactly the same as AD do: kept all users in one
>>>>>> database.
>>>>>>
>>>>> Similar, but not the same,
2010 Jul 02
3
Good Package(s) for String and URL processing?
Are there packages that allow improved String and URL processing?
E.g. extract parts of a URLs such as sub-domains, top-level domain,
protocols (e.g. https, http, ftp), file type based on endings, check
if a URL is valid or not, etc...
I am currently only using split and paste. Are there better and more
efficient ways to handle strings e.g. finding sub-strings or to do
pattern matching?
What
2010 Mar 15
2
tcltk and R
I have had some comments on sqldf regarding its dependence on tcltk
such as the second last sentence on this blog post:
http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://www.wentrue.net/blog/%3Fp%3D453&prev=http://blogsearch.google.com/blogsearch%3Fhl%3Den%26ie%3DUTF-8%26q%3Dsqldf%26lr%3D%26sa%3DN%26start%3D10
sqldf does not directly use tcltk but it does use strapply in
2010 May 05
1
extracting a matched string using regexpr
Given a text like
I want to be able to extract a matched regular expression from a piece of
text.
this apparently works, but is pretty ugly
# some html
test<-"</tr><tr><th>88958</th><th>Abcdsef</th><th>67.8S</th><th>68.9\nW</th><th>26m</th>"
# a pattern to extract 5 digits
> pattern<-"[0-9]{5}"
#
2008 Aug 12
2
perl expression question
I have a string such as
fileName<-"Agg.20.20.20-all-01".
All I want to do is pull the "20.20.20" and the "all" as strings.
Obviously, they aren't always those values.
The "20.20.20" can be "30.30.30" but it's always after the . which is
next to the second g in Agg and it's always the same length. The all
might not always be
2011 Oct 29
0
samba 3.5.6 & win2k8 r2, session request fails
Hi
I've been trying to join a debian6 (IP: 172.16.0.180) box to a win2k8 r2 active directory (ORCHARD, IP: 172.16.0.200), without much success.
The settings for samba and kerberos are correct:
- and kinit works fine
The error string returned is: 'failed to lookup DC info for domain 'ARIAS.INT' over rpc: The network name cannot be found'