Displaying 20 results from an estimated 40000 matches similar to: "choosing items from array: very stupid and simple question"
2011 May 29
3
how to combine two data frames via factors (or somehow else)
Hello!
The question should be very naive, but I am a beginner and stuck with
this unfortunately.
There is a dataset of people's affiliation to companies that looks
like that (a data frame actually)
x y
1 a X
2 b X
3 c X
4 f Z
5 e Z
6 g Z
where x is a name of a person and y is a company name. That is, a,b,c
work in a company X. f,e,g work in a company Z.
and there is another dataset with the
2011 Dec 05
1
how to just download file on disk by the link
Sorry for stupid question but is there any way to just download file (excel
file) from the url to the disk with a certain name?
Now it seems that I should open it (via read.xls) and then write it by
write.xls. But I am pretty sure it should be something much easier?
[[alternative HTML version deleted]]
2018 Mar 17
3
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Hi Sarah,
Thank you for your help.
I tried using CR1<-as.matrix(CR1) but gives error Error in corrplot(CR1,
method = "circle") : The matrix is not in [-1, 1]!. I am using a corrplot
library.
Please find the reproducible example:
dput(head(CR1,10))
structure(c(26L, 46L, 39L, 38L, 47L, 59L, 56L, 61L, 43L, 60L,
78L, 63L, 2L, 58L, 8L, 1L, 1L, 9L, 11L, 2L, 1037500L, 46747L,
346300L,
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
That does clarify for me that you're missing a step: I didn't clearly
follow your description at first.
corrplot expects a correlation matrix, not your original data. You need to
use cor() first.
That's pretty clear in the documentation. See for instance the examples:
data(mtcars)
M <- cor(mtcars)
corrplot(M)
Sarah
On Sat, Mar 17, 2018 at 12:00 PM Shivi Bhatia <shivipmp82 at
2013 Jan 29
3
Can I define a object array in R?
Here is my problem,
100 decision trees were built(similar to random forest) and I want to
replace some of them by new trees.
How can I define a tree array including 100 trees, i.e. t[100], and every
t[n] is an "C5.0" object,
such that
when a new tree comes, i can do
n<-10
t[n]<-C5.0(...)
--
View this message in context:
2013 Apr 03
5
Can package plyr also calculate the mode?
I am trying to replicate the SAS proc univariate in R. I got most of the
stats I needed for a by grouping in a data frame using:
all1 <- ddply(all,"ACT_NAME", summarise, mean=mean(COUNTS), sd=sd(COUNTS),
q25=quantile(COUNTS,.25),median=quantile(COUNTS,.50),
q75=quantile(COUNTS,.75),
q90=quantile(COUNTS,.90), q95=quantile(COUNTS,.95),
q99=quantile(COUNTS,.99) )
2018 Mar 17
2
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
Created a new data set with 3 numeric variable to find correlation
CR1<- mar%>% as_data_frame%>% select(AGE, OLD_CAR_PURCHASE_YRS,
Total.Spend.With.AA)
had to convert it to a data frame, code:
as.matrix(as.data.frame(CR1))
Now i need to run a correlation plot for these 3 variables:
corrplot(CR1, method = "circle")
But i am getting this error:
Error in
2017 Jun 25
2
Help to organize data
Hi everybody,
My name is Jackson and come here ask for a help to organize data.
I really need help from you. I have several data sets to organize.
I have to summarize precipitation data collected in different days and
months in only one table.
However, those data are disperse in days and times. Those rainy days have a
more observations than drought ones.
Below you can find a hypothetical
2012 Jul 10
2
how can I show the xlab and ylab information while using layout
hi R-users:
I want to draw three plot into one figure by layout and the script has
been shown below.
But I find R does not show the xlab and ylab information completely as
shown the figure attached.
How can I midify the script.? thank you .
xxlab<-paste(cpmd," (",ro,"%)",sep=" ")
yylab<-paste(rfmd," (",co,"%)",sep=" ")
2011 Sep 09
4
Very simple question about list components
I have a list 'ans' from the following code:
tt <- rnorm(50)
rr <- rnorm(50)
ans <- lm(rr~tt)
ans[1] is "$coefficients", ans[2] is "$residuals", ans[3] is
"$effects", ... and so on up to ans[12]. Is there an easy way to
display just these names and not the data they contain? I thought I
saw my advisor type "ans$" and they were displayed,
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
I'm assuming you are using the corrplot package.
If so, your data object does need to be a matrix, not a data frame.
Since it's already a data frame, your line of code:
as.matrix(as.data.frame(CR1))
doesn't need the as.data.frame function, but more importantly, you
didn't assign the result to anything: as.matrix() does not work in
place.
CR1 <- as.matrix(CR1)
Now try.
If
2012 Nov 20
2
Ordering List Items Chronologically
Dear colleagues,
Is there a way to order list items by date? I have a series of surveys in a list where the name of each list item is the date the survey was taken but the list items are out of order. Each data frame has a variable in it with the survey date as well, if that helps.
Yours, Simon Kiss
#Sample Data
mylist<-list('1991-01-01'=data.frame(a=rep(5,5),
2017 Jun 25
0
Help to organize data
This is pretty badly mangled (please don't post in html), but
?aggregate
is probably what you want.
Sarah
On Sun, Jun 25, 2017 at 5:27 PM, Jackson Rodrigues
<jacksonmrodrigues at gmail.com> wrote:
> Hi everybody,
>
> My name is Jackson and come here ask for a help to organize data.
> I really need help from you. I have several data sets to organize.
>
> I have to
2010 Dec 07
1
please show me simple example how to plot "Distance-Weighted Least Squares" fitting
I got simple x,y pairs of data and simple scatterplot and just cannot figure
how to do it , there are many examples but always there is error popping out
please show me an example stripped with additional data just core of what I
need to do to get this damn line
--
View this message in context:
2012 May 21
1
simple, unidimensional heat map
I was wondering if someone could point in the direction of a package
that could generate not heatmaps, but something like a unidimensional
heat map.
I might be mistaken, but it seems like image and heatmap are an
overkill for such a simple task.
For example, if I have a data frame:
x<-data.frame(myname=paste("value",1:10,sep=""),a=1:10,b=sample(1:10,10,replace=T))
I'd
2011 Oct 17
2
Histogram for each ID value
I have a dataframe in the general format:
chr1 0.5
chr1 0
chr1 0.75
chr2 0
chr2 0
chr3 1
chr3 1
chr3 0.5
chr7 0.75
chr9 1
chr9 1
chr22 0.5
chr22 0.5
where the first column is the chromosome location and the second column is
some value. What I'd like to do is have a histogram created for each chr
location (i.e. a separate histogram for chr1, chr2, chr3, chr7, chr9, and
chr22). I am just
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",",
header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)
Please: Show me the tree.
Mark
-------- Original Message --------
Subject: Re: [R] help with rpart
From: "Stephen Milborrow" <[1]milbo at sonic.net>
2012 Mar 14
2
Using the mantel test in Ape Package
Hi,
I am trying to use a mantel test on two distance matrices. The code I have entered for each is:
Gen_dists <- read.csv(file.choose(),
stringsAsFactors = FALSE,
na.strings = c(" "),
fill = T,
2010 Dec 13
3
curve
Hi All,
I generated 5000 samples using the following script
test<- rnorm(5000,1000,100)
test1 <- subset(test, subset=(test > 1100))
d <- density(test)
plot(d, main="Density of production")
abline(v=mean(test1)
I wanted to do the following but faced difficulties
1. to shade or color (blue) the curve using the criterion that any
2010 Aug 25
4
Merging two data set in R,
Dear R Gurus,
I am currently working on the two dataset ( A and B), they both have the
same fields: ID , REGION, OFFICE, CSTART, CEND, NCYCLE, STATUS and
CB.
I want to merge the two data set by ID. The problem I have is that the
in data A, the ID's are unique. However in the data set B, the ID's are
not unique, thus some repeat themselves.
How do I the merge or retrieve the