Displaying 20 results from an estimated 10000 matches similar to: "how to change legend size in a figure"
2006 Jun 21
4
help on ploting various lines
Dear All,
I tried to plot a variety of lines(curves) on same figure. What I did is,
plot(x=x1,y=y1)
lines(x=x2,y=y2)
lines(x=x3,y=y3)
...
In my data, the maximum of y1 is much smaller than those maximums of other y vectors. So, in the figure I got, there are some curves which are not complete, I mean, they were cut off at the maximum of y1 at the y axis. Could anybody point out some right
2006 Mar 29
6
which function to use to do classification
Dear All,
I have a data, suppose it is an N*M matrix data. All I want is to classify it into, let see, 3 classes. Which method(s) do you think is(are) appropriate for this purpose? Any reference will be welcome! Thanks!
Best,
Baoqiang Cao
2006 Nov 08
2
interprete wilcox.test results
Dear All,
I am using wilcox.test to test two samples, data_a and data_b, earch sample has 3 replicates, suppose data_a and data_b are 20*3 matrix. Then I used the following to test the null hypothesis (they are from same distribution.):
wilcox.test(x=data_a, y=data_b, alternative="g")
I got pvalue = 1.90806170863311e-09.
When I switched data_a and data_b by doing the following:
2006 Oct 06
2
hist plot
Hi there,
I really couldn't find out how to plot histogram with point/line instead of rectangle for each bin? Any help please? Thanks!
Best,
-Cao
2005 Jul 22
2
about nnet package
Dear All,
I'm learning to train a neural network with my training data by using nnet package, then evaluate it with a evaluation set. My problem here is that, I need the trained network to be used in future, so, what should I store? and How? Any other options other than nnet package? Any example will be highly appreciated!
Best,
Baoqiang Cao
2005 Sep 15
2
about cutree
Hi Everyone,
I'm trying to use cutree to get the clusters after hclust. What I used is: mycluster<-cutree(cnclust,h=0.5)
Now, my problem is, how can I get the actual clusters? Thanks!
Best,
Baoqiang Cao
2007 Mar 22
3
"digits" doesn't work in format function
Dear All,
I was trying to format a numeric vector (100*1) by using
outd <- format(x=m, sci=F, digits=2)
> outd[1:10]
[1] " 0.01787758" "-0.14760306" "-0.45806041" "-0.67858525" "-0.64591748"
[6] "-0.05918100" "-0.25632276" "-0.15980138" "-0.08359873" "-0.37866688"
>m[1:10]
[1]
2010 Nov 30
5
how to know if a file exists on a remote server?
Hi,
I'd like to download some data files from a remote server, the problem
here is that some of the files actually don't exist, which I don't
know before try. Just wondering if a function in R could tell me if a
file exists on a remote server? I searched this mailing list and after
read severals mails, still clueless. Any help will be highly
appreciated.
B.C.
2023 Apr 03
4
Simple Stacking of Two Columns
Hi R-Helpers,
Sorry to bother you, but I have a simple task that I can't figure out how to do.
For example, I have some names in two columns
NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly"))
and I simply want to get a single column
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat:
you have
NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly"))
and you want
NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly"))
There must be something I am missing, because
NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2))
appears to
2020 Jul 23
5
Off Topic bash question
I have a simple script:
#!/bin/bash
#
index=0
total=0
names=()
ip=()
while read -r LINE
do
NODENAME=` echo $LINE | cut -f 1 -d ','`
IP=` echo $LINE | cut -f 2 -d ','`
names[index]="$NODENAME"
ip[index]="$IP"
index=`expr index+1`
total=`expr total+1`
done <<< $(cat list.txt)
simple file:
more list.txt
name1,ip1
name2,ip2
name3,ip3
output when
2006 Jan 20
3
Selecting data frame components by name - do you know a shorter way?
Hi! I suspect there must be an easy way to access components of a data frame by name, i.e. the input should look like "name1 name2 name3 ..." and the output be a data frame of those components with the corresponding names. I ´ve been trying for hours, but only found the long way to do it (which is not feasible, since I have lots of components to select):
2012 Oct 10
2
lm on matrix data
Hi,
I have a question about using lm on matrix, have to admit it is very
trivial but I just couldn't find the answer after searched the mailing
list and other online tutorial. It would be great if you could help.
I have a matrix "trainx" of 492(rows) by 220(columns) that is my x,
and trainy is 492 by 1. Also, I have the newdata testx which is 240
(rows) by 220 (columns). Here is
2017 Jul 16
3
Arranging column data to create plots
Dear All,
I need some help arranging data that was imported.
The imported data frame looks something like this (the actual file is huge, so this is example data)
DF:
IDKey X1 Y1 X2 Y2 X3 Y3 X4 Y4
Name1 21 15 25 10
Name2 15 18 35 24 27 45
Name3 17 21 30 22 15 40 32 55
I would like to create a new data frame with the following
NewDF:
IDKey X Y
Name1 21 15
Name1
2001 May 23
1
Passing a string variable to Surv
Hi,
I am trying to write a function to automate multiple graph
generation. My data looks like:
Table of numeric values with the following headers:
timeM1 statusM1 xM1 timeM2 statusM2 xM2 timeM3 statusM3 xM3
1
2
3
4
5
6
Where M1,M2, M3 hve no similarity except they have a max string length
of 7. Examples are mcw0045, adl0003, lei0101.
Now, what I want to do is
Function(M1, M2,
2023 Apr 04
1
Simple Stacking of Two Columns
I may be missing something but using the plain old c() combine function
seems to work fine:
df <- data.frame(left = 1:5, right = 6:10)
df.combined <- data.frame(comb = c(df$left, df$right))
df
left right
1 1 6
2 2 7
3 3 8
4 4 9
5 5 10
df.combined
comb
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
-----Original
2023 Apr 03
1
Simple Stacking of Two Columns
Hi,
You were on the right track using stack(), but you just pass the entire data frame as a single object, not the separate columns:
> stack(NamesWide)
? values ? ind
1 ? ?Tom Name1
2 ? Dick Name1
3 ?Larry Name2
4 ?Curly Name2
Note that stack also returns the index (second column of 'ind' values), which tells you which column in the source data frame the stacked values originated
2005 Jul 13
1
any reference to get started clustering
Dear All,
Just start to use the long expected R, my focus will be
doing clustering on microarray data, just wonder, anyone can
show me any references to conquer the steep learning curve?
Thanks!
Best regards,
Baoqiang Cao
2008 May 25
3
naming components of a list
Hi
I have a character vector with thousands of names which looks like this:
> V=c("Fred", "Mary", "SAM")
> V
[1] "Fred" "Mary" "SAM"
> class(V)
[1] "character"
I would like to change it to a list:
> L=as.list(V)
> L
[[1]]
[1] "Fred"
[[2]]
[1] "Mary"
[[3]]
[1] "SAM"
but I need to
2017 Jun 04
2
Warning from reshape2 when melting a data frame with uneven number of columns.
Here is a small reproducible example:
data <-
structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2",
"Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label =
c("nam1",
"name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label =
c("nam2",
"nam_34",