similar to: as.data.frame peculiarities

Displaying 20 results from an estimated 10000 matches similar to: "as.data.frame peculiarities"

2009 Jun 25
2
stringsAsFactors has no impact in expand.grid()?
Hi I have the feeling, that the argument stringsAsFactors has no impact in the function expand.grid: a <- c("PR", "NC", "A2", "BS") b <- c(1, 0.5, 0.25, 0.125, 0.0625, 0.03125) class(expand.grid(css, fscs, stringsAsFactors=FALSE)[[1]]) [1] "factor" class(expand.grid(css, fscs, stringsAsFactors=TRUE)[[1]]) [1] "factor" Also, when
2019 Mar 12
3
as.data.frame.table() does not recognize default.stringsAsFactors()
Reporting a possible inconsistency or bug in handling stringsAsFactors in as.data.frame.table() Here is a simple test > options()$stringsAsFactors [1] TRUE > x<-c("a","b","c","a","b") > d<-as.data.frame(table(x)) > d x Freq 1 a 2 2 b 2 3 c 1 > class(d$x) [1] "factor" >
2005 Apr 22
3
as.data.frame: Error in "names<-.default" (PR#7808)
Hello, I found a potential problem in R 2.1.0 (and R 2.0.1) I expect that > tmp <- FUN(x1, x2, x3, x4) > as.data.frame(tmp) is the same as > as.data.frame(FUN(x1, x2, x3, x4)) since the tmp variable in this case is unnecessary. However, below I will demonstrate that under an odd set of conditions, I can correctly perform as.data.frame(tmp), but not as.data.frame(FUN(x1, x2, x3,
2023 Jun 03
1
bug in utils:::format.person
Thierry, thanks for this, this is a bug in utils:::.format_person_as_R_code(). This calls deparse() on the elements of the person object with the default width.cutoff = 60. As your comment exceeds this width, the erroneous formatting is produced. The simplest reproducible example I could come up with was: p <- person(".", comment = c(foo = ".....................",
2014 Feb 11
1
getting environment from "top" promise
Hi all, It seems that there is a use case for obtaining the environment for the "top" promise. By "top", I mean following the promise chain up the call stack until hitting a non-promise. S4 data containers often mimic the API of base R data structures. This means writing S4 methods for functions that quote their arguments, like with() and subset(). The methods package
2012 Apr 17
3
Can a matrix have 'list' as rows/columns?
After a lot of processing I get a matrix into M. I expected each row and column to be a vector. But it is a list. R-Inferno says... "Arrays (including matrices) can be subscripted with a matrix of positive numbers. The subscripting matrix has as many columns as there are dimensions in the array—so two columns for a matrix. The result is a vector (not an array) containing the selected
2012 Dec 31
4
error when using subset (0 observations)
Hi, how are you? My name is Irucka Embry and I would like assistance on properly subsetting some data obtained from a .csv file. > file <-"info_n.csv" > INFO<- getMetaDataFromFile(file) INFO is 92 observations of 14 variables > INFO<- subset(INFO,site.no==02169570) INFO is 0 observations of 14 variables When the site.no is used I should have 1 observation of 14
2006 Jul 12
4
Keep value lables with data frame manipulation
Dear R, I import data from spss into a R data.frame. On this rawdata I do some data processing (selection of observations, normalization, recoding of variables etc..). The result is stored in a new data.frame, however, in this new data.frame the value labels are lost. Example of what I do in code: # read raw data from spss rawdata <- read.spss("./data/T50937.SAV",
2023 Jun 02
2
bug in utils:::format.person
Dear all, I think I found a bug in utils::format.person when using style = "R" with a vector of comments. The comment section is not parsed properly. Please find below the mwe and the session info. Best regards, Thierry maintainer <- person( given = "Thierry", family = "Onkelinx", role = c("aut", "cre"), email = "thierry.onkelinx at
2009 Feb 20
2
importing data to SQLite database with sqldf
Hi all, I am attempting to learn SQL through sqldf... One task I am particularly interested in is merging separate (presumably large) files into a single table without loading these files into R as an intermediate step (by loading them into SQLite and merging them there). Taking a step back, I've considered these alternatives: 1) I know if I use straight SQLite commands I might use the
2011 Dec 08
2
read.table question
Hello All, This works, results <- read.table("plink.txt",T) while this doesn't. results <- read.table("plink.txt") Make sure your data frame contains columns CHR, BP, and P What does adding the "T" in read.table do? Which argument does this correspond to? I tried searching for it but didn't find the answer in: read.table(file, header = FALSE,
2012 Nov 14
1
R wildcards, sapply and as.factor
I want to change the type to factor of all variables in a data frame whose names match a certain pattern. So here I am trying to change the type to factor of all variables whose name begins with?namestub?in the dataframe?df. attach(df)sapply(grep(glob2rx("namestub*"),names(df)),as.factor) But this doesn't work since >levels(df$namestub1)NULL
2010 Feb 26
2
[LLVMdev] RegisterScavenging on targets without subregisters
There's an assert at line 192, lib/CodeGen/RegisterScavenging.cpp that appears to get tripped on targets that don't have subregisters defined: bool SubUsed = false; for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); unsigned SubReg = *SubRegs; ++SubRegs) if (isUsed(SubReg)) { SubUsed = true; break; }
2013 Oct 30
2
Huge performance difference between implicit and explicit print
Hi all, Can anyone help me understand why an implicit print (i.e. just typing df at the console), is so much slower than an explicit print (i.e. print(df)) in the example below? I see the difference in both Rstudio and in a terminal. # Construct large df as quickly as possible dummy <- 1:18e6 df <- lapply(1:10, function(x) dummy) names(df) <- letters[1:10] class(df) <-
2001 Jul 31
4
nlme: bug in getCovariateFormula (PR#1038)
I found that predict.gnls failed with a wierd error message about a non-numeric argument to a binary vector in one of three nearly identical uses. Error in Inh/Ki : non-numeric argument to binary operator (Inh and Ki are arguments to the function used in the formula for the object whose predictions were requested). It turns out that the problem is in getCovariateFormula(). The final line in
2008 Jan 09
5
read.table: aborting based on a time constraint
Hello ? I am trying to write code that will read in multiple datasets; however, I would like to skip any dataset where the read-in process takes longer than some fixed cutoff. A generic version of the function is the following: for(k in 1:number.of.datasets) { X[k]=read.table(?) } The issue is that I cannot find a way to embed logic that will abort the read-in process of a specific dataset
2006 Jul 24
1
deparse - width.cutoff
I have a question about "deparse" function in R What is the reason that "deparse" use an argument like "width.cutoff" ? Why the maximum cutoff is 500? I was manipulating an R formula and used "deparse". Since the length of user's formula was greater then 500, my code didnt work. thanks Johan johan Faux <johanfaux@yahoo.com> wrote: I have a
2004 May 12
1
Change default values of a function
Dear R-helpers, I would like to change the default value of a functions that is call by a package. The function deparse() is called by a set of functions from a library and because I don't think is appropriate to change the library, I am trying to change the default value in deparse(). At the moment the only solution I have come across is to place a function in my working environment like
2006 Oct 19
0
AIX 5.2 Samba 3.0.23c Samba peculiarities
Hi All, After successfully installing the AIX Binaries (Thanks Bill), and manageing to join as a ADS Domain Member I have a couple of peculiarities of which I need to get to the bottom. Problem A When connecting to a share, I can connect OK , and get authenticated OK, I can create files in the share and open files in the share, but cannot list files in the share or delete files I have created.
2015 Sep 29
5
sobre fread {data.table}
Hola, M. Luz. Hay infinidad de motivos por los que se te puede cortar la lectura de un archivo de datos, pero los más habituales son encontrar un "#" o unas "" en los registros, o una línea toda en blanco. Lo primero yo creo que es dejar el archivo en texto plano (lo que te recomendaba Carlos de usar el original, no el docx), y buscar esos caracteres con un editor de texto