similar to: deleting data of a given date range.

Displaying 20 results from an estimated 5000 matches similar to: "deleting data of a given date range."

2013 Jan 04
2
Can you help me please
HI Fares, You could try this: dat1<- read.table(text=" date????? donation 3jan2003?? 20235 4jan2003?? 25655 5jan2003?? 225860 6jan2003?? 289658 7jan2003?? 243889 8jan2003?? 244338 9jan2003?? 243889 ",sep="",header=TRUE,stringsAsFactors=FALSE) The post is not very specific as to what you need.? I hope this works for you. library(xts)
2013 Feb 05
2
How to subset a data frame to include only first events
Hi there, I have data frame with columns ID and Date. There are multiple rows for each ID, but I only want to keep the *first* such row--i.e., the row corresponding to the earliest event. So if I had, say, 1000 rows of 100 IDs doing an average of ten events each, I'd run this trimming procedure and end up with a data frame containing 100 rows (one for each ID), where each row record that
2013 May 03
2
Write date class as number of days from 1970
Dear all, I have a dataset with one column being of class Date. When I write the output, I would like that column being written as number of days from 1970-01-01. I could not find anywhere a way to do it. Thanks, Marco -- View this message in context: http://r.789695.n4.nabble.com/Write-date-class-as-number-of-days-from-1970-tp4666155.html Sent from the R help mailing list archive at
2010 Mar 30
2
Need help to split a given matrix is a "sequential" way
I need to split a given matrix in a sequential order. Let my matrix is : > dat <- cbind(sample(c(100,200), 10, T), sample(c(50,100, 150, 180), 10, > T), sample(seq(20, 200, by=20), 10, T)); dat [,1] [,2] [,3] [1,] 200 100 80 [2,] 100 180 80 [3,] 200 150 180 [4,] 200 50 140 [5,] 100 150 60 [6,] 100 50 60 [7,] 100 100 100 [8,] 200 150 100 [9,]
2012 Nov 10
4
help on date dataset
Hi everybody, I am beginer in R and I need your precious help. I want to create a small function in R as in sas to retrieve date. I have a file with data that import in R. DATE PAYS nb_pays.ILI. 1 24/04/2009 usa 0 2 24/04/2009 usa 0 3 24/04/2009 Mexique 0 4 24/04/2009
2009 Mar 18
1
Cumulative Plot with Given X-Axis
Dear all, I have data that looks like this. In which I want to plot accumulative value of dat1 with respect to x-axis. Also plot it together with dat2. What's the common way to do it in R? I looked at ECDF from Hmisc, it doesn't seem to do what I want. In particular it doesn't allow us to give x-axis value. #x-axis dat1 dat2 -10 0.0140149 0.0140146 -9
2012 Sep 05
4
Summarizing data containing data/time information (as factor)
Dear R user I want to create a table (as below) to summarize the attached data (Test.csv, which can be read into R by using 'read.csv(Test.csv, header=F)' ), to indicate the day that there are any data available, e.g.value=1 if there are any data available for that day, otherwise value=0. 28/04 29/04 30/04 01/05 02/05 532703 0 1 1
2013 Mar 11
2
How to 'extend' a data.frame based on given variable combinations ?
Dear expeRts, I have a data.frame with certain covariate combinations ('group' and 'year') and corresponding values: set.seed(1) x <- data.frame(group = c(rep("A", 4), rep("B", 3)), year = c(2001, 2003, 2004, 2005, 2003, 2004, 2005), value = rexp(7)) My goal is essentially to
2012 Aug 06
2
deleting columns from a dataframe where NA is more than 15 percent of the column length
I have a dataframe of 10 different columns (length of each column is the same). I want to eliminate any column that has 'NA' greater than 15% of the column length. Do i first need to make a function for calculating the percentage of NA for each column and then make another dataframe where i apply the function? Whats the best way to do this.
2013 May 07
4
create unique ID for each group
Hey All, I have a dataset(dat1) like this: ObsNumber ID Weight 1 0001 12 2 0001 13 3 0001 14 4 0002 16 5 0002 17 And another dataset(dat2) like this: ID Height 0001 3.2 0001 2.6 0001
2008 Mar 25
2
Compare two data sets
I would like to compare two data sets saved as text files (example below) to determine if both sets are identical(or if dat2 is missing information that is included in dat1) and if they are not identical list what information is different between the two sets(ie output "a1", "a3" as the differing information). The overall purpose would be to remove "a1" and
2012 Jun 07
3
conditional statement to replace values in dataframe with NA
Hello and thanks for helping. #some data L3 <- LETTERS[1:3] dat1 <- data.frame(cbind(x=1, y=rep(1:3,2), fac=sample(L3, 6, replace=TRUE))) #When x==1 and y==1 I want to replace the 1 values with NA #I can select the rows I want: dat2<-subset(dat1,x==1 & y==1) #replace the 1 with NA dat2$x<-rep(NA,nrow(dat2) dat2$y<-rep(NA,nrow(dat2) #select the other rows and rbind
2013 Apr 29
4
expanding a presence only dataset into presence/absence
Hello, I'm working with a very large dataset (250,000+ lines in its' current form) that includes presence only data on various species (which is nested within different sites and sampling dates). I need to convert this into a dataset with presence/absence for each species. For example, I would like to expand "My current data" to "Desired data": My current data
2013 Mar 27
9
conditional Dataframe filling
Hi everyone: This may be trivial but I just have not been able to figure it out. Imagine the following dataframe: a b c d TRUE TRUE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE I would like to create a new dataframe, in which TRUE gets 0 but if false then add 1 to the cell to the left. So the results for the example above should be something like: a b c
2012 Jul 01
2
list to dataframe conversion-testing for identical
HI R help, I was trying to get identical data frame from a list using two methods. #Suppose my list is: listdat1<-list(rnorm(10,20),rep(LETTERS[1:2],5),rep(1:5,2)) #Creating dataframe using cbind dat1<-data.frame(do.call("cbind",listdat1)) colnames(dat1)<-c("Var1","Var2","Var3") #Second dataframe conversion
2013 Sep 02
1
R dataframe and looping help
HI, You may try this: dat1<- read.table(text=" CustID TripDate Store Bread Butter Milk Eggs 1 2-Jan-12 a 2 0 2 1 1 6-Jan-12 c 0 3 3 0 1 9-Jan-12 a 3 3 0 0 1 31-Mar-13 a 3 0 0 0 2 31-Aug-12 a 0 3 3 0 2 24-Sep-12 a 3 3 0 0 2 25-Sep-12 b 3 0 0 0 ",sep="",header=TRUE,stringsAsFactors=FALSE) dat2<- dat1[,-c(1:3)] res<- lapply(seq_len(ncol(dat2)),function(i)
2012 Aug 13
4
if else elseif for data frames
Hi all, It seems like I cannot use normal 'if' for data frames. What would be the best way to do the following. if data$col1='high' data$col2='H' else if data$col1='Neutral' data$col2='N' else if data$col='low' data$col2='L' else #chuch a warning? Note that col2 was not an existing column and was newly assigned for this
2010 Mar 22
1
Replacing elements of list
Dear all, I have following two list object, both are basically collection of matrices : dat1 <- matrix(rnorm(25*6), ncol=6) dat1 <- split(dat1, seq(5,25,by=5)) dat1 <- lapply(dat1, matrix, ncol=6) dat2 <- matrix(rnorm(25*4), ncol=4) dat2 <- split(dat2, seq(5,25,by=5)) dat2 <- lapply(dat2, matrix, ncol=4) Now I want to replace last 4 columns of each matrix at "dat1"
2013 Apr 12
2
split date and time
Hi R experts, For example I have a dataset looks like this: Number TimeStamp Value 1 1/1/2013 0:00 1 2 1/1/2013 0:01 2 3 1/1/2013 0:03 3 How can I split the "TimeStamp" Column into two and return a new table like this: Number Date Time Value 1 1/1/2013 0:00 1 2 1/1/2013 0:01 2 3 1/1/2013 0:03 3 Thank! [[alternative HTML version
2013 Sep 02
1
Convert chr pieces to numbers that have specific values defined by 2 vectors
Dear all, I think this is an easy task, but I don't know how to do it. Specifically, I have 69 columns with 300.000 rows. In each cell there is a code like "2E3", "4RR", etc. I now have a list that replaces this with values, e.g., old new 2E3 5 4RR 3 etc. The list ist about 1600 rows long, so also to extensive for normal solutions Do you how to do that? It would