search for: x77

Displaying 20 results from an estimated 75 matches for "x77".

Did you mean: 77
2011 Mar 09
1
state.x77 dataset
I tried: > data(state.x77) Warning message: In data(state.x77) : data set 'state.x77' not found data(iris) seems to work fine, but the other state datasets (which I haven’t every tried before) don’t seem to be available on my windows 7 running R 2.12.2 installation. ?state brings up the state help page page which...
2009 Mar 24
1
Is aggregate() function changing?
Hi R developers and debian users: Finally I found how to work with aggregate() function on the last patched version fo R. I you use this command it fails: aggregate(state.x77, list(Region = state.region), mean) But if you modify it in this way, it works!: aggregate(state.x77, list(Region = state.region), function(x) mean(x) ) Is it necesary to change the example? What is changing in aggregate() function? Thank you for your attention. Kenneth. >sessionInfo() R...
2001 Mar 13
1
Display grouping parameter in coplot
I try to display the grouping variable in coplot. It work, but it's special solution and rather ugly. Any better idea? # Simulate my data frame data(state) x77<-data.frame(state.x77) x77$region<-state.region coplot(Life.Exp ~ Income | region, data=x77, show.given=F, subscripts=T, panel = function(x, y,subscripts, ...) { panel.smooth(x, y, span = 1., ...) # Shuddrr.... # There must be way to access the groupin...
2009 Mar 24
1
Is aggregate() function changing?
Hi R developers and debian users: Finally I found how to work with aggregate() function on the last patched version fo R. I you use this command it fails: aggregate(state.x77, list(Region = state.region), mean) But if you modify it in this way, it works!: aggregate(state.x77, list(Region = state.region), function(x) mean(x) ) Is it necesary to change the example? What is changing in aggregate() function? Thank you for your attention. Kenneth. >sessionInfo() R...
2008 Jan 12
2
Lattice equivalent of par(mfrow = )
Dear r-helpers, Does anyone have a straightforward example of putting together three unrelated (expect for a common y-axis) xyplot() figures in what would be in base graphics a par(mfrow = c(1, 3)) arrangement? _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102
2009 Apr 05
1
problem with lattice tiff or bitmap: character size and color
...lattice plots. How can I keep the right sizes using tiff or, alternatively, how can I get bitmap to produce colors? I have made this test function using an xyplot example to demonstrate the problem. `test` <- function(tiff=F, bitmap=F) { ### requires states ### states <- data.frame(state.x77, state.name = dimnames(state.x77)[[1]], ### state.region = state.region) if(bitmap) bitmap("bitmaptest.tiff", width=17.15, height=17.15, units="cm", res=1200, pointsize=10, type="tifflzw",bg="white") if(tiff) tiff(file="tifftest.tiff&...
2009 Mar 24
1
aggregate() example fails]
...i R users and developers on debian platforms. I compile the R version 2.8.1 Patched (2009-03-18 r48193) on my UBUNTU linux distribution. But when I ask for the aggregate example it fails. What am I missing? example(aggregate) aggrgt> ## Compute the averages for the variables in 'state.x77',grouped aggrgt> ## according to the region (Northeast, South, North Central,West) that aggrgt> ## each state belongs to. aggrgt> aggregate(state.x77, list(Region = state.region), mean) Error en FUN(X[[1L]], ...) : elemento 1 esta vacio; la parte de la lista de argumentos 'is...
2001 Dec 27
1
scale in stars() is not as documented (PR#1230)
...range [0,1]. but the code has if (scale) { x <- sweep(x, 2, apply(x, 2, max), FUN = "/") x[is.na(x)] <- 0 } and so just linearly (not affinely) scales the maximum to one. The result is very different star plots from the S original. Try stars(state.x77[, c(7, 4, 6, 2, 5, 3)]) compared to stars(state.x77[, c(7, 4, 6, 2, 5, 3)], byrow = T) # in S I suspect we should fix the code, but does anyone rely on it? BTW, it is hard to think of a more inefficient way to write that scaling! -- Brian D. Ripley, ripley@stats.ox.ac.uk Pro...
2013 Apr 09
4
Converting matrix to data frame without losing an assigned dimname
Hello All, Would like to be able to convert a matrix to a dataframe without losing an assigned dimname. Here is an example that should illustrate what I'm talking about. tableData <- state.x77[c(7, 38, 20, 46), c(7, 1, 8)] names(dimnames(tableData)) <- c("State", "") tableData State Frost Population Area Connecticut 139 3100 4862 Pennsylvania 126 11860 44966 Maryland 101 4122 9891 Virginia 85 4981 39780...
2012 Jan 19
1
question re. package playwith not able to run command getting error message that I'm attempting to use non function
...package: cairoDevice Loading required package: gWidgetsRGtk2 Loading required package: gWidgets Loading required package: grid > playwith(plot(1:10)) Error in playwith(plot(1:10)) : attempt to apply non-function > playwith(xyplot(Income ~ log(Population / Area), + data = data.frame(state.x77), groups = state.region, + type = c("p", "smooth"), span = 1, auto.key = TRUE, + xlab = "Population density, 1974 (log scale)", + ylab = "Income per capita, 1974") + ) Error in playwith(xyplot(Income ~ log(Population/Area), data = data.frame(state.x7...
2011 Sep 27
4
Question concerning Box.test
Hi everyone, I've got a question concerning the function Box.test for testing autocorrelation in my data. My data consist of (daily) returns of several stocks over time (first row=time, all other rows=stock returns). I intend to perform a Box-Ljung test for my returns (for each stock). Since I have about 3000 stocks in my list, I'm not able to perform the test individually for each
2008 Jan 24
0
readClipboard() from spreadsheet to data.frame with column names?
...g the first row as the column names in clipboardTextAsDF. There is probably a simple or better way to do this but I have been away from R for awhile now. I just be over-thinking this. I tried read.DIF to read the clipboard but that didn't work as I had hoped. writeClipboard(rownames(state.x77), format=1) #A paste, Ctrl+V in any Application should now list United States State names. statex77 <- cbind(State=rownames(state.x77), state.x77) wd <- "b:/Chapter11/" setwd(wd) #Note use of "/" rather than "\" write.csv(statex77, file="StateX77.csv&q...
2007 Aug 16
4
Linear models over large datasets
I'd like to fit linear models on very large datasets. My data frames are about 2000000 rows x 200 columns of doubles and I am using an 64 bit build of R. I've googled about this extensively and went over the "R Data Import/Export" guide. My primary issue is although my data represented in ascii form is 4Gb in size (therefore much smaller considered in binary), R consumes about
2010 May 17
3
Create counter variable for subsets without a loop
Hi all, I am looking to create a rank variable based on a continuous variable for subsets of the data. For example, for an R integrated data set about US states this is how a loop could create what I want: ### Example with loop data <- cbind(state.region,as.data.frame(state.x77))[,1:2] # choosing a subset of the data data <- data[order(data$state.region, 1/data$Population),] # ordering the data regions <- levels(data$state.region) temp <- NULL ranks <- NULL for (i in 1:length(regions)){ temp <- rev(rank(data[data$state.region==regions[i],"Po...
2007 Aug 21
2
divided scatter plots
I have a data set which contains two columns. The first column is a list of countries, and the second column contains their political risk ratings. I would like to create one large plot that contains 5 different sections, each with a scatter plot. To clarify, I have divided the countries into 5 groups. For each group (continent), I would like to have the name of the continent on the x-axis, and
2005 Oct 14
2
run many linear regressions against the same independent variables in batch
R function lm(response ~ term) allows me to run a linear regression on a single response vector. For example, I have recent one year historical prices for a stock and S&P index. I can run regression of the stock prices (as response vector) against the S&P index prices (as term vector). Now assume I have 1000 stocks to run the above regressions (against the same S&P index prices).
2011 Aug 20
2
a Question regarding glm for linear regression
...x27 + x28 + x29 + x30 + x31 + x32 + x33 + x34 + x35 + x36 + x37 + x38 + x39 + x40 + x41 + x42 + x43 + x44 + x45 + x46 + x47 + x48 + x49 + x50 + x51 + x52 + x53 + x54 + x55 + x56 + x57 + x58 + x59 + x60 + x61 + x62 + x63 + x64 + x65 + x66 + x67 + x68 + x69 + x70 + x71 + x72 + x73 + x74 + x75 + x76 + x77 + x78 + x79 + x80) it gives me an error "Error in eval(expr, envir, enclos) : object 'x3' not found" which I dont know why I am given those errors. The other thing is that when I use the "glm.fit", I can get coefficients without any errors. So, I am not sure what is goin...
2004 Sep 17
3
Function some()
Dear R-devel list members, Probably not an opportune time for this, given the immanent release of 2.0.0, but I was just reminded (while preparing a lecture) of a function that I find useful and that I though might be a candidate for the utils package: The function, which I call some(), behaves like head() and tail(), from which it is adapted, except that it samples from an object (e.g., rows of a
2003 Jun 26
1
xyplot
I am doing group wise plots by using the following commands; it shows errors that I do not know how to fix it. Please help. xyplot(within.2.special.care ~ agecat| mco.cms.ind, neuro, panel = function(x,y){ + panel.grid() + panel.xyplot(x,y) + panel.loess(x,y, span =1)}) Error: couldn't find function "xyplot" [[alternative HTML version deleted]]
2006 Nov 20
2
To delete rows in a dataframe
Hi everybody, Does anyone know how to delete certain rows (satisfying a particular condition) of a data frame in R? Thanks u, Shubha [[alternative HTML version deleted]]