Hello,
You are right, the "which" option avoid the selection in my example.
Also, I think ?"[[" might be helpful for you.
Regards.
Pascal
On Fri, Mar 28, 2014 at 3:02 PM, Bill wrote:
> Hi. I found that this works:
> tt=readHTMLTable(url,header=TRUE, as.data.frame=TRUE,which=c(3))
> tt[1,]
> I
Thanks Jim,
this partially helps (I wasn't aware of the functions you used, which
are good to know).
I have two main doubts about your solution though.
First of all, in my application x is large ~25 elements and I have
to repeat this for ~1000 different y vectors; moreover the range of x
is muc
Hello togehter,
i have a litte problem. I have an output data.frame which look like this
one:
ID
1 10
2 11
3 12
Now I have another data.frame with more than one line for each ID:
IDGroupValue
1 10110
2 10220
3 103
Try xtabs()
>> df2 = data.frame(ID = c(10,10,10,10,10,11,11,12),Group =
c(1,2,3,4,5,3,4,4),Value = c(10,20,30,40,50,60,70,80))
>> xtabs(df2$Value~df2$ID + df2$Group)
I think this is exactly what you want.
On Fri, Mar 28, 2014 at 4:51 PM, Mat wrote:
> Hello togehter,
>
> i have a litte problem.
Hello,
Maybe the following will help.
library(XML)
oneurl="http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm";
temp.tables=readHTMLTable(oneurl, which = 3)
str(temp.tables)
temp.tables <- temp.tables[-31,]
temp.tables[,1:10] <- lapply(temp.tables[,1:10], function(x)
as.numeric
Sorry, that should be
temp.tables <- temp.tables[-(31:32),]
Rui Barradas
Em 28-03-2014 10:58, Rui Barradas escreveu:
Hello,
Maybe the following will help.
library(XML)
oneurl="http://www.tutiempo.net/en/Climate/FUKUSHIMA/11-2012/475950.htm";
temp.tables=readHTMLTable(oneurl, which = 3)
st
If you don't need a 'running average', there are other 'smoothers' you can
look at. Try 'supsmu':
> set.seed(1)
> x = c(0,1, 3,3.4, 5, 10, 11.23)
> y = x**2 + rnorm(length(x))
> rbind(x, y)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
x 0.000 1.00 3.00 3.4
On 28/03/2014, 2:04 AM, Philippe Grosjean wrote:
On 28 Mar 2014, at 00:57, Duncan Murdoch wrote:
On 27/03/2014, 7:38 PM, Thomas Lumley wrote:
You get what you wanted from
do.call(plot,list(x=quote(x),y=quote(y)))
By the time do.call() gets the arguments it doesn't know how y was
originally
On 28 Mar 2014, at 02:37 , Rolf Turner wrote:
>>
>> So there you are. Feel enlightened?
>
> Somewhat, actually, but not to such an extent as to have reached nirvana.
> "Promises" blow me away.
>
>>
>> Here's the most useful part of the post: to get what you want, use
>>
>> do.call(plot,
On 28/03/2014 6:51 AM, palad...@trustindata.de wrote:
Hello,
I want to draw 3D plot. The coordinates should be inticated with a
red point and additional I want to label them with a name.
I tried this:
plot3d(x, y, z,xlab="PC1", ylab="PC2", zlab="PC3",main="Country
score resemblance (Stoxx
Dear Richard M. Heiberger,
Re:
> Apple has been popping an offer for a free upgrade to Mavericks.
> (I currently have OS X Lion10.7.5 on an 8GB MacBook Air).
> Other than this offer from Apple, I have no dissatisfaction with the Mac
> for my use pattern.
>
> There has been much comment on this
Hi,
I would like to un-compress a gz or a bz2 file to current working directory.
I am able to open the connection in a variety of ways, but than cannot
access the *.*nc file inside.
Is there a way of accessing the netcdf wiathout uncompressing?
(I am using windows8, R 3.0.3)
An example of what I
No, I don't think that will make any difference.
1) Post this to the r-sig-mixed-models list rather than here, as you
are likely to get a much better answer there.
2) Did you realize that treatment is a linear term in the fixed
effects portion, not a factor? If you don't understand the question,
Have you tried running it using lmer() in lme4 instead, see if that helps?
Patrick
2014-03-27 6:21 GMT-06:00 Laura Thomas :
> Hi All,
>
> I am using R for the purpose of multilevel modelling for the first time. I am
> trying to examine individuals interpersonal changes in the dependent variable
I agree with the others that you should consult with a statistician,
but here are some additional things to consider:
The usual equivalence test can be done much simpler (both computation
and conception) by just calculating a confidence interval on the
difference and seeing if the entire interval
Hello,
I want to draw 3D plot. The coordinates should be inticated with a
red point and additional I want to label them with a name.
I tried this:
plot3d(x, y, z,xlab="PC1", ylab="PC2", zlab="PC3",main="Country
score resemblance (Stoxx600 rated by
Vigeo)",text3d(x=x,y=y,z=z,texts=name
Dear all,
I wrote a function :
idrecfun <- function(x)
{
idi <- 1
esn <- x[order(x)]
if !(all(esn==x)) stop("x not ordered")
esn <- as.character(esn)
for (i in 2:length(esn)) if(esn[i]==esn[i-1])
idi[i] <- idi[i-1] else idi[i] <- idi[i-1] + 1
idi
}
for whichever I send th
Hi R Users,
I was trying to select a sample with columns (measured data) by stratum. I was
able to select rows by stratum. But, I wanted to repeat this procedures 1000
and want to take an average from the 1000 times. I think it is different than
bootstraping since I wanted to select (rondomly
This is a bit more direct. It works by forcing R to treat test
as a matrix rather than a table:
> tst2 <- data.frame(ID=dimnames(test)$ID,
as.data.frame.matrix(test),
check.names=FALSE)
> tst2
ID 1 2 3 4 5
10 10 10 20 30 40 50
11 11 0 0 60 70 0
12 12 0 0 0 80 0
> rownames(tst2) <-
Thanks first. Your solutions works nearly perfect, i only have one problem
left.
The result looks like perfect, my problem is now, that i want to convert the
solution into a data.frame.
If i try
test<-xtabs(df2$Value~df2$ID + df2$Group)
test
df2$Group
df2$ID 1 2 3 4 5
10 1
Daer Massimiliano Tripoli,
Re:
> Dear all,
>
>
> I wrote a function :
>
> idrecfun <- function(x)
> {
>
> idi <- 1
> esn <- x[order(x)]
> if !(all(esn==x)) stop("x not ordered")
> esn <- as.character(esn)
> for (i in 2:length(esn)) if(esn[i]==esn[i-1])
> idi[i] <- idi[i-1] else idi[i
Hello,
> install.packages("pROC")
Installing package into
‘/home/l/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
provo con l'URL
'http://cran.mirror.garr.it/mirrors/CRAN/src/contrib/pROC_1.7.1.tar.gz'
Warning in download.file(url, destfile, method, mode = "wb", ...)
:
connesso a '
Evidently different sized dashes were used in my data set. Using gsub or some
other method, is there a way to use a consistent dash? With the different
dash types it is difficult to build histograms, tables, barplots and perform
other analysis.Â
Thanks again for your help and insights.Â
Hello,
Maybe there are other ways but the following works.
tst2 <- matrix(nrow = dim(test)[1], ncol = dim(test)[2])
tst2[] <- test
tst2 <- cbind(dimnames(test)[[1]], tst2)
colnames(tst2) <- c("ID", dimnames(test)[[2]])
tst2 <- as.data.frame(tst2)
tst2
Hope this helps,
Rui Barradas
Em 28-03-
R-helpers:
Hopefully this is an easy one. Given a lookup table:
mylevels <- data.frame(ID=1:10,code=letters[1:10])
And a set of values (note these do not completely cover the mylevels range):
values <- c(1,2,5,5,10)
How do I convert values to a factor object, using the mylevels to
define the
Note that your example may be misleadingly simple, so I made it a bit
more complicated.
The key is ?match
> mylevels <- data.frame(ID=10:1,code=letters[1:10])
> values <- c(1,2,5,5,10)
> with(mylevels,code[match(values,ID)])
[1] j i f f a
Levels: a b c d e f g h i j
## Note that you may have to
On Mar 28, 2014, at 3:38 PM, Jonathan Greenberg wrote:
> R-helpers:
>
> Hopefully this is an easy one. Given a lookup table:
>
> mylevels <- data.frame(ID=1:10,code=letters[1:10])
>
> And a set of values (note these do not completely cover the mylevels range):
>
> values <- c(1,2,5,5,10)
>
On 29/03/14 01:34, peter dalgaard wrote:
On 28 Mar 2014, at 02:37 , Rolf Turner wrote:
So there you are. Feel enlightened?
Somewhat, actually, but not to such an extent as to have reached nirvana.
"Promises" blow me away.
Here's the most useful part of the post: to get what you want,
Hi R,
I am a new Chinese user of R, I like this language very much.In the
recent months,I spend over 4 hours every day leanring R,but during the learning
I come across some problems I can not understand.For R is still not very
popular in China,I ask some net friends but nobody can give m
Here're a couple alternatives if you want to use the index instead of
the variable name:
# Reproducible data frame
a1 <- 1:15
a2 <- letters[1:15]
a3 <- LETTERS[1:15]
a4 <- 15:1
a5 <- letters[15:1]
df <- data.frame(a1, a2, a3, a4, a5)
df
# a1 a2 a3 a4 a5
# 1 1 a A 15 o
# 2 2 b B 14
Thank you very much!
I used indeed rgl.
The problem was apperently that I used text3d() in the wrong way.
When I use it this way:
plot3d(x, y, z,xlab="PC1", ylab="PC2", zlab="PC3", size=5)
text3d(x=x,y=y,z=z,texts=names, col=4)
It workes the way I wanted.
So thanks again and have a nice w
Is this what you're going for?
factor(values, levels=mylevels[[1]], labels=mylevels[[2]])
[1] a b e e j
Levels: a b c d e f g h i j
On 2014-03-28 16:38, Jonathan Greenberg wrote:
R-helpers:
Hopefully this is an easy one. Given a lookup table:
mylevels <- data.frame(ID=1:10,code=letters[1:1
Hi,
After loading my data in R I get the error:
Error in .jcall("com/github/egonw/rrdf/RJenaHelper",
"Lcom/hp/hpl/jena/rdf/model/Model;", :
java.lang.OutOfMemoryError: GC overhead limit exceeded
How can I solve it?
[[alternative HTML version deleted]]
Luca Braglia gmail.com> writes:
> g++ -shared -o pROC.so RcppExports.o delong.o perfsAll.o >
> Rcpp:::LdFlags() > > -L/usr/lib/R/lib -lR
> g++: error: >: File o directory non esistente
This can happen when you have a ~/.Rprofile that messes up the invocation
of Rscript in the src/Makevars (which
I have a time series with 1100 rows of data and am getting contradicting
results from these tests:1) My ACF and PACF plots have lot of lags and upon
looking visually, it looks as if the series in not-stationary.2) But when I
do the ADF test with with lag=30, I reject the null and conclude that seri
35 matches
Mail list logo