Hi, I'm new here,
I'd like to map a set of values in a data frame to another set of values in
another frame (think a c++ map<>, a python dict or a hash lookup)
Specifically, I have a data frame of information about trading periods in the
NZ electricity market. For each period I have information
Hi Kat,
Try this:
x1<-c(123, 48, 342, 442, 43, 232, 32, 129, 191, 147)
res<-cut(x1,breaks=seq(0,500,by=100))
library(reshape)
res2<-melt(table(res))
colnames(res2)<-c("bin","count")
> res2
bin count
1 (0,100] 3
2 (100,200] 4
3 (200,300] 1
4 (300,400] 1
5 (400,500]
In an (appropriately) private reply, Noah SIlverman told me that "cost
effectiveness study" is a well-defined term in epidemiology and that
my frustration at his vague description was therefore just a
reflection of my ignorance. I accept that and wish to publicly
acknowledge my error. My apologies
On Jun 11, 2012, at 10:16 PM, David Winsemius wrote:
On Jun 11, 2012, at 10:06 PM, Jie Tang wrote:
hi ,R users
I read a series of file by the command shown as below.
cop_x_data<-read.table(flnm,skip=2)
the first two line of the files are headfile and I skip them.
and sometimes the original d
On Jun 11, 2012, at 10:06 PM, Jie Tang wrote:
hi ,R users
I read a series of file by the command shown as below.
cop_x_data<-read.table(flnm,skip=2)
the first two line of the files are headfile and I skip them.
and sometimes the original data file is null and there is no any data
in the file ex
hi ,R users
I read a series of file by the command shown as below.
cop_x_data<-read.table(flnm,skip=2)
the first two line of the files are headfile and I skip them.
and sometimes the original data file is null and there is no any data
in the file except for the head information.
At this situation
Hi Kat,
Something along the lines of the following might work:
x <- c(123, 48, 342, 442, 43, 232, 32, 129, 191, 147)
table(cut(x, c(0, 100, 200, 300, 400, 500)))
See ?cut and ?table for more details.
Best,
Jorge.-
On Mon, Jun 11, 2012 at 5:22 PM, Kathryn B Walters-Conte <> wrote:
> Hello
>
>
Untested guess -- are you reloading MASS in the new R session? I don't
believe loaded packages are saved in the session image... If MASS
isn't around, R won't know how to plot an lda object.
Best,
Michael
On Mon, Jun 11, 2012 at 4:55 PM, dga...@huskers.unl.edu
wrote:
> Greetings R experts,
>
> I
There's no such thing as "cran r" -- there's just R, possibly using
the binaries distributed by CRAN. [Both are capitalized, por favor]
With that said, I believe the term you are looking for is "Sweave" or,
for a slightly different take on things, "knitr." Both are well
documented with a little bi
Thanks for your response Peter,
Indeed, when I run the R code in a linux terminal, i get the following
error message: address (nil), cause 'memory not mapped'
Thanks for this tips
2012/6/7 peter dalgaard
>
> On Jun 7, 2012, at 12:52 , Nouedoui Laetitia wrote:
>
> > Hi Everyone,
> >
> > This is
Did you ever find an answer to your posted question?
I find I get results if I grab parts of my ff object (indexing or chunks),
do the multiplication, and then loop through the rest of the data, but that
strikes me as a weak work around. One pass should be sufficient as we see
with traditional R
Hello
I am very new to R. I have an R task to complete that I have not been able to
find a straightforward answer to as of yet. I have a list of values. I would
like to count the number of values that are in one bin, the number that fall in
the next bin, etc.
For example
My input file is:
Bert,
I AM a statistician. Your lack of familiarity with this particular subset of
stats is no reason to insult me or my posting.
"Cost Effectiveness" is a very standard field of study in health care and
epidemiology. The methods and models are common and well defined. I did not
ask for hel
hi i see you can create latex pdf files using eclipse and that cran r code
can be put on it direcctly. I have tried but it seems very difficult there
is an easy way step by step manual and explaining all programs and folders
needed?
[[alternative HTML version deleted]]
___
Hi,
Not sure if this is what you want.
dat1<-matrix(sample(1:7,70,replace=TRUE),ncol=10,byrow=FALSE)
dat2<-matrix(sample(1:7,70,replace=TRUE),ncol=7,byrow=FALSE)
dat1[dat1[,1:10]==1]<-NA
> dat1
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 4 3 2 3 7 6
Greetings R experts,
I'm having some difficulty recovering lda objects that I've saved within
sublists using the save.image() function. I am running a script that exports a
variety of different information as a list, included within that list is an lda
object. I then take that list and create a
Noah:
On Mon, Jun 11, 2012 at 3:28 PM, Noah Silverman wrote:
> Hello,
>
> I was just assigned to perform a cost effectiveness study in healthcare. We
> are studying the cost effectiveness of a proposed diagnostic vs. current
> screening procedures.
-- Please! -- Do you think this really desc
Hello,
There are also other possibilities. What I believe is the easiest is to
go back to the beginning, i.e., have the function return a vector as
before, and then use lapply on the data.frame's rows.
testfun <- function (x, y) seq(x, y, 1)
testframe$newcolumn <- lapply(1:nrow(testframe),
Hello,
I was just assigned to perform a cost effectiveness study in healthcare. We
are studying the cost effectiveness of a proposed diagnostic vs. current
screening procedures.
One of the team members suggest a commercial software package called "TreeAge
Pro". Looking at the description, it
It is possible to chain together uses of `[[` -- e.g.,
x <- list(1:5, list(letters[1:5], list(LETTERS[1:5])))
x[[c(1,2)]] # 2L
x[[c(2,1,3)]] # "c"
x[[c(2,2,1,3)]] # "C"
which is sometimes useful.
Best,
Michael
On Mon, Jun 11, 2012 at 4:35 PM, Onur Uncu wrote:
> Rui and the R-help team,
>
>
Rui and the R-help team,
In Rui's helpful answer below, the function returns a list as output.
When we apply() the function to the data.frame, dataframe$newcolumn
has 2 layers of list before we can access each vector elements. For
instance, dataframe$newcolumn[[1]][[1]] is a vector whereas
datafra
Hi Curtis,
This isn't quite a reproducible example, though very close. As far as
I can tell, you're over-thinking it.
Instead of:
bengood1=ifelse(search_strat_good==1,sample(m_good_D1,replace=F),search_strat_good)
bengood1 <- search_strat_good
bengood1[bengood1 == 1] <- sample(m_good_D1, size=su
Thanks! I was having the same issue. my treatments were 'days' so they were
in intervals of 15 days. My anova was fine but I couldn't get my tukey to
produce results. Used your code and it worked.
--
View this message in context:
http://r.789695.n4.nabble.com/TukeyHSD-troubles-tp1570205p463304
Look at kruskalmc in package pgirmess and package multcomView for plotting
the results.
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Original Message-
> From: r-help-boun...@r-pr
Hello,
I'm having trouble performing a certain function within R and I was hoping
someone might be able to help. I have a matrix (1000x21) that contains
whole-number values ranging from 1-7 and I want to replace all entries
within this matrix that have a value of 1 with a random number contained
On Mon, Jun 11, 2012 at 1:22 PM, Sam Albers wrote:
> Hello,
>
> I am trying to define a different interval for a "year". In hydrology,
> a "water year" is defined as the period between October 1st and
> September 30 of the following year. I was wondering how I might do
> this in R. Say I have a da
I was able to get the predicted values from the splines. Thanks so much
for the help.
I wrote a loop with some of the code that Bill suggested. It seems that
when using predict with nlme, it is important to be specific with what one
is using as newdata. This does come through in Pinheiro and Ba
Dear list,
I've been using R for a while, but am new to web services. I'm a relatively
novice programmer; advance apologies for incorrect terminology.
I'm trying to send queries and get results back from a SOAP server, using
the SSOAP package. My code contains sensitive API keys and URLs, and
unf
Hi All,
Could anyone please tell the installation steps of RSruby gem on Windows XP.
I have latest version of ruby & R installed on Windows.
Thanks
--
View this message in context:
http://r.789695.n4.nabble.com/R-and-Ruby-integration-using-RSruby-gem-tp4633020.html
Sent from the R help mailing
I've tried again and it worked fine this time. I can't figure out why it
didn't last time.
Thanks for helping anyway!
On Mon, Jun 11, 2012 at 4:58 AM, Robert Baer wrote:
> wdGet()
>>
> Error in if (wdapp[["Documents"]][["Count"**]] == 0)
> wdapp[["Documents"]]$Add() :
> argument is of length
Hi, I have searched and found a response to a question similar to mine but
when I tried the code, R says it's not an actual function so I thought I'd
ask here.
http://r.789695.n4.nabble.com/file/n4633035/Cookies.csv Cookies.csv
I have attached the data I am using. I am trying to look at two thi
Hi,
Hope this links will be useful
http://flowingdata.com/2010/11/23/how-to-make-bubble-charts/
http://sas-and-r.blogspot.com/2010/03/example-728-bubble-plots.html
A.K.
- Original Message -
From: Timothy Murphy
To: r-help@r-project.org
Cc:
Sent: Monday, June 11, 2012 11:54 AM
Subj
Here's one way.
(not including the conversion to factor)
wdf <- data.frame(Date=seq(as.Date("2000/10/1"), as.Date("2003/9/30"),
"days"))
wdf$wyr <- as.numeric(format(wdf$Date,'%Y'))
is.nxt <- as.numeric(format(wdf$Date,'%m')) %in% 1:9
wdf$wyr[ is.nxt ] <- wdf$wyr[is.nxt]-1
## and you can do so
Duncan,
Excellent, that looks like it will do the trick exactly. Thank you for your
help.
TJ
On Mon, Jun 11, 2012 at 2:27 PM, Duncan Murdoch wrote:
> On 12-06-11 1:49 PM, Timothy Murphy wrote:
>
>> John,
>>
>> It does 3D bubble plots, allowing you to represent 4 data dimensions: the
>> x, y, an
On 2012-06-11 10:49, Timothy Murphy wrote:
John,
It does 3D bubble plots, allowing you to represent 4 data dimensions: the
x, y, and z coordinates in 3D space, and the radius of the bubble (sphere).
There also seem to be coloring options.
I'd like to use something like this for a project I'm wo
On 12-06-11 1:49 PM, Timothy Murphy wrote:
John,
It does 3D bubble plots, allowing you to represent 4 data dimensions: the
x, y, and z coordinates in 3D space, and the radius of the bubble (sphere).
There also seem to be coloring options.
Sounds like plot3d with type="s" and size specified. p
Should have been
For the normal inverse Gaussian: Package 'GeneralizedHyperbolic'
For the generalized inverse Gaussian: Package 'HyperbolicDist'
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
Hello,
I am trying to define a different interval for a "year". In hydrology,
a "water year" is defined as the period between October 1st and
September 30 of the following year. I was wondering how I might do
this in R. Say I have a data.frame like the following and I want to
extract a variable wi
What exacrly does it do? Any pointers to relevant plots?
John Kane
Kingston ON Canada
> -Original Message-
> From: timothyjosephmur...@gmail.com
> Sent: Mon, 11 Jun 2012 10:54:28 -0500
> To: r-help@r-project.org
> Subject: [R] bubbleplot3: R equivalent of the MATLAB function?
>
> All,
A data.frame is a list with some extra attributes. When you
subset a data.frame as
z["Column"]
you get a one-column data.frame (which boxplot rejects because
it want numeric or character data). Subsetting it as either
z[, "Column"]
or
z[["Column"]]
gives you the column itself, not a data
Dear R-help,
I'm trying to train myself how to do six-sigma analysis (with R) and
visualization (with d3.js), but all I can find is summary xls sheets,
never the raw data they made the charts from.
Does anyone know where I can get access to large amounts of quality
data? Industry/application does
I'm trying to setup a snow grid using sockets (Windows 7). On the test grid
(my computer and another) I have an SSHD server up and running, can connect
OK via public key authentication. Running "makeSOCKcluster" on just my local
machine works OK. Running it to the other computer fails. My SS
Hi Martijn,
Irrespective of the p-value, 'bam' and 'lmer' agree that the variance
component for 'Placename' is practically zero. In the 'bam' output see
the 'edf' for s(Placename), or for a more direct comparison call
gam.vcomp(m1).
As mentioned in ?summary.gam the p-values for "re" terms ar
John,
It does 3D bubble plots, allowing you to represent 4 data dimensions: the
x, y, and z coordinates in 3D space, and the radius of the bubble (sphere).
There also seem to be coloring options.
I'd like to use something like this for a project I'm working on; a
simulation I've done in R. Of cou
They aren't quite lists --- they are actually data.frame()s which are
a special sort of list with rownames and other nice things.
To your immediate question, I think you're looking for the formula interface:
boxplot(Value ~ State.Fips, data = CB_un)
The data= argument is important so boxplot kno
Hi,
Have you tried
str(CB_un)
to make sure the structure of your data is what you expect?
Does
boxplot(CB_un[, "Value"]~CB_un[, "State.Fips"])
work?
Look at this:
> testdf <- data.frame(a=1:3, b=11:13)
> class(testdf["a"])
[1] "data.frame"
> class(testdf[["a"]])
[1] "integer"
> class(testdf[, "a
On Jun 11, 2012, at 12:29 PM, Samantha Sifleet wrote:
Hi,
I am a relatively new to R. So, this is probably a really basic
issue that
I keep hitting.
I read my data into R using the read.csv command:
x = rep("numeric", 3)
CB_un=read.csv("Corn_Belt_unirr.csv", header=TRUE,
colClasses=c("f
Many ThanKs to all.
2012/6/10 Bert Gunter
> On Sun, Jun 10, 2012 at 2:22 PM, arun wrote:
> > Hi Bert,
> >
> > I tried the code.
> >
> > dat2<-data.frame(dat1)
> >> do.call(order,dat2)
> > [1] 3 6 1 10 2 5 7 9 8 4
> >
> >
> > Here, I get the order of 1st column as a list. Is there an
Hi,
I am a relatively new to R. So, this is probably a really basic issue that
I keep hitting.
I read my data into R using the read.csv command:
x = rep("numeric", 3)
CB_un=read.csv("Corn_Belt_unirr.csv", header=TRUE, colClasses=c("factor",
x))
# I have clearly told R that I have one factor v
All,
Does there exist an R equivalent of the MATLAB function "bubbleplot3"?
Semi-naive Googleing has thus far revealed no such package to me. Your
insight is appreciated!
Regards,
TJM
[[alternative HTML version deleted]]
__
R-help@r-project.o
Same problem here. I have updated rattle from the repository as suggested by
Graham, but this, unfortunately, did not solve the issue. (The release date
in the 'About Rattle' dialog is 2012-04-22.) Any other ideas?
Graham Williams wrote
>
> It is fixed and 2.6.19 will include the fix.
>
When
Hello,
See if the following function does it
#--
# Round POSIXct date/time
#
round.POSIXct <- function(x, units = c("mins", "5 mins", "10 mins", "15
mins", "quarter hours", "30 mins", "half hours", "hours")){
if(is.nu
Thanks! This link is very helpful.
Best
Gary
On Mon, Jun 11, 2012 at 4:28 AM, D.Soudis wrote:
>
> Hi,
>
> Maybe this is helpful..??
>
> http://www.ats.ucla.edu/stat/r/faq/spatial_regression.htm
>
> Best,
> Dimitrios
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/controll
The same statement is true for the "plotmo" function. It also does not
handle the situations right if the training functions contains
interactions. You can try this out using this code:
library(caret)
data(trees)
m = train(Volume~(Girth+Height)^2, data=trees, method="lm")
plotmo(m$finalModel)
Hello all,
I am running the function "rda" of the vegan library, like I did many
times without having troubles, and I get the following error message:
"Error in if (rank) { : argument is not interpretable as logical".
I am just testing a response matrix against a single explanatory
matrix, which
For the normal inverse Gaussian: Package 'GeneralizedHyperbolic'
For the generalized inverse Gaussian: Package 'GeneralizedHyperbolic'
--
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -Or
This does tend to look like homework, but...
If you want them in one vector, then that vector will have length 225*100,
of course. So rt(225*100,225) would do it. Or you could use the matrix()
function to convert this to a matrix. See ?matrix.
-Don
--
Don MacQueen
Lawrence Livermore National L
Hello,
I am trying to fit a gamm (package mgcv) model with a smooth term, a linear
term, and an interaction between the two. The reason I am using gamm rather
than gam is that there are repeated measures in time (which is the smooth term
x1), so I am including an AR1 autocorrelation term. The m
diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for
diag(5e3). However, it's slow when n = 23000, diag(23000) took 15 sec
On 11 June 2012 17:43, Ceci Tam wrote:
> diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for
> diag(5e3). However, it's slow when n = 23000, dia
Hi,
Maybe this is helpful..??
http://www.ats.ucla.edu/stat/r/faq/spatial_regression.htm
Best,
Dimitrios
--
View this message in context:
http://r.789695.n4.nabble.com/controlling-spatial-autocorrelation-in-linear-regression-models-tp4632940p4632998.html
Sent from the R help mailing list archi
Dear Simon,
I ran an additional analysis using bam (mgcv 1.7-17) with three random
intercepts and no non-linearities, and compared these to the results
of lmer (lme4). Using bam results in a significant random intercept
(even though it has a very low edf-value), while the lmer results show
no vari
you are right, it shows False for all variables.
The use.value.labels switch is not on, it does not work also when I type
number manually in notepad (csv) or excel.
Is there a way to force the variables to numeric?
On 11 June 2012 12:23, William Revelle wrote:
> Dear codecat,
> To track down
Eric,
I'd be happy to help. Please follow the posting guide (specifically
the "Surprising behavior and bugs" section) and provide a *minimal*,
reproducible example and the output from sessionInfo().
http://www.r-project.org/posting-guide.html
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrad
Hi Martijn,
The negative edf from fREML was a matrix indexing bug triggered by the
"re" term (other fREML discrepancies followed from this). Fixed for
1.7-18. Thanks for reporting this, and the supporting offline info!
best,
Simon
On 02/06/12 23:17, Simon Wood wrote:
the fREML results must
Hi Martijn,
The issue in this case is that the estimates for the terms are rather
different (not just the p-values). I think that the difference is down
to this change made in version 1.7-13 (from changeLog)...
* "re" smooths are no longer subject to side constraint under nesting
(since thi
Dear codecat,
To track down where the trouble is, try
lapply(my.data,is.numeric)
That will tell you which column of your data is giving you problems.
It is possible that you read the data in from SPSS and did not turn off the
use.value.labels switch.
On Jun 11, 2012, at 1:55 AM, codec
Hi Simon,
Thanks for your reply. That is very helpful.
However, in the logistic regression example, there also appears to be
a large difference in the p-values and estimates when comparing
summary(model) # mgcv 1.7-11
summary(model,freq=F) # mgcv 1.7-17
These should be the same, right? But why i
Dear Martijn,
You are right that the change in the summary defaults was not a sensible
thing to do, and I'll change it back. However in the mean time you can
use 1.7-17 with summary(...,freq=FALSE), when you have random effects in
the model (it really shouldn't make a statistically meaningful
Thank you Rui,
I am trying to create a column in the data file turtlehatch.csv
Saludos, Jean
--
View this message in context:
http://r.789695.n4.nabble.com/Grouping-distances-tp4632985p4632989.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi
I keep having this error when I used omega(my.data)
Error in cor(m, use = "pairwise") : 'x' must be numeric
I'm quite sure my data is numeric as I have tried several methods such as
opening csv in notepad and make sure the number is not string, also tried
SPSS and make sure the numbers are se
Thanks for all who replied me to this topic. I have the "L" (cholesky
decomposed matrix)as a vector listed as columwise as mentioned in the article
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.494 and looking for
functions to convert the vector into inverse matrix ( but chol2inv m
sorry but I can't close this thread with a viable solution other than the
following one
(i.e. by defining an user function to add line);
I understand that the problem is related to the fact that:
mean(log(.)) != log(mean(.)) is
but for some reason I can't put all that in practice inside the
pan
Hello,
It's easy to create a new column. Since you haven't said where nor the
type of data structure you are using, I'll try to answer to both.
Suppose that 'x' s a matrix. Then
newcolumn <- newvalues
x2 <- cbind(x, newcolumn) # new column added to x, result in x2
Suppose that 'y' is a data.
73 matches
Mail list logo