Displaying 20 results from an estimated 20000 matches similar to: "help!"
2018 Feb 12
2
plotting the regression coefficients
Hi Petr and Richard;
Thanks for your responses and supports. I just faced a different problem.
I have the following R codes and work well.
p <- ggplot(a, aes(x=Phenotypes, y=Metabolites, size=abs(Beta),
colour=factor(sign(Beta)))) +
theme(axis.text=element_text(size = 5))
p1<-p+geom_point()
p2<-p1+theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
2018 Feb 12
3
plotting the regression coefficients
Hi
After melt you can change levels of your factor variable. Again with the toy example.
> levels(temp$variable)
[1] "y1" "y2" "y3" "y4"
> levels(temp$variable) <- levels(temp$variable)[c(2,4,1,3)]
> levels(temp$variable)
[1] "y2" "y4" "y1" "y3"
>
And you will get graphs with this new levels ordering.
2018 Feb 12
0
plotting the regression coefficients
Petr, there was a thinko in your response.
tmp <- data.frame(m=factor(letters[1:4]), n=1:4)
tmp
tmp$m <- factor(tmp$m, levels=c("c","b","a","d")) ## right
tmp[order(tmp$m),]
tmp <- data.frame(m=factor(letters[1:4]), n=1:4)
levels(tmp$m) <- c("c","b","a","d") ## wrong
tmp[order(tmp$m),]
changing levels
2018 Feb 13
0
plotting the regression coefficients
Hi
scale_colour_gradient(?red?, ?blue?)
should do the trick.
Actually I found it by Google
ggplot colour
http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/
http://www.sthda.com/english/wiki/ggplot2-colors-how-to-change-colors-automatically-and-manually#gradient-colors-for-scatter-plots
question. So you could find it too and probably far more quickly then myself as I have also other duties.
Cheers
2006 Feb 07
1
(second round) creating a certain type of matrix
Hi R users
Here is what I got with help from Petr Pikal (Thanks Petr Pikal). I modified
Petr Pikal's code to a little
to meet my purpose.
I created a function to generate a matrix
generate.matrix<-function(n.variable)
{
mat<-matrix(0,n.variable,(n.variable/2)/5+1) #matrix of zeroes
dd<-dim(mat) # actual dimensions
mat[1:(dd[1]/2),1]<-1 #put 1 in first half of first column
2008 Jan 10
6
4 dimensional graphics
Dear all
I want to display 4 dimensional space by some suitable way. I searched
CRAN and found miscellaneous 3 dim graphics packages which I maybe can
modify but anyway I am open to any hint how to efficiently display data
like:
longitude, latitude, height, value
Thank you
Petr Pikal
petr.pikal at precheza.cz
2007 Jan 05
4
Fast Removing Duplicates from Every Column
Hi,
I'm looking for some lines of code that does the following:
I have a dataframe with 160 Columns and a number of rows (max 30):
Col1 Col2 Col3 ... Col 159 Col 160
Row 1 0 0 LD ... 0 VD
Row 2 HD 0 0 0 MD
Row 3 0 HD HD 0 LD
Row 4 LD HD HD 0 LD
... ...
LastRow HD HD LD 0 MD
Now I want a dataframe that looks like this. As you see
2020 Oct 23
2
How to shade area between lines in ggplot2
Thank you, but this split the area into two and distorts the shape of
the plot. (compared to
```
p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2],
linetype = "dashed", col = "royalblue") +
geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2],
linetype = "dashed", col = "royalblue")
```
Why there
2003 May 20
3
plot POSIX class and identify
Hallo all
just a small question I did not find an answer in help pages.
Is it possible to use identify() after plotting with plot.POSIX to
label points and/or to find out some points?
Thanks a lot.
Best regards
Petr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz
2002 Jan 24
5
aggregate, by tapply
Dear R users
I searched some sources but i did not find an answer.Please give
me some hint to following problem.
I would like to compute a summary statistic for some vector for
different factor levels. I know I can use tapply or aggregate but I
do not know if there is a way how to use function with several
(two) variable input (like weighted.mean).
I wrote a simple a function for factor
2009 Jul 29
1
Add a line in a Pairs2 and mark the axis length
Hi,
I have finally installed TeachingDemos trough zip file and installed on
lbrary.
One new question:
I want to draw a line (like abline) on diagonal or the result of running a
ols.
How can I do it.
On the other hand, I want to mark the length on each sub plot y axis.
It is possible?
My function is
sca<-function(){
z2<-read.table("Ase.txt",header=T)
2017 Oct 13
2
How to define proper breaks in RFM analysis
> On Oct 13, 2017, at 2:51 AM, PIKAL Petr <petr.pikal at precheza.cz> wrote:
>
> Hi
>
> You expect us to solve your problem but you ignore advice already recieved.
>
> Your data are unreadable, use dput(yourdata) instead. see ?dput
>
>> test<-read.table("clipboard", heade=T)
> Error in scan(file = file, what = what, sep = sep, quote = quote,
2006 Aug 24
2
my error with augPred
Dear all
I try to refine my nlme models and with partial success. The model is
refined and fitted (using Pinheiro/Bates book as a tutorial) but when
I try to plot
plot(augPred(fit4))
I obtain
Error in predict.nlme(object, value[1:(nrow(value)/nL), , drop =
FALSE], :
Levels (0,3.5],(3.5,5],(5,7],(7,Inf] not allowed for
vykon.fac
>
Is it due to the fact that I have unbalanced
2005 Feb 09
2
[Fwd: Re: Fw: Contour plot]
Petr,
It works perfectly! But I still have a question;
I have fit the following data;
x,y,z
1,10,11
2,11,15
3,12,21
4,13,29
5,14,39
6,15,51
7,16,65
8,17,81
9,18,99
10,19,119
>dat.lm <- lm(z~I(x^2)+y, data=dat)
>dat.lm
Call:
lm(formula = z ~ I(x^2) + y, data = dat)
Coefficients:
(Intercept) I(x^2) y
1.841e-14 1.000e+00 1.000e+00
How do I create the
2007 Mar 15
2
how to...
I have to perform ANOVA's on many different data organized in a dataframe. I can run an ANOVA for each sample, but I've got hundreds of data and I would like to avoid manually carrying out each test. in addition, I would like to have the results organized in a simple way, for example in a table, wich could be easy to export. thank you for assistance
simone
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi
Put fill outside aes
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1)
The "hole" is because you have two levels of data (red and blue). To get rid
of this you should put new data in ribbon call.
Something like
newdat <- trainset
newdat$z <- factor(0)
p+geom_ribbon(data=newdat, aes(ymin =
2004 Jun 09
5
"attach" in R corr. to Spus one
Hi,
I am a newbie to R, just trying to switch from
Splus. I am wondering to know if there is any such
command in R as "attach" in Splus which can be used to
attach the full directory.
Also, any idea/referrence about, how to load c
functions in R would be highly appreciated.
Thanks,
Utsav
2005 Nov 28
2
str and structable error
Hallo
I encountered a behaviour which puzzles me (but
finally I did get what I wanted).
I used structable and strucplot but I wanted to change
names of variables in structable object. I tried to subset
it, use names but to no avail. So I tried str and
expected to get a structure of an object but:
> sss<-structable(Titanic)
> str(sss)
Error in "[.structable"(x, args[[1]],
2007 Mar 02
3
Reformulated matrices dimensions limitation problem
First I wanted to thank both Marc Schwartz Greg Snow and for their reply.
Then I needed to add a level of complexity to the problem.
I would be able to create the biggest possible matrix.
In other way does it exist a method to ask smthing like the following :
max number of rows for a matrix if column=x?
Thank you
------------------------------------------------------
Passa a Infostrada.
2003 Nov 14
2
bad performance of a function
Dear all
I need to find a length of true sequences in logical vector (see example 1). I found
a possible solution which is good but if I use it on a larger data set I experience a
substantial decrease in performance (example 2).
Example 1
set.seed(111)
x <- sample(c(T,F),50, replace=T)
system.time(cetnost <- as.numeric(table(which(x)-cumsum(x[which(x)]))))
[1] 0.00 0.00 0.03 NA NA