Awesome, thanks!
On Wed, Oct 28, 2020 at 7:00 AM Deepayan Sarkar
wrote:
>
> On Tue, Oct 27, 2020 at 6:04 PM Luigi Marongiu
> wrote:
> >
> > Hello,
> > I am using e1071 to run support vector machine. I would like to plot
> > the data with lattice and specifically show the hyperplanes created by
On Tue, Oct 27, 2020 at 6:04 PM Luigi Marongiu wrote:
>
> Hello,
> I am using e1071 to run support vector machine. I would like to plot
> the data with lattice and specifically show the hyperplanes created by
> the system.
> I can store the hyperplane as a contour in an object, and I can plot
> on
Hi: I think you're writing over the plots so only the last one exists.
Maybe try P = P + whatever but
I'm not sure if that's allowed with plots.
On Tue, Oct 27, 2020 at 8:34 AM Luigi Marongiu
wrote:
> Hello,
> I am using e1071 to run support vector machine. I would like to plot
> the data with
Hello,
I am using e1071 to run support vector machine. I would like to plot
the data with lattice and specifically show the hyperplanes created by
the system.
I can store the hyperplane as a contour in an object, and I can plot
one object at a time. Since there will be thousands of elements to
plot
L Carlson
>Department of Anthropology
>Texas A&M University
>College Station, TX 77840-4352
>
>-Original Message-
>From: r-help-boun...@r-project.org
>[mailto:r-help-boun...@r-project.org] On Behalf Of matira
>Sent: Friday, November 15, 2013 7:23 AM
>To: r-help@
lege Station, TX 77840-4352
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of matira
Sent: Friday, November 15, 2013 7:23 AM
To: r-help@r-project.org
Subject: [R] R for loop
Hi
I'm quite new to R and I am having trouble with this cod
Hi
I'm quite new to R and I am having trouble with this code:
names(Mindreader_2012_vars)
varlist<-names(Mindreader_2012_vars)
for (i in 688:696) {
for (j in 673:685) {
assign(paste("Uk_Cluster_",i-687,sep=""),cbind(get(varlist[j],pos=Mindreader_2012_vars)[get(varlist[i],
pos=Mindreader_2012_v
Hi there,
I'm adding a very small bit of something utterly useless to Michael's
response. When you start wondering why your code doesn't work the way
you expect, making it as simple as possible might be the first step.
For example, the following piece of code ...
TRUE
... is simpler than ...
!!
In what way doesn't this work?
You declare xx with one element and it prints.
Then on the next loop, you add another element, and it prints them both.
Then on the next loop, you add another element, and it prints all three.
And so on...
If you look at the output, you can see that it's a growin
Hi,
I'm trying to execute the same R code on multiple data frames listed in a
single directory. The code works fine if I use the code
(below) for each file. However, I have several files and it becomes
tedious to run each one, name it and then aggregate into a single
dataframe.
Name
0.0
elp@r-project.org
Subject: Re: [R] R for loop stops after 4 iterations
There's a seeming inconsistency in this question -- namely, you provide an
example of a data frame with 4 columns but say it is 27x3
-- but I think your question comes from a misunderstanding of what
length(e) calculates.
Hi:
Here are a couple of ways, using the data snippet you provided as the
input data frame e.
Start by defining the function, which outputs a percentage:
f <- function(n, mean, sd) {
s <- rnorm(n, mean = mean, s = sd)
round(100 * sum(s > 0.42)/length(s), 4)
}
(1) Use the plyr packag
On 11-10-22 7:33 PM, Philip Robinson wrote:
I have a data frame called e, dim is 27,3, the first 5 lines look like this:
V1 V2 V3V4
1 1673 0.36 0.08 Smith
2 167 0.36 0.08 Allen
399 0.37 0.06 Allen
4 116 0.38 0.07 Allen
595 0.41 0.08 Allen
Oops!!
Meant pnorm(, lower.tail = FALSE) -- don't do qnorm or bad things will happen.
Sorry,
Michael
On Sat, Oct 22, 2011 at 8:28 PM, R. Michael Weylandt
wrote:
> There's a seeming inconsistency in this question -- namely, you
> provide an example of a data frame with 4 columns but say it is
There's a seeming inconsistency in this question -- namely, you
provide an example of a data frame with 4 columns but say it is 27x3
-- but I think your question comes from a misunderstanding of what
length(e) calculates. For a data frame it gives the number of columns
back. Hence if you have a 27
I have a data frame called e, dim is 27,3, the first 5 lines look like this:
V1 V2 V3V4
1 1673 0.36 0.08 Smith
2 167 0.36 0.08 Allen
399 0.37 0.06 Allen
4 116 0.38 0.07 Allen
595 0.41 0.08 Allen
I am trying to calculate the proportion/p
Consider using a 'list' instead of creating a lot of objects that you then
have to manage:
x <- lapply(1:length(stats$hour), function(.indx) dataset[.indx, 3:15])
You can then access the data as x[[1]], ...
On Tue, May 20, 2008 at 12:58 PM, Douglas M. Hultstrand <
[EMAIL PROTECTED]> wrote:
> He
Take a look at ?assign
Juan Manuel Barreneche wrote:
I had to do the same thing many times, i usually use a combination of the
functions "eval", "parse" and "sprinf", as below:
k <- 1
for (i in 1:length(stats$hour)) {
eval(parse(text=sprintf("x%s <- dataset[%s,(3:15)]", i, k)))
k <- k+1
I had to do the same thing many times, i usually use a combination of the
functions "eval", "parse" and "sprinf", as below:
k <- 1
for (i in 1:length(stats$hour)) {
eval(parse(text=sprintf("x%s <- dataset[%s,(3:15)]", i, k)))
k <- k+1
}
what it does is:
eval(parse(text=STRING)) is a way to
Douglas -
To answer your question directly, use perhaps combination of ?assign and
?paste.
In general, you usually do not have to do this sort of thing, but can
use one of the apply family of functions (apply, sapply, lapply, mapply)
to do whatever you want with shorter, cleaner code and few
Hello,
I am trying to assign a variable name (x1,x2,x3...) in a loop statement
that is based on a counter (counter is based on the number of hours
within the datafile). The x1,x2 data will later be called for plotting
the data. Below is a clip of the for loop I am using, any suggestions?
k
21 matches
Mail list logo