Hi,
On Wed, Mar 23, 2011 at 8:12 PM, Jaimin Dave wrote:
> Hi,
> I am new to R and I want to know how to use C code which contains two
> functions one called inside another.I know that how to use C code in R if it
> has only one function but dont know how to do it in above case.
There's no specia
On Thu, Mar 24, 2011 at 03:49:32PM +1300, Darcy Webber wrote:
> Dear R users,
>
> I am trying to figure out a way to extract the original file name of a
> .DAT (e.g., IC48.DAT) file imported into R using the file.choose()
> function, i.e.,
>
> dat <- read.table(file.choose(), header = FALSE)
>
>
Hi everyone,
I am looking for some recommended reading.
I want to read up on the estimation systems of linear equations using
maximum likelihood?
I have a strongly applied bias, I want to be able to do such estimation myself.
Reading with examples would be great.
Something which also works throug
Dear R users,
I am trying to figure out a way to extract the original file name of a
.DAT (e.g., IC48.DAT) file imported into R using the file.choose()
function, i.e.,
dat <- read.table(file.choose(), header = FALSE)
The reason I would like to do this is to use that file name to name an
output f
Hi,
I am new to R and I want to know how to use C code which contains two
functions one called inside another.I know that how to use C code in R if it
has only one function but dont know how to do it in above case. I want to
use the same in R .My C code is as follows.
//#include
void sayHello();
*H*i,
I am trying to fit a GEE model with *geeglm* function. The model is the
following:
Modelo<-geeglm(sqrt ~Tra+ Mes, id=Lugar , data=datos,
family=gaussian(identity), corstr="independence")
*Tra( is a experimental treatment, 2 levels)*, *Mes* (is the month of take
data, 4 levels) and *Lugar*
exactly, i dont know why the header are separated by invisible periods.
and it only happen to the header.
--
View this message in context:
http://r.789695.n4.nabble.com/Error-in-eval-expr-envir-enclos-object-not-found-tp3399503p3400824.html
Sent from the R help mailing list archive at Nabble
Hello,
I have a dataset which contains multiple trap pulls over the course of a
fishing season. Each trap was baited and then returned to the water to be
pulled again. I am trying to remove that bait from the catch observed on
the next pull (the bait is the same as the catch, lobster). The trap
On Thu, Mar 24, 2011 at 8:26 AM, Brian S Cade wrote:
> As a follow-up to Greg's suggested graphical presentation, it seems like
> the Vuong test is sometimes used to compare fits of non nested models.
>
There is a nice practical example of this with code in R, by Cosma
Shalizi and coworkers, at
h
Thanks to David and William. I hate it when a typo is all it is but I am a
lousy typist.
--- On Wed, 3/23/11, David Wolfskill wrote:
> From: David Wolfskill
> Subject: Re: [R] Separators in strptime---needed?
> To: "John Kane"
> Cc: "R R-help"
> Received: Wednesday, March 23, 2011, 6:35 PM
On Wed, Mar 23, 2011 at 4:15 PM, Ortiz, John wrote:
> Hi,
>
> For example, I have several variables in php, like
>
> var1 = 1, 2, 3, 5, 6
> var2 = 3, 1, 8
> var3 = 8, 10, 4, 0, 9, 1
>
> I sent the arguments to R, with this line:
>
> '/usr/bin/R --vanilla --slave --args '.$var1.' '.$var2.' '.$var3
The usual method for producing interactions of smooths with factors in
mgcv is using `by' variables (see ?gam.models for some documentation).
For example
if `gender' is a two level factor then
... s(time,by=gender) + gender
would produce a smooth of time for each gender. If you want a differen
On Wed, Mar 23, 2011 at 03:22:52PM -0700, John Kane wrote:
> For some reason I thought that I could read some text into dates without a
> separator? Am I wrong?
>
> Examples
>
> Works, it appears
> ccc <- c("2011-04-07", "1989-10-12")
> x <- strptime(ccc, "%Y-%m-%d")
>
> Does not work
> ddd
For some reason I thought that I could read some text into dates without a
separator? Am I wrong?
Examples
Works, it appears
ccc <- c("2011-04-07", "1989-10-12")
x <- strptime(ccc, "%Y-%m-%d")
Does not work
ddd <- c("20110407", "19891012")
y <- strptime(ccc, "%Y%m%d")
Does this mean I would
--- On Wed, 3/23/11, Greg Snow wrote:
> From: Greg Snow
> Subject: Re: [R] stacked bar plot
> To: "Chandra Salgado Kent" ,
> "r-help@r-project.org"
> Also look at the ggplot2 package, it may do the summing as
> part of the plot call and probably does not need the reshape
> step.
If I'm r
You would still have to read every file in, extract the column, modify
it, put it back in the file in the right place and then write the file
out. With a text file that is just a stream of characters, you do not
know where a row is unless you read in the entire file. You might
want to consider us
Dominique,
Let's call your dataframe, df.
Then try:
with(df, boxplot(runoff ~ month))
which will plot the daily runoff distribution by month.
Clint
--
Clint BowmanINTERNET: cl...@ecy.wa.gov
Air Quality Modeler INTERNET: cl...@math.utah.edu
Departme
Tena koe Dominique
?tapply
?aggregate
For example,
dayMn <- tapply(yourData$runoff, yourData[,c('year','month','day')], mean,
na.rm=TRUE)
yearMed <- tapply(dayMn$runoff, dayMn$year, median, na.rm=TRUE)
with(yearMed, plot(year, runoff))
I have not tested the above and since I can never remember
> How do you do a bar chart of 2 vectors?
> I have one vector which has 10 numbers, and another which has 10 names.
> The numbers are the frequency of the corresponding name, but when I do a bar
> chart it says that there is no height. Thanks.
The first thing we'd need to know is HOW you tried to
Hello everyone
I have a dataframe with 4 colums (year, month, day, runoff) for 1993-2009.
Now I like to calculate the average runoff for each day. Finally I like to
plot the median runoff for all this years.
I tried with some loops, but it didn't work. Do you have any Tips for my
problem?
Any help
As a follow-up to Greg's suggested graphical presentation, it seems like
the Vuong test is sometimes used to compare fits of non nested models.
Brian
Brian S. Cade, PhD
U. S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg. C
Fort Collins, CO 80526-8818
email: brian_c...
Dear all,
I am looking at the example in spdep for autocorrelation test as below.
However,
how can one create a nb object for your data? Suppose you have data COL.OLD.
But
how do you create COL.nb from there? Many thanks for your help!
Bill
###
Hi,
It's difficult to know what is going wrong from what you say below (please
include some reproducible code in the future as indicated in the posting
guide). If you want to produce a bar chart of the numbers with the
corresponding names as labels for these numbers, you can do something like
thi
On Wed, Mar 23, 2011 at 1:17 PM, Michal Figurski
wrote:
> Dear R-helpers,
>
> This may sound simple to you, but I'm a beginner in this, so please be
> forgiving.
> I have a following problem: two analytes were measured in patient's blood on
> 4 occasions: ProteinA and ProteinB. How to correctly ev
Dear R-helpers,
This may sound simple to you, but I'm a beginner in this, so please be
forgiving.
I have a following problem: two analytes were measured in patient's
blood on 4 occasions: ProteinA and ProteinB. How to correctly evaluate
correlation between ProteinA and ProteinB?
I tried:
x <
Hi,
For example, I have several variables in php, like
var1 = 1, 2, 3, 5, 6
var2 = 3, 1, 8
var3 = 8, 10, 4, 0, 9, 1
I sent the arguments to R, with this line:
'/usr/bin/R --vanilla --slave --args '.$var1.' '.$var2.' '.$var3.' < script.r'
In my "script.r" I can read the arguments whit this lin
On Mar 23, 2011, at 3:44 PM, Sashi Challa wrote:
Hi Jim,
That is what I ended up doing. Each of my 1000 files has ~1 million
rows, and 19 columns and it was taking 85 secs for every file to be
just read into R.
All I needed to do was replace one column with a particular vector
values. So
On Mar 22, 2011, at 3:16 PM, Gian Luca Negri wrote:
Hi,
I have a data.frame(zscores) that looks like this:
gA gB
g1 0.20.6
g2 0.3Na
I hope it doesn't look likethat because it would mean you had gB as a
character vector when I think you want that value to be NA.
My
micfalb-r wrote:
>
>
> > p.fun <- function(arg){
> two_way_anova <- aov(arg ~ age * treatment, data = example.df)
> two_way_sum <- summary(two_way_anova)
> p_values <- two_way_sum[[1]]$"Pr(>F)"[1:3]
> return(p_values)
> }
>
> Unfortunately my setup seems to be flawed as I'm not capable
Hi Jim,
That is what I ended up doing. Each of my 1000 files has ~1 million rows, and
19 columns and it was taking 85 secs for every file to be just read into R.
All I needed to do was replace one column with a particular vector values. So
wanted to know if there was a way to do it without read
Hi Sandeep.
On Wed, Mar 23, 2011 at 1:03 PM, ssamberkar wrote:
[...]
>
> A -- B in G1
>
> B -- C in G2
>
> so in G3 I would expect
>
> A -- B
>
> B -- C
>
>
> Instead I get B -- Z which baffles me.
This is because the operations are based on the internal vertex ids
and not on the vertex names. Y
If a is a vector with missing values and b is the result of the function call
that has just the non-missing computations on a, then you can do something like:
> newdat <- rep(NA, length(a))
> newdat[ !is.na(a) ] <- b
Sometimes the which and match functions can be useful as well.
--
Gregory (Gr
You can use simulation:
1. Simulate a dataset from what you believe the distribution and relationship
to be.
2. Analyze the simulated data in the manner you plan
3. Determine if the results are significant
Repeat the above many times keeping track of the sifnificances. The percent
significant
You can use the tapply function to sum within combinations, then pass the
results to barplot (possibly doing a reshape first).
Also look at the ggplot2 package, it may do the summing as part of the plot
call and probably does not need the reshape step.
--
Gregory (Greg) L. Snow Ph.D.
Statistic
If you are interested in the fits, then I would just plot the fits. Plot the
fitted/predicted values from the 1st model as the x-values and the
fitted/predicted values from the second model as the y-values. It is best to
plot on a square plotting region and use asp=1, probably also doing ablin
On Mar 23, 2011, at 12:26 PM, blutack wrote:
How do you do a bar chart of 2 vectors?
I have one vector which has 10 numbers, and another which has 10
names.
The numbers are the frequency of the corresponding name, but when I do
How did you "do" a barchart? Code please.
a bar
chart it sa
On Mar 23, 2011, at 12:04 PM, agent dunham wrote:
Dear all,
I've fitted this model with train data
lms <- lm(vd ~ log(v1) + fv2+ fv5+ fv7 )
and predicted over test data using
plms <- predict.lm(lmsub, new=test,interval="predict",
level=0.95,se.fit=TRUE)
I've two questions:
q1: what's the
Erik:
(head smack) Of course! Thank you.
On 3/23/11 2:47 PM, "Erik Iverson" wrote:
>Holly,
>
>try
>
> > length(unique(x)) == 1
>
>where x is your vector of interest. But think about
>how you want NA values to be treated, and also think about
>R FAQ 7.31 if dealing with floating point numbers.
Holly,
try
> length(unique(x)) == 1
where x is your vector of interest. But think about
how you want NA values to be treated, and also think about
R FAQ 7.31 if dealing with floating point numbers.
--Erik
Beale, Holly (NIH/NHGRI) [F] wrote:
Is there a less cryptic way to compare three or mo
Read the whole file in, modify the column and then write the file back out.
On Wed, Mar 23, 2011 at 12:03 PM, Sashi Challa wrote:
> Hello R users,
>
> Good day!!
>
> I was wondering if there is a way in R to read in a particular column from a
> tab-delimited file, edit it and write it back into
On Mar 23, 2011, at 11:01 AM, Beale, Holly (NIH/NHGRI) [F] wrote:
> Is there a less cryptic way to compare three or more values?
>
> allTheSame<-c("red","red","red","red")
> notAllTheSame<-c(132,132,132,999)
>
> all.identical <- function(vectorToTest){
>cIdentical=sum(vectorToTest %in% vecto
Hi Everyone,
Is there a way to get predict.rpart() to return the nodes reached by the new
examples in addition to the predicted probabilities it already returns? In
other words, I would like to know the leaf node in the tree object that each
new example data drops down to.
Thanks in advance fo
Hi Everyone,
I have been using the "tree" package for a while with no problems until now.
When I run predict(tree, newdata), I get an error with the message "Corrupt
tree" for about 50% of the trees that I generate with tree. For other trees,
the predict function completes with no errors.
I h
I want to use gamm to generate smoothed trend line for three groups
identified by dummy variable genea and geneb. My question is how to add in
an interaction term between the time and another dummy variable such as
gender?
fitm<-gamm(change_gfr~
genea+geneb+s(timea_n,bs="ps")+s(timeb_n,bs="ps")+s
Starting with data from a microarray experiment and I would like to analyse the
influence of two factors (age, treatment) on gene expression.
Looking through the r-help archives and the web I tried the following:
I put my data in a dataframe similar to this one:
> example.df <- as.data.frame(mat
Hi Everyone,
Is there a way to get predict.rpart() to return the nodes reached by the new
examples in addition to the predicted probabilities it already returns? In
other words, I would like to know the leaf node in the tree object that each
new example data drops down to.
Thanks in advance fo
Hi Everyone,
I have been using the "tree" package for a while with no problems until now.
When I run predict(tree, newdata), I get an error with the message "Corrupt
tree" for about 50% of the trees that I generate with tree. For other trees,
the predict function completes with no errors.
I h
How do you do a bar chart of 2 vectors?
I have one vector which has 10 numbers, and another which has 10 names.
The numbers are the frequency of the corresponding name, but when I do a bar
chart it says that there is no height. Thanks.
--
View this message in context:
http://r.789695.n4.nabble.c
Hello Everyone!
This is my first post to the mailing list so please forgive me if I am a bit
deflected from the general format of this mailing list posts. Since I need
help in this matter urgently, I would cover up any of my mistakes in posting
later.
That said, I have a problem in merging 2 gra
I'm attempting to use the Adjusted Rand Index to compare different
categorizations in my card-sorting experiment. However, as I am attempting
to replicate a prior study, I am allowing them to put a single card in
multiple piles. However, in the original paper, it looks like Rand expects
the cards
Hi,
I have written a script which read in a data file, process the data, and
then makup a report with the aid of the R2wd package.
This works pretty well on my machine, but instead of installing R and
R(D)COM on every computer in our network, I was thinking about installing
the programs on 1 unus
Is there a less cryptic way to compare three or more values?
allTheSame<-c("red","red","red","red")
notAllTheSame<-c(132,132,132,999)
all.identical <- function(vectorToTest){
cIdentical=sum(vectorToTest %in% vectorToTest[1])
return(cIdentical==length(vectorToTest))
}
all.identical(al
Dear all,
I've fitted this model with train data
lms <- lm(vd ~ log(v1) + fv2+ fv5+ fv7 )
and predicted over test data using
plms <- predict.lm(lmsub, new=test,interval="predict",
level=0.95,se.fit=TRUE)
I've two questions:
q1: what's the difference between writing interval "predict" or "c
I have the following function
myGetstockdataMySQL <- function(startdate, enddate, ticker) {
con <- dbConnect(MySQL(), user="blahblah", password="blahblah",
dbname="blahblah",
host="localhost")
rs <- dbGetQuery(con, "SELECT price.close FROM price INNER JOIN stocks ON
stocks.stock_id=price.stock_
I am trying to pass a additional argument to texi2dvi, for example to use
the aux-directory. Looks like this is not possible via options:
options(texi2dvi='texi2dvi --tex-option="-aux-directory=auxdir"')
texi2dvi(file = "GBPL3.tex", pdf = TRUE)
#Error in system(paste(shQuote(texi2dvi), "--version
Dear John,
Thanks very much! Truly a duh moment...
But I am trying to now use this to test H_0: C\beta = 0. C is a 2x3
matrix, and \beta is 3 x 4.
I have been trying to use the linearHypothesis() function in the car
package. My reading of the help file is that my hypothesis.matrix is
this C. The
Ravi/others:
With all due respect, this seems off topic for this list. I believe
there are machine learning lists for which such discussion might be
better suited.
-- Bert
On Wed, Mar 23, 2011 at 9:55 AM, Ravi Varadhan wrote:
> Ruben,
>
> Thanks for bringing attention to this very interesting a
Ruben,
Thanks for bringing attention to this very interesting article.
The Kaggle competition model is aimed at identifying a "single" best
prediction machine. I am curious as to whether the Kaggle model described
in the article can be extended to an ensemble "uber-learner", where one can
comb
Hi all,
Assume I have a data set collected in a related family.
dat <- read.table(textConnection(" Id Father Mother x y
1 0 0 15 26
2 0 0 18 14
3 1 2 12 25
4 0 2 15 30
5 1 0 19 28"), header=TRUE)
xx=dat$x
yy=dat$y
I want to analyze the correlat
DeaR ComRades,
This is a quote from a News article in Science's 11-February issue, about
competitions to model data:
"For Chris Raimondi, a search-engine expert based in Baltimore, Maryland, and
winner of the HIV-treatment competition, the Kaggle contest motivated him to
hone his skills in a
Hello R users,
Good day!!
I was wondering if there is a way in R to read in a particular column from a
tab-delimited file, edit it and write it back into the file with all other
columns intact. When I say edit I mean just replacing all the values in that
column.
I know to read a particular col
On Wed, 23 Mar 2011, Didier Leibovici wrote:
Hi guys,
I am updating a package because of data format in data folder. So I just
change an extension of a file to .txt ... nothing more.
I get this error on the R CMD check
** help
*** installing help indices
** building package indices ...
Error in
Dear R-Project helpdesk member,
I am currently working on some basic correspondence analysis using the R
packages 'ca'. As I compute the CA by example <- ca(data), and plotting example
via plot(example), I am trying to figure out, how to get a certain desired
plot, so, however, my question
On Mar 23, 2011, at 10:05 AM, agent dunham wrote:
Dear all,
I've fitted a lm using 61 data (training data), and I'left 10 as
test data.
Training data and test data are stored in an excell.
training <- read.xls("C:/./training.xls") , the same for test.
That is:
v1
v2
...
v15
When I
It looks like your column name has periods in it somewhere. Is your header
separated by something other than commas?
look at:
names(data.sex)
or test by
"age" %in% names(data.sex)
--
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Roa
On Mar 23, 2011, at 9:31 AM, mipplor wrote:
datafilename="E:/my documents/r/sex/bysex1.csv"
data.sex=read.table(datafilename,header=T)
data.sex
y.sex.age.region.c.n
1 1980,F,A,N,-18.15,13.61
2 1980,F,A,N,-18.61,13.04
3 1980,F,A,N,-18.81,12.32
41990,F,A,N,-21.12,11.7
5 1990,F,
> datafilename="E:/my documents/r/sex/bysex1.csv"
> data.sex=read.table(datafilename,header=T)
> data.sex
y.sex.age.region.c.n
1 1980,F,A,N,-18.15,13.61
2 1980,F,A,N,-18.61,13.04
3 1980,F,A,N,-18.81,12.32
41990,F,A,N,-21.12,11.7
5 1990,F,A,N,-20.77,11.58
61990,F,A,N,-21.6,13.
Dear all,
I've fitted a lm using 61 data (training data), and I'left 10 as test data.
Training data and test data are stored in an excell.
training <- read.xls("C:/./training.xls") , the same for test. That is:
v1
v2
...
v15
When I type str(training) and str(test), both sets have the sam
Hi,
I would like to compare two models in R with the same dependant variable but
different predictors (two different types of frequency and reaction times as
RT).
An editor told me to have a look at Lorch and Myers 1990.
Lorch and Myers use the following technique:
1) they perform regressions on
I guess matrix(x, ncol=73, byrow=TRUE) should work
Mikhail
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Zablone Owiti
> Sent: Wednesday, March 23, 2011 6:14 AM
> To: r-help@r-project.org
> Subject: [R] How to convert a sing
Peter--
That's it exactly! Thanks.
--Chris
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
425 Robinson Street, Binghamton, NY 13904
cryanatbinghamtondotedu
"Observation is a more powerful force than you could possibly reckon.
The invisible, the overlook
This is no longer on CRAN. Try one of the other constrained optimization
packages: "Rsolnp" or "alabama"
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins Univers
Hi guys,
I am updating a package because of data format in data folder. So I just
change an extension of a file to .txt ... nothing more.
I get this error on the R CMD check
** help
*** installing help indices
** building package indices ...
Error in read.table(zfile, header = TRUE, as.is = FALSE
Thank you for spending time to point me to the posting guide. I
apology for the unclear statement for the R version. It is 32bit
2.12.2.
I love computer programs because I can always "undo" what I did
before. For example I did not intend to close the program but I hit
the mouse by mistake. Then I
On 2011-03-22 12:12, Christopher W Ryan wrote:
I have a dataframe that looks like this:
> str(chr)
'data.frame': 84 obs. of 7 variables:
$ county: Factor w/ 3 levels "Broome","Nassau",..: 3 3 3 3 3 3 3 3 3 3 ...
$ item : Factor w/ 28 levels "Access to healthy foods",..: 21 19 20
18 16
On Wed, Mar 23, 2011 at 11:13 AM, Zablone Owiti wrote:
> Dear users,
>
> I wish to convert a column of data containing pentad (5day mean data)
> from 1962 - 2000 into rows with each row having 73 values (ie. 73 pentads
> per year).
>
>
>
> 1962 pent1 pent2 pent73
>
> .
> .
> .
>
Hi,
I'm using R to treat a table (with a lot of missing values) with Rulefit.
The matter is when I use the command
rfmod. Actually, I don't know how to deal with the error message. I don't
know were "true" or "false" is missing.
Someone can help me?
Thanks
The following part is the script I use
Dear users,
I wish to convert a column of data containing pentad (5day mean data)
from 1962 - 2000 into rows with each row having 73 values (ie. 73 pentads
per year).
1962 pent1 pent2 pent73
.
.
.
.
2000 pent1 pent2 ..pent73
What commands should I use to ach
Hi,
I have a climate data and I use it to draw a graph with N vertices.
I find the density of my graph using,
>DEN <- graph.density(g)
I want to create a random small-world graph(Watts.Strogatz.game) using
similar density.
My N=6000, DEN comes to 0.000451
So, I am using the following approach. I
On Wed, 23 Mar 2011, Feng Li wrote:
Dear R,
I rare use the standard R-gui on Windows. Yesterday I tried the latest
stable release on Windows 7 and XP and found one thing interesting. Assume
You were asked in the posting guide (which clearly you have ignored as
you sent HTML) to be accurate a
On Wed, Mar 23, 2011 at 10:42 AM, Patrick Connolly
wrote:
> G'day Elizabeth,
>
> For what it's worth, this is what I'd do were I in a position
> like yours:
>
> I would put a condition near the end of myfunc. that responded
> when there was an indication that NULLs were to be returned into
> your
G'day Elizabeth,
For what it's worth, this is what I'd do were I in a position
like yours:
I would put a condition near the end of myfunc. that responded
when there was an indication that NULLs were to be returned into
your main list. I'd make an additional list with those bits
which would also
Dear R,
I rare use the standard R-gui on Windows. Yesterday I tried the latest
stable release on Windows 7 and XP and found one thing interesting. Assume
currently I am running R code, say
> example(plot)
Then I click the "close window" button on the R main window. R asks me to
save workspace im
But i want to know that definite function about cfa!do you have?If you
have,could you tell me ?
--
View this message in context:
http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3398600.html
Sent from the R help mailing list archive at Nabble.com.
___
I can't load Rdonlp2 package. Please support me.
Thanks
Thien An
Ho Chi Minh city - VIET NAM
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/lis
thank you ! I will try it
--
View this message in context:
http://r.789695.n4.nabble.com/confirmatory-factor-analysis-program-in-R-tp3386133p3398594.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
http
86 matches
Mail list logo