similar to: Formula with in memory data.frame

Displaying 20 results from an estimated 30000 matches similar to: "Formula with in memory data.frame"

2004 May 07
0
loess and as.POSIXct
Hi there fellow R-users, I have just upgraded to R version 1.9.0 from R version 1.7.1 for Windows. Im trying to use the loess smoother where the X-variable is an as.POSIXct variable. The following works fine with R1.7.1 but not with R1.9.0. Here is the example: dates<-c('2003-08-03','2003-08-10','2003-08-17','2003-08-24','2003-08-31','2
2009 Oct 03
1
Problem using with panel.average in Lattice package
Hi, I'm having a problem getting the panel.average function to work as I expect it to in a lattice plot. I wish to draw lines between the averages of groups of y-values at specific x-values. I have created a dataset below which is similar to my real data. I also show an example of using panel.loess in place of panel.average; it performs in a manner similar to what I want panel.average to do
2008 Aug 08
2
Length of data.frame column
I have a beginner question. After I finally get the data to a data.frame that I can work with I have the following a data frame that is fairly long: > length(r2007) [1] 17409 If I look at the first element: > r2007[1] $`100009` DayOfYear Quantity 1 66 1 2 128 1 3 137 1 4 193 1 Now how do I get the length of this list (actually it is
2008 Aug 27
1
Updating a list.
I have a list that is generated from the resape package function 'cast'. It consists of three columns, Sku, DayOfYear, variable it is generated like: r2007 <- cast(m2008, DayOfYear ~ variable | Sku, sum) Now DayOfYear can range from 1:365 but there are not necessarily that many rows in the list. What I want to do is make every row in the list of lenght 365 and have the values
2001 May 18
1
NAs in chron objects
Dear All: I am having some trouble with date variables when NAs are present. The following example illustrates (see below for output of version): > library(chron) > minor.test <- c( "NA", "NA", "1988-02-08", + "1988-02-08", "NA", "1987-11-23", "1988-09-03", "1991-10-15", +
2012 Aug 24
1
POSIXct-coerced NA's not considered NA by is.na()
Hello folks, I found a strangeness while experimenting with POSIXct vectors and lists. It seems that coerced NA's aren't "real" NAs, at least as considered by is.na()? > date_vec = c(as.POSIXct(now()), as.POSIXct(now()+1),NA,"b") > date_vec [1] "2012-08-22 15:00:46 COT" "2012-08-22 15:00:47 COT" NA [4] NA Warning message: In
2008 Jul 15
1
Filtering output
I have a command which returns a data fram if I am not mistaken: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Now I wish to get the Category and SubCategory that the data was split on. So my first attempt would be: sc[[1]]$Category[1] But that yields [1] (Unknown) 46 Levels: (Unknown) 10" Plates 7" Plates (Dessert) ... WOMEN Is all I want is '(Unknown)'.
2009 Oct 28
5
PDF Corrupted?
I am running R 2.9.2 and creating a PDF that I am trying to open with Adobe Reader 9.2 but when I try to open it the reader responds with "There was an error opening this document. The file is damaged and cannot be repaired.: I am using the R command(s): pdf(file="cat.pdf", title="Historical Sales By Category") for(j in 1:length(master)) { d <-
2008 Jul 15
4
Iterations
I have a command that reads in some data: x <- read.csv("Sales2007.dat", header=TRUE) Then I try to organize the data: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Then I want to iterate through the data. I was able to get the following to run on the R console: for(i in 1:length(sc)) { sum(sc[[i]]$Quantity) } But notiing is primted on the console. I find
2008 Oct 09
1
Basic aggregate help
>From what I read this should work. So please help my misunderstanding: > x <- data.frame(Name=c("A","A","C"), Category=c("a","a","b"), Quantity=c(1,2,3)) > x Name Category Quantity 1 A a 1 2 A a 2 3 C b 3 > aggregate(x,
2008 Aug 05
1
RESHAPE cast help.
I have a set of data that is basically sales figures for a given year. It has columns for Yeaqr, Day Of Year, Sku, SubCatetory, and Category. The first few lines of data look like: Year DayOfYear Sku Quantity CatId Category SubCategory 1 2007 1 100091 1 10862 HOLIDAY Christmas 2 2007 1 100138 1 11160 PET COSTUMES Famous
2008 Jul 26
4
Data length mismatch.
I have two vectos (list) that represent a years of data. Each "row" is represented by the day of year and the quantity that was sold for that day. I would like to form a new vector that is the difference between the two years of data. A sample of A (and similarly B) looks like: > A[1:5,] DayOfYear x 1 1 1429 2 2 3952 3 3 3049 4 4 2844 5 5
2007 Aug 08
2
Error: Cannot Coerce POSIXt to POSIXct when building package
A newbie here - please forgive me if this is a basic question. We have an in house package built in R 2.2.1 (yes we're a little behind the times at our firm)and would like to rebuild it using R 2.5.1. However, when I try and build the package from source, I keep getting this error: Error in as(slotVal, slotClass, strict = FALSE) : no method or default for coercing "POSIXt"
2008 Aug 09
1
Reshape set operations?
I have mange to use the library reshape to give me data structures that I want. Specifically: m2008 <- melt(t2008, id.var=c("DayOfYear","Category","SubCategory","Sku"), measure.var=c("Quantity")) m2007 <- melt(t2007, id.var=c("DayOfYear","Category","SubCategory","Sku"),
2009 Nov 19
1
loess smoothing
Hello, In reading the loess description I see: span: the parameter alpha which controls the degree of smoothing. The default seems to be 0.75. Would it be possible to expand on this decription so I can avoid trail and error? Can I increase this pass 'span' > 1? Qualitatively to what degree changing this value affects the smoothing of the data? Thank you. Kevin
2012 Nov 20
1
Closest fit data to a particular formula
R folks, I am somewhat new to R and have started to stumble... I have a set of data that I am trying to model, so that I can predict on a much larger set - and I have been using loess to get a model.. but it is not what I would like to see. For instance, I know from the nature of the data that the shape of this line should only decrease, and yet the loess is being affected by the sample
2008 Jul 26
1
Simple vector question.
I have some data that I read in via read.csv: sales2007 <- read.csv("Total2007.dat", header=TRUE) The data looks like: > sales2007[1:605,] Year DayOfYear Sku Quantity CatId Category SubCategory 1 2007 1 100091 1 10862 HOLIDAY Christmas 2 2007 1 100138 1 11160 PET COSTUMES Famous (Licensed) 3 2007
2008 Jan 03
2
retaining formatting when converting a vector to a matrix/data.frame?
Please see example code below. I have a vector ("mydata") of length 10. "mydata" can have various formats (e.g. numeric, text, POSIXct, etc) I use the matrix and data.frame functions to convert "mydata" to a dataframe ("mydf") of 2 columns and 5 rows. What is a "good" way to ensure that the format is retained when I create the
2011 Jan 04
1
XTS : merge.xts seems to have problem with character vectors
Hi, Please can you tell me what I am doing wrong. When trying to merge two xts objects, one of which has multiple character vectors for columns...I am just getting NAs. > str(t) POSIXct[1:1], format: "2011-01-04 11:45:37" > y2 = xts(matrix(c(letters[1:10]),5), order.by=as.POSIXct(c(t + 1:5))) > names(y2) = c(1,2) > y2 1 2 2011-01-04 11:45:38
2009 Sep 10
1
Exporting the formula for a LOESS fit
I'm at my wit's end, and have searched all of my sources. I need to generate a relatively large number of individual LOESS fits each month of data (I have about 16 months of data). Fitting the polynomial is not my problem, figuring out what the formula that describes that polynomial is. apologies in advance if this is so simple, but I need a hand here. Thanks. -- View this message in