Hi John/R-users,
- I have attached the data set in the mail in .txt format, can be read
using read.table(). Kindly let me know please if this is not sufficient.
- Also, to specify the modeling scheme I am stuck at:
1. Have numerical regressors GDP, HPA and FX to predict the variable
Hello, Gabor,
Thanks again for your suggestion. And now I am trying to improve the
code by adding a function to replace the express "Rm1 * ref.1 + Rm2 *
ref.2 + Rm3 * ref.3 + Rm4 * ref.4 + Rm5 * ref.5 + Rm6 * ref.6" because
I have some other dataset need to fitted to the same model but with
more g
Hi Kim, this sounds like a homework question which is not meant for this list,
I don't believe you need a package for this, but you may find the ifelse
function along with the sum()function useful. You can get more information by
typing ?ifelse and ?sum into R.
Regards,
Rhydwyn
Rhydwyn McGuir
No data.
Please have a look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
and http://adv-r.had.co.nz/Reproducibility.html
John Kane
Kingston ON Canada
> -Original Message-
> From: lordpree...@gmail.com
> Sent: Tue, 22 Sep 2015 01:19:38 +0530
And the action is?
John Kane
Kingston ON Canada
> -Original Message-
> From: nico.gutierr...@gmail.com
> Sent: Mon, 21 Sep 2015 16:48:45 +0200
> To: r-help@r-project.org
> Subject: [R] extract from data.frame (indexing)
>
> Hi All,
>
> I need to do the following operation:
>
>
> Ye
It looks like you sent the e-mail in HTML.
It is unreadable.
You must sent e-mail to R-help in plain text not HTML
John Kane
Kingston ON Canada
> -Original Message-
> From: le4...@mweb.co.za
> Sent: Mon, 21 Sep 2015 16:14:41 +0200
> To: r-help@r-project.org
> Subject: Re: [R] R-help,
Use ?mappy and ?rep.int
> x[unlist(mapply(":",2:4,4))] - x[rep.int(1:3,3:1)]
[1] 3 7 20 4 17 13
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Mon, Sep 21, 2015 at 2:17 PM, Dan D wrote:
> I
Your question looks very much like homework and this list does not do
homework for people. Talk to your instructor.
cheers,
Rolf Turner
On 22/09/15 02:14, le4...@mweb.co.za wrote:
Good day,
My name is Kim Nguyen and please I need your help with: How to calculate the PASS
rate of the data
I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x
as:
c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1])
x is increasing with x[1] = 0.
The following works but is not the greatest:
junk<-outer(x, x, '-')
junk[junk>0]
e.g.,
given
x<-c(0, 3, 7, 20)
junk<-outer
better ( if year is an vector of more than 1 element):
df[ df$Year %in% outer(as.numeric( as.character( year)), -1:1, FUN='+'), ]
Year Amount
2 2002120
3 2003175
4 2004160
On Mon, Sep 21, 2015 at 10:49:34PM +0200, Frank Schwidom wrote:
>
> year <- df$Year[ which.max( df$Amount)]
Hi Bob,
Thanks, can you help me undestand why it starts with //observation and how you
know that it is a node?
Glenn
On Sep 21, 2015, at 01:56 PM, boB Rudis wrote:
This is how (one way) in both the xml2 package and XML package:
library(xml2)
library(XML)
txt <- '
'
doc <- read_xml(txt)
year <- df$Year[ which.max( df$Amount)]
df[ df$Year %in% (as.numeric( as.character( year)) + -1:1), ]
Year Amount
2 2002120
3 2003175
4 2004160
On Mon, Sep 21, 2015 at 04:52:46PM +0200, Nico Gutierrez wrote:
> Hi All,
>
> I need to do the following operation from data.frame:
>
>
No.
On Mon, Sep 21, 2015 at 10:58 AM, John McKown
wrote:
> On Mon, Sep 21, 2015 at 9:52 AM, Nico Gutierrez
> wrote:
>
>> Hi All,
>>
>> I need to do the following operation from data.frame:
>>
>> df <- data.frame(Year = c("2001", "2002", "2003", "2004", "2005", "2006",
>> "2007"), Amount = c(150
Hi guys,
I am running Ridge regression on a dataset (predicted variable = y; GDP,
HPA and FX are regressors). I found that lm.ridge() can perform the ridge
regression given any value of lambda (i.e. the ridge parameter). However,
in order to choose the best results, I need to select the model outp
The "
> observation_start="2015-09-01" observation_end="2015-09-01"
> units="lin" output_type="1" file_type="xml"
> order_by="observation_date" sort_order="asc" count="1" offset="0"
> limit="10">
> date="2015-09-01" value="0.46"/>
> '
>
> doc <- read_xml(txt)
> xml_attr(xml_find_all(doc, "//o
I've not used it for group data, and suspect that the code to generate
derivatives cannot cope with the bracket syntax. If you can rewrite the
equation without the brackets, you could get the derivatives and solve
that way. This will probably mean having a "translation" routine to glue
things t
Apologies for replying and overlapping Gabor's contribution, which
actually did the work!
Best, JN
On 15-09-21 01:03 PM, Jianling Fan wrote:
Thanks Gabor,
That works good to rewrite the express the formula!
Thanks a lot!
Regards,
Jianling
On 21 September 2015 at 10:43, Gabor Grothendiec
This is how (one way) in both the xml2 package and XML package:
library(xml2)
library(XML)
txt <- '
'
doc <- read_xml(txt)
xml_attr(xml_find_all(doc, "//observation"), "value")
doc1 <- xmlParse(txt)
xpathSApply(doc1, "//observation", xmlGetAttr, "value")
On Mon, Sep 21, 2015 at 2:01 PM,
Hi All,
I have been trying to extract a value from XML. I have been at it for several
days off and on and I can't seem to get my head around the problem. I
basically understand the examples in R help but I cannot replicate success with
the below
I tried to use xmlValue(doc, "//[[value]]")
On Thu, 2015-09-03 at 16:47 -0400, Ista Zahn wrote:
> Hi Jeff,
> Your chances of getting a useful response will increase if you
> provide
> some additional information. For example, which version of R? Which
> version of ggplot2? What sequence of commands produces the error?
> What
> _exactly_ does
Note the following problems:
1. " max_row <- (1:nrow(df))[which.max(df$Amount)]"
This is a bit silly.
max_row <- which.max(df$Amount)
will do. See ?which.max
2. What happens if the max is the first or last row? e.g.
> dat <- data.frame(a=runif(5),b=1:5)
> max_row<- which.max(dat$b)
> mean(d
On Mon, Sep 21, 2015 at 9:52 AM, Nico Gutierrez
wrote:
> Hi All,
>
> I need to do the following operation from data.frame:
>
> df <- data.frame(Year = c("2001", "2002", "2003", "2004", "2005", "2006",
> "2007"), Amount = c(150, 120, 175, 160, 120, 105, 135))
> df[which.max(df$Amount),] #to extra
I think is time to learning Rcpp! :-)
thank you (Peter Dalgaard and Dirk Eddelbuettel ) by the examples!
the more simples are often more informatives...
cleber
Em 21/09/2015 12:36, Dirk Eddelbuettel escreveu:
peter dalgaard gmail.com> writes:
C is call by value and k and res are pointers
Nico,
I expect there are many better ways to do this, but this does work:
max_row <- (1:nrow(df))[which.max(df$Amount)]
mean(df$Amount[max_row + c(-1, 0, 1)])
> max_row <- (1:nrow(df))[which.max(df$Amount)]
> mean(df$Amount[max_row + c(-1, 0, 1)])
[1] 151.6667
R. Mark Sharp, Ph.D.
Director of P
On 21/09/2015 10:30 AM, Tim Kingston wrote:
>
> Hi ,
>
> I work for the NHS, and our IT service has been unable to download as its
> anti-virus software says it contains an exploit.
>
> Is this normal? Is there a way around this?
>
> Kind regards,
>
> Tim Kingston
>
You don't say what you'
Hi All,
I need to do the following operation from data.frame:
df <- data.frame(Year = c("2001", "2002", "2003", "2004", "2005", "2006",
"2007"), Amount = c(150, 120, 175, 160, 120, 105, 135))
df[which.max(df$Amount),] #to extract row with max Amount.
Now I need to do 3 years average around the
Hi All,
I need to do the following operation:
Year Amount Amount.1
1 2001150 150
2 2002120 120
3 2003175 175
4 2004160 160
5 2005120 120
6 2006105 105
7 2007135 135
[[alternative HTML version deleted]]
___
Hello All,
I have a problem with running the mixed effects Cox regression model using
a distance matrix from a phylogeny rather than a pedigree. I searched
previous posts and didn't find any directly relevant previous posts.
I am interested in using a mixed effects Cox regression model to determi
peter dalgaard gmail.com> writes:
> C is call by value and k and res are pointers. You need a dereferencing
step or nothing with happen. Try
>
> *res = *k + 1;
Or you use Rcpp which writes the glue code. Save the following into a file:
#include
// [[Rcpp::export]]
int adder(int x, int y) {
Hi ,
I work for the NHS, and our IT service has been unable to download as its
anti-virus software says it contains an exploit.
Is this normal? Is there a way around this?
Kind regards,
Tim Kingston
Sent from my HTC
[[alternative HTML version deleted]]
__
Achim,
thank you very much for your help, this really cleared up a number of
issues.
As for the differences in results between the party and partykit
implementations of ctree, I guess that the situation is indeed as you
assumed. Four out of five variables have p-values <2.2e-16. (However, it is
Good day,
My name is Kim Nguyen and please I need your help with: How to calculate the
PASS rate of the data in the table below, with PASS in a single subject if
value>=50 and PASS will be given if PASS 3 out of 4 subjectsWhich package will
I need to use in this analysis
ID
Literacy
Maths
Thanks Gabor,
That works good to rewrite the express the formula!
Thanks a lot!
Regards,
Jianling
On 21 September 2015 at 10:43, Gabor Grothendieck
wrote:
> Express the formula in terms of simple operations like this:
>
> # add 0/1 columns ref.1, ref.2, ..., ref.6
> dproot2 <- do.call(data.f
Express the formula in terms of simple operations like this:
# add 0/1 columns ref.1, ref.2, ..., ref.6
dproot2 <- do.call(data.frame, transform(dproot, ref = outer(dproot$ref,
seq(6), "==") + 0))
# now express the formula in terms of the new columns
library(nlmrt)
fitdp1<-nlxb(den ~ (Rm1 * ref.1
Thanks Prof. Nash,
Sorry for late reply. I am learning and trying to use your nlmrt
package since I got your email. It works good to mask a parameter in
regression but seems does work for my equation. I think the problem is
that the parameter I want to mask is a group-specific parameter and I
have
Hi Jean,
Thank you so much!
Steve
On Sat, Sep 19, 2015 at 1:02 PM, Adams, Jean wrote:
> Here's one way to save your results, using a list of lists and a for()
> loop.
>
> nsim <- 100
> outputs <- vector("list", nsim)
> for(i in 1:nsim) {
> outputs[[i]] <- sim.f(p.s=.05, N=1000, sample.size=6
> On 21 Sep 2015, at 04:03 , Cleber N.Borges wrote:
>
> Dear useRs,
>
> I would like some help on how to make the sum of 1 + 1
> but using the interface between A and C.
>
> the function call does .call lock and close the R.
>
> Thank you for any help it.
Either you need a basic course in C,
Dear useRs,
I would like some help on how to make the sum of 1 + 1
but using the interface between A and C.
the function call does .call lock and close the R.
Thank you for any help it.
Cleber
###
R code
text_code <-"
#include
#include
#include
void testfun
Hi Rosa,
I think I understand more or less what you want, but the example below uses
made up data as I do not have access to your files. The following code
should produce a block of eight plots with the y axes on the leftmost plots
only and the x axes on the bottom row only. I think I have what you
I posted a suggestion to use nlmrt package (function nlxb to be
precise), which has masked (fixed) parameters. Examples in my 2014 book
on Nonlinear parameter optimization with R tools. However, I'm
travelling just now, or would consider giving this a try.
JN
On 15-09-20 01:19 PM, Jianling Fa
Hi
Do not use attachment, copy result of dput(object) to your mail instead. This
enables us to see how your data really look like.
I get different error.
> widesII(used, available, avknown = TRUE, alpha = 0.05)
Error in widesII(used, available, avknown = TRUE, alpha = 0.05) :
used and availabl
Hello,
I have some doubts on the usage of some gdal tools.
After converting a hdf file to tif I want to reproject to SIRGAS2000 and
clip between lats of 22 to 29 S and lats of 40 to 50 W.
HDF file can be downloaded at
https://app.box.com/s/16cf7qv6af6gsz1v66staori2mtneu0r
Basically I'm followin
Hi all,
I am sorry I forgot to attach the excel file and txt files with the test
data I used for this example.
I am almost sure the problem was caused by the way R is reading this data,
Hope to get some help, best, Alex
2015-09-20 14:03 GMT+07:00 Alexander Moßbrucker :
>
> Hi,
>
> I am usi
43 matches
Mail list logo