Displaying 20 results from an estimated 2000 matches similar to: "How to remove rows based on frequency of factor and then difference date scores"
2008 Apr 09
2
fuzzy merge
Hi,
I would like to merge two data frames. It is just that I want the merging to be done with some kind of a fuzzy criterion. Let me explain.
My first data frame looks like this :
ID1 time1 dt
1 2008-01-02 13:11 10
2 2008-01-02 14:20 20
3
2012 Oct 23
3
frequency
Hello,
I have a data as follow:
ID Visit
xa1
xa2
yb1
yc23
yb33
I want to look at frequency of visit for ID and create a new column as response .
For example my response would be 2 for x and 3 for y.
I think I need to write a loop, but I don't know how.
I really appreciate your help.
Thanks a lot.
Best,Farnoosh Sheikhi
[[alternative HTML version deleted]]
2011 Aug 29
3
Basic question about re-writing for loop as a function
Hello-
Sorry to ask a basic question, but I've spent many hours on this now
and seem to be missing something.
I have a loop that looks like this:
mainmat=data.frame(matrix(data=0, ncol=92, nrow=length(predata$Words_MH)))
for(i in 1:length(predata$Words_MH)){
for(j in 1:92){
mainmat[i,j]=ifelse(j %in%
as.numeric(unlist(strsplit(predata$Words_MH[i], split=","))),
2009 Sep 03
1
Output from as.windrose() in oce package baffles me
I'm having trouble understanding the output from as.windrose(). For one
thing, data on a boundary between sectors seem to be left out of the
counts. I assume that explains the missing point in the output below
(angle 45). Shouldn't one side of each sector interval be open, to
include values such as my 45 in the example? Also, why does the angle
180 in my input apparently not result in
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2012 Dec 09
1
Some coefficients are doubled when I use the step() function
Hello-
Such a strange problem, can't figure it out at all. Using binomial glm
models, and the step() function, so the call looks like this:
sectionmodel = glm(formula = Target3 ~ S1Q12_NUM.1 + S1Q9_NUM.1 + S1Q5_NUM.1 +
S1Q7_NUM.1 + S1Q8_NUM.1 + S1Q6_NUM.1 + S1Q10_NUM.1 + S1Q12_BURG.1 +
S1Q12_CD.1 + S1Q4.1 + S1Q12_OTHVIOL.1 + S1Q8.1 + S1Q12_GBH.1 +
S1Q11.1 + S1Q7.1 + S1Q12_THEFT.1
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
> dt1 <- as.Date("2004-12-31")
> dt2 <- as.Date("2005-12-31")
> seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month")
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D
2010 Aug 05
3
How to extract se(coef) from cph?
Hello,
I am modeling some survival data wih cph (Design). I have modeled a predictor
which showed non linear effect with restricted cubic splines. I would like to
retrieve the se(coef) for other, linear, predictors. This is just to make nice
LateX tables automatically. I have the coefficients with coef().
How do I do that?
Thanks,
David Biau.
[[alternative HTML version deleted]]
2011 May 27
1
Subset command and the : operator
Hello-
I have some code that looks like this:
with(mydatalocal, sum(table(Service[Time==5:8])))
This is designed to add up the numbers of responses between the Time
codes 5 to 8 (which are integers and refer to quarters). Service is
just one of the variables, I'm just trying to count the number of
responses so I picked any of the variables. However, there is
something wrong, it returns far
2011 Jun 30
1
Match strings across two differently sized dataframes and copy corresponding row to dataframe
Hello-
Sorry, this is a bit of a noob question, but I can't seem to progress
it any further.
I have two dataframes which contain a series of strings which exactly
match. The problem is one has more rows than the other (more cases
have been added) and they have been sorted so that they are not in the
same order. The smaller dataframe, though, contains in another column
which has codes
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I want to extract only those columns
> that are numeric(double) or integer to do
2011 Jun 20
2
Replace selected columns of a dataframe with NA
I am using the following command to replace all the missing values and
assorted typos in a dataframe with NA:
mydata[mydata>80]=NA
The problem is that the first column contains values which should be
more than 80, so really I want to do it just for
mydata[,2:length(mydata)]
I can't seem to re-write the code to fit:
mydata[,2:length(mydata)>80]=NA # no error message, but doesn't
2010 Sep 08
3
Saving/loading custom R scripts
Hi,
How does R automatically load functions so that they are available from the
workspace? Is it anything like Matlab - you just specify a directory path
and it finds it?
The reason I ask is because I found a really nice script that I would like
to use on a regular basis, and it would be nice not to have to 'copy and
paste' it into R on every startup:
2010 Oct 03
4
Programmaticly finding number of processors by R code
Dear List
Sorry if this question seems very basic.
Is there a function to pro grammatically find number of processors in
my system _ I want to pass this as a parameter to snow in some serial
code to parallel code functions
Regards
Ajay
Websites-
http://decisionstats.com
http://dudeofdata.com
Linkedin- www.linkedin.com/in/ajayohri
2009 Nov 02
3
question about difference in date objects
Hi R Community:
I want to take the difference in two dates:
dt2 - dt1.
But, I want the answer in months between those 2 dates.
Can you advise me?
Please respond to: pzs6 at cdc.gov
Thank you!
Phil Smith
Centers for Disease Control and Prevention
2010 Sep 15
3
aggregate, by, *apply
Dear R gurus,
I regularly come across a situation where I would like to apply a function to a subset of data in a dataframe, but I have not found an R function to facilitate exactly what I need. More specifically, I'd like my function to have a context of where the data it's analyzing came from. Here is an example:
### BEGIN ###
func<-function(x){
m<-median(x$x)
if(m > 2 &
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel,
I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000
2010 Aug 06
3
How to apply apply?!
guRus
I have say a dataframe, d and I wish to do the following:
1) For each row, I want to take one particular value of the row and multiply
it by 2. How do I do it. Say the data frame is as below:
OPEN HIGH LOW CLOSE 1931.2 1931.2 1931.2 1931.2 0 0 0 999.05 0 0 0 1052.5
0 0 0 987.8 0 0 0 925.6 0 0 0 866 0 0 0 1400.2 0 0 0 754.5 0 0 0 702.6 0 0 0
653.25 0 0 0 348 0 0 0 801 866.55 866.55
2010 Sep 15
3
Creating publication-quality plots for use in Microsoft Word
Hi everyone,
I am trying to make some publication-quality plots for use in Microsoft
Word, but I am having trouble creating high-quality plots that are supported
by Microsoft Word.
If I use the R plot function to create the figure, the lines are jagged, and
the picture is not of high quality (same with JPEG(), TIFF(), and PNG()
functions). I have tried using the Cairo package, but it distorts
2003 Jan 02
1
samba 2.0.6 on HP-UX 11.0
I've had samba running cleanly on an HP-UX 11.0 system for many months, with
"DOMAIN" security and one-to-one account name mapping. A few days ago I
started getting password prompts on connection, and messages like this in
the log files...
[2003/01/02 15:46:36, 0] rpc_parse/parse_prs.c:(316)
prs_mem_get: reading data of size 60 would overrun buffer.
[2003/01/02 15:46:36, 0]