Displaying 20 results from an estimated 10000 matches similar to: "TR : Probs with paste"
2008 Jun 09
2
Probs with paste
Hello all,
After some months doing ok with R, I am embarrassed that I have to make
this my first posting to the help list. I am trying to run the
following (actually in a loop but shortened for the post):
risk.factors <- c("file$A", "file$B", "file$C", "file$D", "file$E")
table(paste(risk.factors[1]))
but run into problems
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
2016 Apr 15
0
Decision Tree and Random Forrest
Since you only have 3 predictors, each categorical with a small number of
categories, you can use expand.grid to make a data.frame containing all
possible combinations and give that the predict method for your model to
get all possible predictions.
Something like the following untested code.
newdata <- expand.grid(
Humidity = levels(Humidity), #(High, Medium,Low)
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 11
0
[R-sig-eco] Landscape ecology in R
Hi Manuel,
I've taken the liberty of adding the r-help list back to this email, even though
you sent your reply just to me, so that others may contribute.
On Fri, Mar 9, 2012 at 6:27 PM, Manuel Sp?nola <mspinola10 at gmail.com> wrote:
> Thank you Sarah,
>
> I am thinking more on?habitat mapping and landscape metrics.
Then you've probably seen the adehabitat* and SDMTools
2012 Jun 19
0
[R-sig-Geo] Help in simultaneous equations
On Tue, Jun 19, 2012 at 1:11 PM, Saima Bashir <saimabashir11 at yahoo.com> wrote:
> Hi Sarah,
>
> I have installed and loaded them into R but get same error.
>
> I am using four equations, cross-section data, version R i386 2.15.0.
That is by no means all the information I requested in my original
reply, or all that is requested in the posting guide. Nobody can help
you
2009 May 07
1
paste with apply, spaces and NA
Hello everyone,
I've come up with a problem with using paste() inside apply() that I
can't seem to solve.
Briefly, if I'm using paste to collapse the rows of a data frame, AND
the data frame
contains strings with spaces, AND there are NA values in subsequent
columns, then
paste() introduces spaces. This only happens with that particular combination of
data values and commands. I have
2011 Jul 29
1
help with predict.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)
predict(fit,data[4,])
plot only reveals part of the tree in contrast to the results on obtains
with CART or C5
-------- Original Message --------
Subject: Re: [R] help with rpart
From: Sarah
2016 Apr 15
1
Decision Tree and Random Forrest
I need the output to have groups and the probability any given record in
that group then has of being in the response class. Just like my email in
the beginning i need the output that looks like if A and if B and if C then
%77 it will be D. The examples you provided are just simply not similar.
They are different and would take interpretation to get what i need.
On Apr 14, 2016 1:26 AM,
2011 Feb 26
0
Weird behavior of a 2-by-2 matrix indicies
The real weird thing is I wrote "weird" and it comes out "wired"...
The background is that I did a lot of sparse matrices calculations.
Therefore need some indices tweaks, e.g subtract a block from a big matrix.
Then I just create an indicies matrix and use it directly as a vector since
a matrix is just a vector with dimensions attributed in R. I know I can
convert them to a
2016 Apr 14
3
Decision Tree and Random Forrest
I still need the output to match my requiremnt in my original post. With decision rules "clusters" and probability attached to them. The examples are sort of similar. You just provided links to general info about trees.
Sent from my Verizon, Samsung Galaxy smartphone<div>
</div><div>
</div><!-- originalMessage --><div>-------- Original message
2011 Aug 01
1
Inserting column in between -- "better" way?
Folks:
I consider my reply below rather clumsy: One has to keep track of
index numbers other than that which is inserted and must separately
change column names. Is there as "essentially better" way to do this,
either via base R or via an R package. I leave it to you to define
"essentially better."
Thanks.
Cheers,
Bert
On Mon, Aug 1, 2011 at 10:17 AM, Bert Gunter
2010 Feb 05
0
remove a row from a dataframe, row names disappear - solution
Thank you Sarah.I'm glad it was a quick fix:
On Fri, Feb 5, 2010 at 8:50 AM, Sarah Goslee <> wrote:
> You're not only removing a row of data, you are invoking the default
> behavior of subset, which is to collapse the subsetted result to the
> smallest possible type, which in this case is a vector. Vectors have
> no rows, and thus no row names.
>
> You need the
2011 Dec 12
1
how to colour labels (each label with a colour) in a dendrogram?
Hello to all,
I still have this doubt.
I'd like to colour the different labels of my dendrogram each one with a
different colour. How can I do? I guess I could do using *edgetext* and
then *t.col* or* lab.col* but I don't know how to add edgetext to my
dendrogram. Can you help me please?
Example:
require(graphics); require(utils)
hc <- hclust(dist(USArrests), "ave")
(dend1
2011 Aug 03
0
Combining multiple dependent variables for machine learning -- fortunes candidate?
I thought Sarah's reply was great and, alas, should probably be
templated for this list.
Not sure it fits as a fortunes package entry, but I thought it at
least worthy of consideration.
Cheers,
Bert
>> ...
>> I appreciate any suggestions for this problem.
Sarah Goslee replied:
> Suggestions? Yes. Read the posting guide and follow it. It isn't clear that
> this is even
2017 Nov 23
0
How to produce rainfall maps
Thank you Sarah and Mike for your explanations.
My final objective is to produce maps (png image or any kind of extension I can import in LaTeX) where rainfall data are interpolated, using the Inverse Distance method or Kriging.
My input file (pointfile.csv in the reported example) reports the station code, lat and long of the meteorological station and the rainfall value (which might be the
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 May 11
0
add one variable to a data frame
Sarah's solutions are good, and here's another, even more basic:
tmp1 <- unique(dat1$B)
tmp2 <- seq_along(tmp1)
dat1$C <- tmp2[ match( dat1$B, tmp1) ]
> dat1
N B C
1 1 29_log 1
2 2 29_log 1
3 3 29_log 1
4 4 27_cat 2
5 5 27_cat 2
6 6 1_log 3
7 7 1_log 3
8 8 1_log 3
9 9 1_log 3
10 10 1_log 3
11 11 3_cat 4
12 12 3_cat 4
As a single line
2017 Oct 31
0
convertTime package.
Hi Scott,
Where did you get this function originally? I can't find anything about it.
What OS are you using?
What says, "not available for the version"? Where are you getting that error?
What are you trying to accomplish? What does that function actually
do? It's impossible to suggest a work-around for a function of unknown
purpose and origin.
(The posting guide for this
2007 Jun 15
1
text display using expression or not
Hello,
I imagine that I'm missing something straightforward, but a run thru
the help files didn't turn up an answer.
I noticed while formatting some figures for publication that text
enclosed in expression() and used for a title displays differently
than a string, regardless of the par options. On both postscript()
and x11() devices, the regular text is heavier than the expression text.