Displaying 20 results from an estimated 100 matches similar to: "reorganizing a data frame"
2003 Feb 12
1
models for square tables
I've posted a sample file for estimating loglinear models for square
tables (mobility models) at http://www.xs4all.nl/~jhckx/mcl/R/
Comments and suggestions are welcome.
John Hendrickx
2015 Jan 16
1
S3 generic method dispatch on promises
Dear R friends
I wanted a function to make a simple percent table that would be easy for
students to use. The goal originally was to have a simple thing people
would call like this
pctable(rowvar, colvar, data)
and the things "rowvar" and "colvar" might be names of variables in data. I
wanted to avoid the usage of "with" (as we now see in the table help).
Then
2009 Aug 03
3
Help with data type
Hi there,
Using a quantmod function, I calculate the daily change between two points
in a time series. However, I don't think I am using the data correctly.
Code:
getSymbols("^GSPC", src="yahoo")
CloseData <- Cl(GSPC)
Delta <- diff(CloseData, lag=1)
for (i in 3:length(Delta)) {
if (Delta[i]>Delta[i-1]) sum <- sum + Delta
}
I can't seem to use the Delta
2011 Mar 12
3
pass character vector in instrument field of get.hist.quote function
I am new to R so I apologize if my question is trivial. I have not been able
to figure out whether what I want to do is even possible.
I have a data frame of stock ticker symbols which I store into R space from
a txt file as follows:
tickers <- read.csv("stocks.txt", header=FALSE, sep=",")
tickers <- tickers[1] / the tickers are stored in the first column
>
2001 Oct 08
3
testing diff for slopes and intercepts
I fit the model
fit<-lm(thresh~cond*Ne)
where
thresh is the reponse
cond is a factor with levels a, b, and c
Ne is a continuous indep var
I think of this full model as having three lines: thresh as a function of
Ne for each condition. Thus we have slopea, slopeb, slopec, inta, intb,
intc.
lm output my params
-------------------------
(Intercept) inta
condb intb - inta
condc
2006 Feb 23
9
Balancing multiple connections and NAT
Hi,
I have a client connected to the ''net through 3 ISP''s. Have set up a
Linux box to do routing and load sharing for the 3 connections. A
fourth interface is connected to the LAN with private IP addresses.
Am using iptables to SNAT traffic to the appropriate IP depending on
the interface the packet gets routed onto. The setup looks something
like this:
Interface IP
2011 Aug 23
1
Testing Specific Hypothesis
Hi All!
I am interested in testing whether the means for the data I am investigating
are equal to a specific value - let's say 0.01. I have already run a
one-way ANOVA and know that the differences in the means are not
significant, so now I want to know what values the means take on. "otestme"
is the data I am working with (it would be hard for me to get into a form
that would be
1999 Nov 10
1
read.table problems
Yesterday I asked for help about read.table with a CSV file. I
received the following help. As always many thanks for the prompt
responses. Now I load my csv file in a text editor ( pfe) and delete
all spaces.
My original mail is at the end.
From: Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>
Do you have spaces before the commas in your file?
> Yes, number , space,
1999 Nov 10
1
read.table problems
Yesterday I asked for help about read.table with a CSV file. I
received the following help. As always many thanks for the prompt
responses. Now I load my csv file in a text editor ( pfe) and delete
all spaces.
My original mail is at the end.
From: Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>
Do you have spaces before the commas in your file?
> Yes, number , space,
2009 Sep 01
3
Simple question about error on CSV import
I have a substantial CSV to import but can't seem to import even the
simplest CSV.
I'm running the latest stable REvolution R on OS X if that is pertinent.
Here's the contents of a simple test2.csv CSV file:
#,Status,Project
5842,New,Test
> snortalerts = read.table( "/Users/lcox/Documents/test2.csv", header=TRUE,
> sep=",", row.names="#")
Error
2008 Dec 14
1
how to convert factors to numbers
Hello, I am relatively new to using R. I am using R version 2.8.0. I have a
program that downloads stock data from Yahoo! Finance and stores it to a
text file on my hard drive. The text file contains the date, opening price,
high price, low price, closing price, volume and adjusted price (i.e.,
adjusted for dividends and splits). I want to read and manipulate the data
in R. However, when I
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day
correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs
for 500 days. The initial run took 9 hours(!) and I'd like to make it
faster. So, I'm including my code below, in hopes that somebody will be able
to figure out how to make it faster, either through parallelisation, or by
making changes. I've
2002 Aug 14
3
t-test via matrix operations
I need to calculate a large number of t statistics, and would like to do so via matrix operations. So far I have figured out a way to calculate the mean of each row of the matrix:
d <- matrix(runif(100000,1,10), 1000, 10) # some test data
s <- rep(1,ncol(d)) # a sum vector to use for matrix multiplication
means <- (d%*%s)/ncol(d)
This is at least 1 order of magnitude faster than
2009 May 13
5
Help with reshape/reShape and indexing
Dear R Helpers,
I have trouble applying reShape and reshape although I read the documentation and several posts, so I would very much appreciate your help on the two points below.
I have a dataframe
df = data.frame(Name=c("a", "a", "a", "b", "b", "c"), X1=c("12", "13", "14", "20", "25",
2011 Feb 18
1
VF passthrough problems
I am having reports of PCI passthrough problems with SR-IOV, in
particular it looks like we are hitting the warning at msi:635 and
msi:648 in xen; see the following log:
(XEN) [VT-D]iommu.c:1785: VT-d page table not sharing with EPT table
xenbus dev backend/vbd/1/5696 error 6 opening device
(XEN) PCI add Virtual Function 04:1a.0
(XEN) HVM1: HVM Loader
(XEN) HVM1: Detected Xen v4.1.0.rc2.pre
(XEN)
2002 Nov 15
2
Why no colSDs etc
Hi people,
If there is a fn "colMeans" why isn't there a "colSDs" etc
Thanks,
Phil.
--
Philip Rhoades
Pricom Pty Limited (ACN 003 252 275)
GPO Box 3411
Sydney NSW 2001
Australia
Mobile: +61:0411-185-652
Fax: +61:2:8923-5363
E-mail: pri at chu.com.au
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2004 Apr 20
10
TCP RST attack
http://www.uniras.gov.uk/vuls/2004/236929/index.htm
----Quote----
"The impact of this vulnerability varies by vendor and application, but in
some deployment scenarios it is rated critical. Please see the vendor
section below for further information. Alternatively contact your vendor
for product specific information.
If exploited, the vulnerability could allow an attacker to create a
2006 Mar 31
2
rowVars
I am using the R 2.2.1 in a Windows XP environment.
I have a dataframe with 12 columns and 1,000 rows.
(Some of the rows have 1 or fewer values.)
I am trying to use rowVars to calculate the variance
of each row.
I am getting the following message:
?Error in na.remove.default(x) : length of 'dimnames'
[1] not equal to array extent?
Is there a good work-around?
2007 May 18
1
svychisq
Dear All
I am trying to use svychisq with a two-dimensional table 4 x 5. The
command I am using is
summary(svytable(~dietperception+dietstatus,dudleyls1rake,na.rm=TRUE),"C
hisq")
It is throwing up an error message as follows:
Error in NCOL(y) : only 0's may be mixed with negative subscripts
In addition: Warning messages:
1: is.na() applied to non-(list or vector) in:
2004 Aug 03
2
lme fitted correlation of random effects: where is it?
The print method for lme *prints out* the fitted correlation matrix for
the random effects. Is there any way to get these values as an object in
R? I have examined the components of the lme object (called "junk" in the
example below) and the components of summary(junk) without finding these
numbers.
(How I did this: I dumped the entire lme object to a text file and then
used egrep to