Ooh, nice! Thanks!
Nick
On 6/16/13 8:42 PM, Gabor Grothendieck wrote:
On Sun, Jun 16, 2013 at 9:00 PM, Nick Matzke mat...@berkeley.edu wrote:
Thanks *VERY* much, this is great!
I realized a few more cases, I think I've got something that covers all the
possibilities now:
library(stringr)
Dear R People:
I am working with a Centos 5 machine and would like to install R-3.0.1.
However, the only version that shows up automatically is R-2.15.2.
I have tried the following:
root@erinminfo [~]# wget
http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
--2013-06-17
Hello Folks,
I try to use plyr and reshape 2 to take a data frame of the form:
head(cf_dt)
isin dt
1 FR0109970386 2010-01-12
2 FR0109970386 2011-01-12
3 FR0109970386 2012-01-12
4 FR0116114978 2010-01-12
5 FR0116114978 2011-01-12
6 FR0116114978 2012-01-12
to create a matrix
On Jun 17, 2013, at 7:32, Erin Hodgess erinm.hodg...@gmail.com wrote:
Dear R People:
I am working with a Centos 5 machine and would like to install R-3.0.1.
However, the only version that shows up automatically is R-2.15.2.
I have tried the following:
root@erinminfo [~]# wget
Dear Graham,
On 16 June 2013 02:08, Graham McDannel graham.mcdan...@gmail.com wrote:
I am attempting to optimize a function I have developed using optim.
I am getting the below error message:
Error in n 1: 'n' is missing
I suspect a function requires an argument named n, and you
didn't
I`m doing the chi square test in R, see below code:
row1 - c(27,17,13,21,80,24,35,41,18,51) #Category A (1-10) counts
row2 - c(27,11,26,13,30,28,17,30,10,21) #Category B (1-10) counts
data.table - rbind(row1,row2)
data.table
then:
chisq.test(data.table)
This gives me the chi figure,
On Mon, Jun 17, 2013 at 9:14 AM, Dave Clark d...@mailbox.co.uk wrote:
I`m doing the chi square test in R, see below code:
row1 - c(27,17,13,21,80,24,35,41,18,51) #Category A (1-10) counts
row2 - c(27,11,26,13,30,28,17,30,10,21) #Category B (1-10) counts
data.table - rbind(row1,row2)
Hello,
Maybe something like the following.
dat - read.table(text =
isin dt
1 FR0109970386 2010-01-12
2 FR0109970386 2011-01-12
3 FR0109970386 2012-01-12
4 FR0116114978 2010-01-12
5 FR0116114978 2011-01-12
6 FR0116114978 2012-01-12
, header = TRUE, stringsAsFactors = FALSE)
On Jun 17, 2013, at 10:36 , R. Michael Weylandt wrote:
On Mon, Jun 17, 2013 at 9:14 AM, Dave Clark d...@mailbox.co.uk wrote:
I`m doing the chi square test in R, see below code:
row1 - c(27,17,13,21,80,24,35,41,18,51) #Category A (1-10) counts
row2 - c(27,11,26,13,30,28,17,30,10,21)
On Mon, Jun 17, 2013 at 10:07 AM, peter dalgaard pda...@gmail.com wrote:
On Jun 17, 2013, at 10:36 , R. Michael Weylandt wrote:
What do you mean 'results of individual cells'? As documented in
?chisq.test, you might be looking for one or more of
data.table$observed
data.table$expected
Hello,
I was able to install the nloptr package by editing the src/Makevars file.
I added the line
mv .libs lib; \
between
make install; \
ls | grep -v ^include$$ | grep -v ^lib$$ | xargs rm -rf; \
for NLopt compilation.
You probably should contact the package
Hello,
I have been trying to find out whether it is possible to use more than one
offset in a gam (in mgcv).
The reason I would like to do this is to 1) account for area surveyed in a
Poisson model of sightings of porpoises within defined grid cells (each cell
has a slightly different area) and
Dear R-help users,
I am quite new in R. I have multiple csv.files with different size. I would
like to read them by using a for- loop and parallel by reading I need to add
a new column which can be specified by myself.
But my for-loop does not work !
Could somebody give me any idea ?
Many
Dear Guylaine,
this has nothing to do with either 'plm' or logs. The error message says it
all: fin d'entrée inattendu(e). Somehow, you're inputting '+' twice in the R
console, so the formula is syntactically invalid. Moreover, you assign the
forula through '' instead of '-' so that this
Hi Alice
An offset is just a fixed vector added to the linear predictor of a
model, so if you want to add two fixed vectors, you might as well add
them together first. i.e. I think you want something like
off - log(grid.cell.area) + log(detection)
gam(porpoises ~ s(covariates) + offset(off),
Hello,
You are reading 11 times the same file, 'toread'.
Assuming that 'toread' is a vector with 11 different filenames in it,
something like the following might do what you want.
for ( i in 1:11) myfiles[i] - read.csv(toread[i], header = TRUE, sep=)
AS for the final for loop, it does
Hi all,
I tried SO for this, but got no response. Trying here in hope of better luck.
--
I am trying to build an R package that uses some C code. I have a C library
that is compiled into
Hi,
May be this helps.
set.seed(29)
GLSS- data.frame(hhid=sample(1:10,30,replace=TRUE),value=rnorm(30))
IDstoSelect- c(1,5,7)
GLSS[!is.na(match(GLSS[,1],IDstoSelect)),]
# hhid value
#1 1 -0.34216061
#6 1 0.28240263
#14 7 0.04197496
#17 7 0.15005878
#21 7 -1.18640939
HI,
Try this:
X-
c(0,659-1000,641-659,634-641,630-634,630-630,626-628,618-626,604-618,574-604,0-574)
Y-
c(0,2.166477,6.347396,12.23869,20.18244,26.07374,36.64006,48.15659,61.61155,77.95515,100.152)
dat1- data.frame(X,Y)
dat2-dat1[order(dat1$Y,dat1$X),]
dat2$X-factor(dat2$X,levels=dat2$X)
Can I have some help in vectorizing a series of matrix multiplications?
Toy Example
mat_size=2; num_matrices=3; num_users=2
ToyArray=array(1,dim=c(mat_size, mat_size, num_matrices, num_users))
/* So I open an 4-dim array to store 3 2 X 2 matrrices for 2 users. For each
user I want to
If your goal is to simulate data from the given distribution in R then
there are a couple of approaches. You have the distribution function
derived, so you can use any technique that just need the distribution
function. This could be rejection sampling or Metropolis-Hastings sampling
or others.
Is there a function in r that let's you efficiently invert a positive
definite symmetric Block Toeplitz matrix? My matrices are the covariance
matrices of observations of a multivariate time series and can be
1000*1000 or larger.
I know the package 'ltsa' which seems to use the Trench
Hi Arun,
Sorry to bother you again with this. When I was trying it out over the
weekend with different data files I realized that its not exactly working
the way it should.
For this file B:
ROW_ID |SRC_ROW_ID |NOTE
1a |1 |Comment 1
2a
Hello all,
I’ve been working with R for some years, but I am beginner to Rcpp (and have no
experience with C++).
I am trying to set zeros in a matrix to Inf. In R I would do this:
x=matrix(8:0,3)
x[which(x==0)]=Inf
My try with Rcpp and RcppArmadillo looked like this (as I do not know how
Hello David,
Yes my variables are all numericI have a few questions regarding your 2
options.
Would these still be the best options if missing data was not an issue? I
was told that I should be performing NMDS as it has few assumptions on the
data distribution but neither of your options use
Hi,
Modification of my previous function seems to work for the given example:
dat1-read.table(text=
Row_ID_CR, Data1, Data2, Data3
1, aa, bb, cc
2, dd, ee, ff
,sep=,,header=TRUE,stringsAsFactors=FALSE)
dat2-
Just wanted to note that one does **not** use
prcomp() on the correlation matrix of the variables.
As ?prcomp says, it uses the svd of the data matrix, which is
generally preferable.
Cheers,
Bert
On Mon, Jun 17, 2013 at 10:02 AM, Elizabeth Beck
elizabethbe...@gmail.com wrote:
Hello David,
Please do not reply privately.
Reply to the list.
If you have 417GB and that is not enough there must be something wrong with
your approach.
As I said your code is too long. You should try to make a small, short example
illustrating what you are attempting to do.
Berend
On 17-06-2013, at
First, Bert is correct. I should have said to use prcomp(dat, center=TRUE,
scale=TRUE). That will run the svd on the standardized variables which is
equivalent to using princomp(dat, cor=TRUE). You will have to remove the cases
with missing variables or impute the missing variables using one of
David et. al.:
I hate to be a pest but ...
On Mon, Jun 17, 2013 at 11:02 AM, David Carlson dcarl...@tamu.edu wrote:
First, Bert is correct. I should have said to use prcomp(dat, center=TRUE,
scale=TRUE). That will run the svd on the standardized variables which is
equivalent to using
Dear All,
would you please help with the following:
let us say I have:
a -c(0,1,12,13,24,25,36,37)
b -c(6,24.6,27)
#then I extract every 2nd element from a
d -a[seq(1, length(a), 2)]
and what I need help with is to extract the 1st value from d that is greater
than the values in b, so as a
R users,
Abstracts are now being accepted for the 2014 ASA Conference on Statistical
Practice, February 20-24, Tampa, Florida, USA. Each presentation will have
a 45-minute time slot.
Based on a survey of the 2013 attendees there was particular interest in
both R and data visualization. It
Hi Bert David -
I'm putting aside the issues with the missing data for the moment - the NAs
are due to not enough sample volume for testing and there are only about 6
of them for 1 variable. I have multiple data sets to look and not all with
missing values. I do intend to find some local
Hello,
I want to write a function to do pairwise calculation, but I don' know how
to write it. Could anyone help?
i.e. I have A (2*3), B(3*3), C(4*3) three matrices. I want to calculate
distance correlation between each pair of matrices using code dcor. How
do I write a function so that I can
Let’s say I have a data set that includes a column of answers to a question
“What days of the week are you most likely to eat steak?”.
The answers provided are [1] “Friday”, [2] “Wednesday”, [3] “Friday,
Saturday, Sunday, [4] Saturday”, [5] “Sat, Sun”, [6] “Th, F, Sa”
How can I tell R to count
dear all,
I am a student in cs college. I would like to know how to plot infinte
number of genes after using the svm.
the data set i have consists of
x which is a matrix of 39 cancer patients [rows] and 2000 gene names
[colmns]. each cell is the value of the gene for a particular patient.
there
May be this helps:
d[cumsum(sapply(d,function(x) any(xb)))=1]
#[1] 12 24 36
A.K.
- Original Message -
From: Andras Farkas motyoc...@yahoo.com
To: r-help@r-project.org
Cc:
Sent: Monday, June 17, 2013 2:29 PM
Subject: [R] vector question
Dear All,
would you please help with the
HI Andras,
Sorry, I misunderstood your question:
Try this:
sapply(sapply(b,function(x) d[xd]),`[`,1)
#[1] 12 36 36
- Original Message -
From: Andras Farkas motyoc...@yahoo.com
To: arun smartpink...@yahoo.com
Cc:
Sent: Monday, June 17, 2013 2:48 PM
Subject: Re: [R] vector question
Or perhaps something based on findInterval, like
d[findInterval(b, c(d,Inf))+1]
[1] 12 36 36
The details depend on if your inequality is strict or not.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org
Nofe
1. Read the posting guide.
You have to give us a repreducible example
On 17 June 2013 20:49, nofe ganmi nghan...@gmail.com wrote:
dear all,
I am a student in cs college. I would like to know how to plot infinte
number of genes after using the svm.
the data set i have consists of
x
I think proving whether P = NP would be easier than plotting an
infinite number of genes..
;-)
-- Bert
On Mon, Jun 17, 2013 at 11:49 AM, nofe ganmi nghan...@gmail.com wrote:
dear all,
I am a student in cs college. I would like to know how to plot infinte
number of genes after using the
Hi Pascal,
Indeed by following your advice I succeeded to install nloptr.
Thank you very much,
-Original Message-
From: Pascal Oettli [kri...@ymail.com]
Date: 06/17/2013 05:30 AM
To: ce zadi...@excite.com
CC: r-help@r-project.org
Subject: Re: [R] can't install rugarch and nloptr
Hi,
May be this helps:
dat1-
data.frame(Ans=c(Friday,Wednesday,Friday,Saturday,Sunday,Saturday,Sat,Sun,Th,F,Sa),stringsAsFactors=FALSE)
dat1
Ans
1 Friday
2 Wednesday
3 Friday,Saturday,Sunday
4 Saturday
5 Sat,Sun
6
And is there a way to simultaneously tell R that, for example, “Friday” is
the same as “Fri” or “F”; “Saturday” is the same as “Sat” or “Sa”; etc.?
Look at pmatch (partial match):
dayNames - c(Sunday, Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday)
dayNames[pmatch(c(F, Fr,
F Raziq,
Here's a little something to get you started. For ease of viewing, I set P
= 10 and n = 5 (instead of 100 and 50), but this can easily be changed.
You don't say what your original data looks like, so I assumed it was
zeroes and ones to start with. I show an example of a single
Principal components analysis and factor analysis are two techniques
that have different histories, but overlap in the computational
procedures used. Strictly speaking, principal components is a
descriptive procedure used to project a multivariate data set into a
space with fewer dimensions. The
It cannot be done because there is not enough time to create the
plot. In about a billion years the sun will be 10% brighter than
today and the oceans will start to boil away. You will still be
plotting genes when that happens.
:-(
-
David
-Original
I have a collection of .RData files that have result objects that I would like
to combine. Specifically, skatCohort objects from the skatMeta package, but
I've run into a similar issue with simple data.frames also.
If I run something like
FILES - list.files(path=/path/to/my/results,
Dear all,
thanks for giving me hope :) ;)
can amy one just tell me to plot the svm model i need to plot 2 vaiables as
y axis and x axisbut according to the nature of my dataset i have about
2000 variables?? does that mean i have to plot only two?? or is there a way
to plot all of the 2000 and
I probably should have been more specific. The .RData objects which get loaded
have a list called 'res'. This isn't a reproducible example, as I haven't
included any of the RData files.
-Original Message-
From: Rui Barradas [mailto:ruipbarra...@sapo.pt]
Sent: Monday, June 17, 2013
package expm: matrix powers within a product of matrices: operation
precedence
I want to double check that for M and N kxk mtrices and v a k-vector
M%^%2%*%N%*%v is not automatically read as (M%^%2)%*%N%*%v or
M%*%N%^%2%*%v is not automatically read as M%*%(N%^%2)%*%v or
both
Hi,
dat1$Ans-tolower(dat1$Ans)
#But, if you do this:
vec1- c(su,m,tu,w,th,f,sa)
vec2-unlist(strsplit(dat1$Ans,,))
sapply(vec1,function(x) length(vec2[grep(x,vec2)]) )
#su m tu w th f sa # which is incorrect here tu got two matches in
saturday
# 2 0 2 1 1 3 4
Instead:
#Suppose
All operators of the form %something% have the same precedence,
that of %*%.R does not look at the something between the percent
signs to determine the precedence. Hence you must use parentheses
to get the order of operations that you want.
(I think that %something% operators are overused -
Hello,
I just upgraded to 3.0.1 and a bunch of packages won't install, including
Rserve and RCurl
Any hints on why?
Thanks
install.packages('Rserve')
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.case.edu/bin/windows/contrib/3.0/Rserve_0.6-8.1.zip'
Hi,
You didn't provide any information about the package. I guess it is from
energy.
library(energy)
x - iris[1:50, 1:4] #examples given in the package
y - iris[51:100, 1:4]
z- iris[101:150,1:4]
vec1-c(x,y,z)
mat1- combn(vec1,2)
sapply(split(mat1,col(mat1)),function(.dat)
I should have called this failure to install several packages
Here is the list of libraries that I can't install in 3.0.1 that I could
install to 3.0.0
Have others had the same problem?
[1] BiocGenerics BiocInstaller gdata graph
[5] rCharts RCurl Rgraphviz Rserve
Dear R Users,
I've got a strange problem, which I do not really understand:
when I use na.spline from the zoo package, the option na.rm is just being
ignored, see this adjusted example from the na.spline help page:
d0 - as.Date(2000-01-01)
z - zoo(c(NA, 11, 13, NA, 15,
On Mon, Jun 17, 2013 at 6:11 PM, Gene Leynes gleyne...@gmail.com wrote:
I should have called this failure to install several packages
Here is the list of libraries that I can't install in 3.0.1 that I could
install to 3.0.0
Have others had the same problem?
[1] BiocGenerics BiocInstaller
On 13-06-17 5:02 PM, Davis, Brian wrote:
I have a collection of .RData files that have result objects that I would like
to combine. Specifically, skatCohort objects from the skatMeta package, but
I've run into a similar issue with simple data.frames also.
If I run something like
FILES -
On Mon, Jun 17, 2013 at 6:23 PM, Katharina May
may.kathar...@googlemail.com wrote:
Dear R Users,
I've got a strange problem, which I do not really understand:
when I use na.spline from the zoo package, the option na.rm is just being
ignored, see this adjusted example from the na.spline help
many thanks for the enlightenment - I guess I completely misunderstood the
na.rm option here...
On 18 June 2013 00:50, Gabor Grothendieck ggrothendi...@gmail.com wrote:
On Mon, Jun 17, 2013 at 6:23 PM, Katharina May
may.kathar...@googlemail.com wrote:
Dear R Users,
I've got a strange
very simple question. I probably forgot the answer (early stage onset),
and I could not find it via google and r-help.
I have a number of files, each containing one saved data frame. I want to
do the equivalent of
d - .GlobalEnv[[ load(file=d.Rdata) ]
but inside a function, and I don't
very simple question. I probably forgot the answer (early stage onset),
and I could not find it via google and r-help.
I have a number of files, each containing one saved data frame. I want to
do the equivalent of
d - .GlobalEnv[[ load(file=d.Rdata) ]
Did you try using load's
arch.test in vars package with multivariate.only = FALSE
The function
arch.test(x, lags.single = 16, lags.multi = 5, multivariate.only = FALSE)
produces the univariate and multivariate parts of the ARCH test
By_t = C+A_1 y_{t-1}+
.. A_n y_{t-n}+\epsilon (homoskedastic VAR)
And then
#I want to remove '_alpha' in a vector of strings
myInput = c( afg3_alpha, alg12_alpha, dbp3_alpha, elp4_alpha,
fob1_alpha, gpr1_alpha)
#my current solution
tmpsplit = strsplit(myInput, '_')
tmp = NA
for (item in tmpsplit){
tmp = c(tmp, item[1])
}
results1 = tmp[-1];
#this is what I need,
For your problem, you might want to use saveRDS and readRDS instead of
save and load. I would also use dir to get a list of files rather
than paste.
Then your solution might look like:
run - function(filename) {
df - readRDS(filename);
coef( lm(df[,1] ~ df[,2]) )
}
results - lapply(
Thanks, that clears everything up completely. It might be worth adding
your comment to the available documentation.
On 6/17/13, William Dunlap wdun...@tibco.com wrote:
All operators of the form %something% have the same precedence,
that of %*%.R does not look at the something between the
?sub
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#..
gsub(_.*,,myInput)
#[1] afg3 alg12 dbp3 elp4 fob1 gpr1
A.K.
- Original Message -
From: CompBiol ATL along...@gmail.com
To: r-help@r-project.org
Cc: Hong Qin qins...@gmail.com
Sent: Monday, June 17, 2013 6:52 PM
Subject: [R] help with string split in R
#I want to remove '_alpha' in
Thank you mate!
--
View this message in context:
http://r.789695.n4.nabble.com/Data-frame-to-Matrix-by-category-tp4669669p4669768.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
70 matches
Mail list logo