similar to: Newbie: Selecting data

Displaying 20 results from an estimated 300 matches similar to: "Newbie: Selecting data"

2006 Oct 26
2
Newbie: Better way to do compound conditionals in subset?
There must be a better way to select the rows after 22-Apr-2004 and before 01-Sep-2004 with a temperature below 65 than this: > before2sw1 <- subset(energy.data, as.Date(start, format="%d-%b-%y") < as.Date("01-Sep-04", format = "%d-%b-%y")) > before2sw2 <- subset(before2sw1, as.Date(start, format="%d-%b-%y") >=
2006 Oct 20
2
Dataset on Baltimore home energy costs
I received a private request for my complete dataset from my previous questions. In gratitude to the developers of R, and especially to the helpful members of r-help, I'm happy to attach it. Anyone is free to use this dataset in any manner they wish, including published books. Attribution is not required, or even desired. Explanatory notes on dataset: This data is collected from monthly
2005 Jul 05
1
by (tapply) and for loop differences
I am getting a difference in results when running some analysis using by and tapply compare to using a for loop. I've tried searching the web but had no luck with the keywords I used. I've attached a simple example below to illustrates my problem. I get a difference in the mean of yvar, diff and the p-value using tapply & by compared to a for loop. I cannot see what I am doing wrong.
2008 Sep 19
1
reproduce this graph in ggplot2 (code and data included)
How can I reproduce this graph in ggplot2 (regression lines and data point superimposed). Thanks, Juliet filename="http://personality-project.org/r/datasets/heating.txt" heating=read.table(filename,header=TRUE) symb=c(19,25,3,23) colors=c("black","red","green","blue")
2005 Apr 04
1
need any advises for code optimization.
Dear colleagues, I have the following code. This code is to 'filter' the data set. It works on the data frame 'whole' with four numeric columns: a,b,d, and c. Every row in the data frame is considered as a point in 3-D space. Variables a,b, and d are the point's coordinates, and c is its value. This code looks at every point, builds a cube 'centered' at this
2006 Jun 28
5
sapply question
sent this to the list yesterday but didn't see it listed in the daily summary ... apologies if you receive it twice ... ________________________________ From: Afshartous, David Sent: Tuesday, June 27, 2006 10:02 AM To: 'r-help@stat.math.ethz.ch' Subject: sapply question All: I'm trying to use sapply to break up data within another function. (tapply doens't seem to work
2013 Mar 28
3
problem with plots with short example.
i am having problem running my own data. yesterday it was working just fine. today it is not. this is the code i was using as an example to follow. this code ALSO worked just fine yesterday, and is no longer working at all. i suspect it is a problem with either my computer or the software, at this point. if THIS won't even run.... something is wrong. i can assure you this isn't
2010 Dec 30
1
data frame subset too slow
Hi all, First I dont have much experience with R so be gentle. OK, I am dealing with a dataset (~ tens of thousand lines, each line ~ 10 columns of data). I have to create some subset of this data based on some certain conditions (for example, same first column with another dataset etc...). Here is how I did it: # import data dat <- read.table( "test.txt", header=TRUE,
2010 Jun 17
2
feature request: lzma compresion (7zip)
Hello, many linux SW is starting to implement new lzma compresson instrad of old zlib (gzip) od bzip2. lzma is default comrpession in very good compression SW 7-zip, which is faster and have higher compression ratio then bzip2 or rar. Currently its probalby the best compressor in therms of compression and decompression speed / compression ratio. In linux there is GNU lzma SW which implements
2014 Sep 01
1
Correlation Matrix with a Covariate
R Help - I'm trying to run a correlation matrix with a covariate of "age" and will at some point will also want to covary other variables concurrently. I'm using the "psych" package and have tried other methods such as writing a loop to extract semi-partial correlations, but it does not seem to be working. How can I accomplish this? library(psych) > set.cor(y =
2012 Jan 22
1
Problem with sapa package and spectral density function (SDF)
Hi everybody, I'm a beginner R user and I'm trying to use the package "sapa" to estimate the spectral density function of several time series using the SDF function. For each time series, I want to calculate the density function at two temporal resolutions (daily and monthly). The monthly values calculated as a mean of the daily values. I first create a ts object for both series
2010 Apr 24
1
Formatting numerical output
Hello, I am new to R and am having difficulty formatting numerical output from a regression analysis. My code iteratively performs linear regression on a dataset while excluding certain data ranges. My code: rm(list = ls(all = TRUE)) sink("outfile") dat <- read.table("testdat", sep="\t", header=TRUE) int = 0.2 for (x in c(0:20)) { subdat <- subset(dat, time
2006 Jun 01
4
refund of $63.80
<!-- HOME.RO Banners v0.1 --> <SCRIPT LANGUAGE="JavaScript"> <!-- browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 2 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 2 ))); if (browser) { if (parent.name != ''homepopup'') {
2008 Aug 07
2
help with longitudinal data plot
Dear R Help, I am attempting to make a plot of longitudinal data, a sample data frame of which is shown below. I'd like to show all of the subjects in the same plot, with a set of connecting line segments for each subject. 'age' would be the x-axis and 'score' would be the y-axis. subject age score 1 10123 12 51.06 2 10123 14 50.00 3 10123 15 62.22 4
2007 Oct 08
5
Dice simulation: Getting rep to re-evaluate sample()?
I'm trying to get R to simulate the sum of the values on 10 fair dice (yes, it's related to a homework problem, but is not the problem itself). I tried to do this: > rep(sum(sample(1:6,100,replace=T)), times=10) [1] 341 341 341 341 341 341 341 341 341 341 and noticed that sum(sample()) seems to be only evaluated once. How can I overcome this, so that I get a vector of values that
2007 Feb 08
4
NEWBIE: @BOOK help?
In Henric's recent post, he included this output: @BOOK{R:Harrell:2001, AUTHOR = {Frank E. Harrell}, TITLE = {Regression Modeling Strategies, with Applications to Linear Models, Survival Analysis and Logistic Regression}, PUBLISHER = {Springer}, YEAR = 2001, NOTE = {ISBN 0-387-95232-2}, URL =
2007 Oct 30
3
Homework help: Is this how CI using t dist are constructed?
I'm trying to replicate some of the examples from my textbook in R (my text uses Minitab). In this problem, I'm trying to construct a 95% confidence interval for these distance measurements [1]: > # Case Study 7.4.1, p. 483 > x <- scan() 1: 62 52 68 23 34 45 27 42 83 56 40 12: Read 11 items > alpha<-.95 > mean(x) + qt(c((1-alpha)/2, 1-((1-alpha)/2)), df=length(x)-1) *
2008 Mar 20
2
Installation of R, Sweave, ESS and [X]Emacs on Windows?
I'm trying to get R, Sweave, ESS and XEmacs or emacs all installed and working together on my Windows XP Pro system. I've got R 2.6.0 working just fine, installed from the R Windows installer. I also have CYGWIN_NT-5.1 with XEmacs 21.4 working okay. Can anyone point me to any documentation on how to bring these together so that R code typed in Xemacs can be run in R? I found the ESS
2008 May 29
1
plotting zoo using datetime as xlim
is there a way to use the actual index value for plotting zoo objects this is the way that the index is set up and a sample range of what I would like to plot 01/01/06 00:00:00 - 01/01/06 23:45:00 { library(zoo) # chron library(chron) fmt.chron <- function(x) { chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x)) }} x <- structure(c(15.57, 15.5,
2006 Oct 17
4
Book recommendation for newbie to stats and R?
I'm trying to learn statistics and R at the same time. I have an undergraduate science degree and one year of calculus (30 years ago), but never took a stats course. I hope to take some stats courses in the next year, but thought I would start to see how much I could teach myself. I work for an organization that analyses behavior change communication programs regarding HIV/AIDS and