It appears that much of the OP's confusion could be cleared up by studying
relevant resources, e.g. online tutorials or the R Language Maual that
ships with R. This list is not meant to replace such "homework" by users,
as this lengthy and confusing interchange demonstrates.
Having said that, the
By the way, R 'vectors' are not the equivalents of mathematical 'vectors'.
In R, a vector is something that can have arbitrary length and which has
no 'attributes', other than perhaps element names. Vectors can be numeric,
character,
complex, lists, etc. Functions, names, and NULL are not vector
Hi again!
I know you don't find loops evil (well, at least not diabolic :-) ). (After
many hours googling I have realized that thinking about loops rather than lists
is a newbie thing we Stata-users do, I just jokingly pointed it out). Anyway,
I'm really happy that you try to teach me some R-man
See the CRAN Spatial task view:
https://cran.r-project.org/web/views/Spatial.html for relevant packages (I
think).
Further queries should probably be directed to the r-sig-geo list, where
the relevant expertise is more likely to be found.
Cheers,
Bert
Bert Gunter
"The trouble with having an o
Loops are not evil, and no-one in this thread said they are. But I
believe your failure to provide a reproducible example is creating
confusion, since you may be using words that mean one thing to you and
something else to the readers here.
# A reproducible exa
Note that in
for (year in 2000:2007){
varname <- paste0("aa_",year)
assign(paste0(varname), as.vector(eval(as.name(varname
}
the paste0(varname) is redundant - varname was just computed as the return
value of paste0().
People are trying to steer you towards making a lis
If you can change the line colour try this
options(mgp=c(2,0.5,0),cex.lab=1.6)
plot(df1$B, predict(regressor,df1),
type="l",
col="grey",
lwd=2,
lty=1,
xlim=range(c(1.2,1.7)),
ylim=rev(range(c(-19,-8
lines(df1$B,as.numeric(df1$A),
type="p",
col="
:-)
I don't insist on anything, I'm just struggling to learn a new language and
partly a new way of thinking, and I really appreciate the corrections. I hope I
someday will be able to handle lists in R as easy as I handle loops in Stata...
Thanks again!
Love
-Ursprungligt meddelande-
Um, if you insist on doing it that way, at least use
assign(varname, as.vector(get(varname)))
-pd
> On 4 Dec 2017, at 22:46 , Love Bohman wrote:
>
> Hi!
> Thanks for the replies!
> I understand people more accustomed to R doesn't like looping much, and that
> thinking about loops is something
Hi!
Thanks for the replies!
I understand people more accustomed to R doesn't like looping much, and that
thinking about loops is something I do since I worked with Stata a lot. The
syntax from Peter Dalgaard was really clever, and I learned a lot from it, even
though it didn't solve my problem (
Hello,
I have a question. Is there any code in R, so I can delimiy the study area
(bounder)?
plot(proj63PA$Pittosporum_EMmeanByROC_mergedAlgo_mergedRun_mergedData,
main= "", xlab ="x.coords", ylab="y.coords", cex.axis=caxis)
__
R-help@r-project.org ma
Hi,
Sarah's last comment about using min/max x got me thinking. It's not that
the points are "very close together", it's that the x-values are not
ordered. So the plot is actually drawing a dashed line back-and-forth
between different points on the line, which has the effect of making the
result ap
hi Sarah,
Thanks a lot for having taken time to answer me and for your reply. I
wonder how I missed this solution. Indeed plotting the line with the 2
extreme data points works perfectly.
Best,
Jean-Philippe Fontaine
On 04/12/2017 18:30, Sarah Goslee wrote:
It's because you are plottin
Hi,
It's because you are plotting a line between each of the points in
your data frame, and they are very close together:
> cbind(df1$B,predict(regressor,df1))
[,1] [,2]
1 1.410832 -13.96466
2 1.589383 -15.21169
3 1.446662 -14.21491
4 1.488665 -14.50826
5 1.487035 -14.49687
6 1.
dear R users,
I am performing a linear regression with lm, and I would like to plot
the regressor in dashed lines. I know that the lty=2 option is the way
out, but it has a very strange behaviour: the line starts dashed but
then the spaces between each dash becomes very tiny and so the line
b
Hi, thanks to everybody for pointing the issue and their kind answers. I
appreciated, it is solved.
x11<-data.frame(A=c(.6,.6,.6),B=c(.20,.20,.20),C=c(0.20,.20,.20))
ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend= c(.30,.50,.0),zend
=c(.0,.50,0.3)))+
geom_point()+
theme_showarrows()+ge
Hi,
I am trying to run analyzes incorporating sample weight, strata and cluster
(three-stage sample) with PNS data (national health survey) and is giving
error. I describe below the commands used. I could not make the code
reproducible properly.
Thanks,
##
The generic rule is that R is not a macro language, so looping of names of
things gets awkward. It is usually easier to use compound objects like lists
and iterate over them. E.g.
datanames <- paste0("aa_", 2000:2007)
datalist <- lapply(datanames, get)
names(datalist) <- datanames
col1 <- lappl
D'oh! Thanks for pointing this out. I blame caffeine depletion at the time...
-pd
> On 4 Dec 2017, at 15:48 , Eik Vettorazzi wrote:
>
> reading ?plotmath you might notice that "_" isn't the propper syntax for
> subscripts. This will work:
>
> ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yen
reading ?plotmath you might notice that "_" isn't the propper syntax for
subscripts. This will work:
ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend =
c(.30,.50,.0),zend =c(.0,.50,0.3)))+
geom_point()+
theme_showarrows()+geom_segment(size=.5)+
geom_text_viewport(x=c(.45,.27,.37),y=c(.32,.
Hi Love,
I am not sure if I understand your question and it will help if you
provided a sample data frame, sample of your code and sample of your output
and the output you desire. Having said that, I think you could use cbind to
join all datasets into a matrix and use the apply family of functions
Hi,
My example code is this;
x11<-data.frame(A=c(.6,.6,.6),B=c(.20,.20,.20),C=c(0.20,.20,.20))
ggtern(data=x11,aes(A,B,C,xend = c(0.7,.00,0.7),yend = c(.30,.50,.0),zend
=c(.0,.50,0.3)))+
geom_point()+
theme_showarrows()+geom_segment(size=.5)+
geom_text_viewport(x=c(.45,.27,.37),y=c(
> peter dalgaard
> on Mon, 4 Dec 2017 14:55:19 +0100 writes:
>> On 4 Dec 2017, at 11:58 , Levent TERLEMEZ via R-help
>> wrote:
>>
>> Dear Users,
>>
>> What is the proper way to write symbol, superscript,
>> subscript in ggtern/ggplot? I tried every given
Hi R-users!
Being new to R, and a fairly advanced Stata-user, I guess part of my problem is
that my mindset (and probably my language as well) is wrong. Anyway, I have
what I guess is a rather simple problem, that I now without success spent days
trying to solve.
I have a bunch of datasets impo
> On 4 Dec 2017, at 11:58 , Levent TERLEMEZ via R-help
> wrote:
>
> Dear Users,
>
> What is the proper way to write symbol, superscript, subscript in
> ggtern/ggplot? I tried every given example, every possible features of ggplot
> but couldn’t achived. I just want to write P_a, sigma^2, et
Dear Users,
What is the proper way to write symbol, superscript, subscript in
ggtern/ggplot? I tried every given example, every possible features of ggplot
but couldn’t achived. I just want to write P_a, sigma^2, etc, would you please
advise me about this problem.
Thanks in advance,
Levent TER
26 matches
Mail list logo