Displaying 20 results from an estimated 400 matches similar to: "accessing factor levels from C"
2018 May 08
2
unlist errors on a nested list of empty lists
On 08/05/2018 2:58 PM, Duncan Murdoch wrote:
> On 08/05/2018 1:48 PM, Steven Nydick wrote:
>> Reproducible example:
>>
>> x <- list(list(list(), list()))
>> unlist(x)
>>
>> *> Error in as.character.factor(x) : malformed factor*
>
> The error comes from the line
>
> structure(res, levels = lv, names = nm, class = "factor")
>
2018 May 09
2
unlist errors on a nested list of empty lists
On 08/05/2018 4:50 PM, Steven Nydick wrote:
> It also does the same thing if the factor is not on the first level of
> the list, which seems to be due to the fact that the islistfactor is
> recursive, but if a list is a list-factor, the first level lists are
> coerced into character strings.
>
> > x <- list(list(factor(LETTERS[1])))
> > unlist(x)
> Error in
2008 Apr 27
1
parallel max, min, and median of dataframe columns
Hello, all,
I have a dataframe of three rows and umpteen columns. I want to show the
maximum, minimum, and median with a vertical line and a central dot (I'd
use a boxplot, but with only three data points, that's overkill; I can't
just use points, because of overlap and some of the other data plotted on
the graph).
This works:
> boxplot(data_frame,
2005 Aug 16
1
predict nbinomial glm
Dear R-helpers,
let us assume, that I have the following dataset:
a <- rnbinom(200, 1, 0.5)
b <- (1:200)
c <- (30:229)
d <- rep(c("q", "r", "s", "t"), rep(50,4))
data_frame <- data.frame(a,b,c,d)
In a first step I run a glm.nb (full code is given at the end of this mail) and
want to predict my response variable a.
In a second step, I would
2008 Aug 13
1
need help with stat functions(like adaboost, random forests and glm)
Ok, so basically I have a dataframe named data_frame
data_frame contains:
startdate
startprice
endpricethreshold1
endpricethreshold2
endpricethreshold3
all of these endpricethresholds are true/false binary vectors. They are
true or false depending on whether the endprice was above or below whatever
the endpricethreshold is.
now I want to try to use lets say the general linear model to have
2006 Jan 24
1
No scientific notation in format
Hi
I have a data.frame with the following numbers (first column are month
numbers)
07,0,0,0,0.315444056314174,0,0,0,12.5827462764176,0.079194498691732,
0.0280828101707015,0,0.0695808222378877
08,0,0,105600,0.393061160316545,0,0,0,8.95551253153947,0.0880023174276553,
0.285714285714286,0,0.0669139911789158
09,0,0,0,0,12.5,0,0,13.5135887094281,0.0557531529154668,0,0,
0.0487526139182026
2009 Aug 08
2
[PATCH] pxe: fix OACK packet handling
The current code only works iff the tsize option is set.
This patch fixes the handling of the OACK packet and makes the code
work with all combinations of the tsize and blksize options.
Signed-off-by: Sebastian Herbszt <herbszt at gmx.de>
diff --git a/core/pxe.c b/core/pxe.c
index 81d3e23..a4b8a14 100644
--- a/core/pxe.c
+++ b/core/pxe.c
@@ -913,8 +913,10 @@ static void pxe_searchdir(char
2012 Jan 01
1
empty files created with trellis xyplot jpeg device
New years greetings.
I have been setting up a function to generate multiple jpeg charts. When
the calls are issued at the interactive console, the jpeg files are
generated without an issue. When I try to issue the same calls from a
function, some chart files are empty. It appears to only be related to
trellis charts. Any help to troubleshoot this is appreciated.
Regards,
-mike
R version
2018 May 08
0
unlist errors on a nested list of empty lists
It also does the same thing if the factor is not on the first level of the
list, which seems to be due to the fact that the islistfactor is recursive,
but if a list is a list-factor, the first level lists are coerced into
character strings.
> x <- list(list(factor(LETTERS[1])))
> unlist(x)
Error in as.character.factor(x) : malformed factor
However, if one of the factors is at the top
2017 Nov 08
2
Ggplot error
Hello,
I've an error recently.
ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line()
Error: Found object is not a stat.
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS
Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LC_CTYPE=tr_TR.UTF-8
2018 May 08
2
unlist errors on a nested list of empty lists
Reproducible example:
x <- list(list(list(), list()))
unlist(x)
*> Error in as.character.factor(x) : malformed factor*
What should happen:
unlist(x)
> NULL
R.version
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 5.0
year 2018
month 04
day
2018 May 09
0
unlist errors on a nested list of empty lists
I do not have access to the bug reporting system. If somebody can get me
access, I can create a formal bug report.
The latter issues seem like duplicates of:
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=12572 (with slightly
different output), but as that bug was reported nearly 10 years ago, it
might be worth creating an update under R version 3. I could not find the
first issue when
2017 Nov 08
0
Ggplot error
I was not able to reproduce this problem. I tried two environments
1. Ubuntu 14.04.5 LTS, R version 3.4.2 (same R version as yours)
2. Windows 10, same R version
On Wed, Nov 8, 2017 at 9:50 AM, Zeki ?ATAV <zcatav at gmail.com> wrote:
> Hello,
> I've an error recently.
>
> ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line()
> Error: Found object is not a stat.
>
2009 Jul 02
3
Testing for membership in an array of strings
As an R beginner, I feel brain dead today as I can not find the answer
to a relatively simple question.
Given a array of string values, for example lets say "mary", "bob",
"danny", "sue", and "jane".
I am trying to determine how to perform a logical test to determine if
a variable is an exact match for one of the string values in the array
2010 Aug 17
3
Weird differing results when using the Wilcoxon-test
Hi,
I became a little bit confused when working with the Wilcoxon test in R.
As far as I understood, there are mainly two versions:
1) wilcox.test{stats}, which is the default and an approximation, especially,
when ties are involved
2) wilcox_test{coin}, which does calculate the distribution _exactly_ even,
with ties.
I have the following scenario:
#---BeginCode---
# big example
size = 60
2017 Nov 08
1
Ggplot error
I get the same result as Eric? withR version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 17.04
It looks like you have "tidyverse" loaded so I tried it with just ggplot2 loaded and with tidyverse loaded.?
On Wednesday, November 8, 2017, 4:16:14 AM EST, Eric Berger <ericjberger at gmail.com> wrote:
I was not able to reproduce this
2001 Dec 19
2
R strings from C
Hi,
I am trying to study R internal behaviour. So long, I have not
succeeded to access the value of R strings from C.
I use:
void salvesta_tabel(
SEXP data_frame,
SEXP file
)
{
printf( "nimi %d\n", (R_CHAR)( file));
}
and from the R side:
salvesta.tabel <-
function (x, file = "") {
.Call( "salvesta_tabel", x, file)
}
When calling
2007 Jun 05
4
Refactor all factors in a data frame
Hi all,
Assume I have a data frame with numerical and factor variables that I
got through merging various other data frames and subsetting the
resulting data frame afterwards. The number levels of the factors seem
to be the same as in the original data frames, probably because subset()
calls [.factor without drop = TRUE (that's what I gather from scanning
the mailing lists).
I wonder if
2013 Dec 01
0
[PATCH] core: Bad read of file size over TFTP
A fancy pointers logic has been replaced with a plain old if / else
branches. It was assigning only half of a 64 bits integer which is then
assigned to a size_t. Thus leading to a bug on platform where size_t is
64 bits.
Resolves bug #26
Signed-off-by: Celelibi <celelibi at gmail.com>
---
Not sure if genec already issued a pull request for this patch or not.
Anyway, here it is as
2017 Sep 04
1
Dataframe Manipulation
Hello Ulrik,
Can you please explain this code means how and what this code is doing
because I'm not able to understand it, if you can explain it i can use it
in future by doing some Lil bit manipulation.
Thanks
data_help <-
data_help %>%
mutate(Purchase_ID = 1:n()) %>%
group_by(Purchase_ID) %>%
do(split_items(.))
cat_help %>% gather("Foo",