similar to: problem subsetting of a reference class

Displaying 20 results from an estimated 300 matches similar to: "problem subsetting of a reference class"

2005 Apr 16
2
String in data frame
hello, how can take the string in the data frame. right now i have a table that create as a data frame and stored in the file called "data.xls" and now i want to read data frame as a table in my another r program, i used the following command: the first column of the data frame is just one number called "num", but the second one a list of string, called "name". d
2008 Dec 16
2
Problem assigning "NA" as a level name in a list
I want to generate a list (called "dataList" below) where each of its levels is named. These names are assigned to nameList, which contains all possible permutations of size two taking letters from a larger alphabet, e.g., "aa",...,"Fd",..,"Z1",... One of these permutations is the character string "NA". It seems that when I try to name one
2007 Jul 31
1
[Bridge] brctl uses incorrect sysfs path
Hi, I noticed that brctl (or more accurately, libbridge) is using the wrong path when doing various lookups in sysfs: e.g. /sys/class/net/brXXX/stp_state when it should use /sys/class/net/brXXX/bridge/stp_state. This doesn't cause any problems on most systems as it falls back to the ioctl when the sysfs attempt fails; however the ioctl method is apparently deprecated. I believe the
2008 Apr 15
1
by inconsistently strips class - with fix
summary: The function 'by' inconsistently strips class from the data to which it is applied. quick reason: tapply strips class when simplify is set to TRUE (the default) due to the class stripping behaviour of unlist. quick answer: This can be fixed by invoking tapply with simplify=FALSE, or changing tapply to use do.call(c instead of unlist executable example:
2004 Apr 08
1
Why are Split and Tapply so slow with named vectors, why is a for loop faster than mapply
First, here's the problem I'm working on so you understand the context. I have a data frame of travel activity characteristics with 70,000+ records. These activities are identified by unique chain numbers. (Activities are part of trip chains.) There are 17,500 chains. I use the chain numbers as factors to split various data fields into lists of chain characteristics with each element of
1997 Dec 08
3
R-alpha: Bug in tapply in the Windows version of September
The function tapply is not working in the Windows version of R=20 (Version 0.50 Beta (Sept 29, 1997)) In tapply <- function (x, INDEX, FUN=3DNULL, simplify=3DTRUE, ...)=20 ... The part: if (simplify && all(unlist(lapply(ans, length)) =3D=3D 1)) { ans <- unlist(ans, recursive =3D FALSE) names(ans)<-namelist[[1]] return(ans) } should be replaced by if (simplify
2017 Jun 13
2
reading data
Hi all, I am using R to extract data on a regular basis. However, sometimes using the same script and the same data I am getting different observation. The library I am using and how I am reading it is as follows. library(stringr) namelist <- file("Adress1.txt",encoding="ISO-8859-1") Name <- read.fwf(namelist, colClasses="character",
2005 Jan 10
2
doing many commands within R
Dear all, I'm new to this list, so let me greet everyone. My problem is that I have several thousand data files which I want to perform a lot of R commands on, which are found in a seperate .R script. Now, what I did was within the R prompt, I used to read in a list of the data files. e.g. namelist <- readLines("list_of_names",n=-1) for (i in 1:100) { k <-
2011 Jul 29
3
[PATCH 1/3] klibc: Add scandir() and alphasort() support.
Add support for scandir() and alphasort() as defined in POSIX.1-2008. Signed-off-by: Mike Waychison <mikew at google.com> --- usr/include/dirent.h | 7 +++++ usr/klibc/Kbuild | 2 + usr/klibc/scandir.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletions(-) create mode 100644 usr/klibc/scandir.c diff --git
2006 Oct 03
2
strverscmp, scandir, alphasort and versionsort
Hello, These are implementations of strverscmp, scandir, alphasort and versionsort, and some test cases for them. I know these aren't in POSIX, but they're useful, nonetheless, and someone else might be interested in them. Regards, Luciano Rocha -- lfr 0/0 -------------- next part -------------- /* ----------------------------------------------------------------------- * * *
2017 Jun 14
0
reading data
You need to provide reproducible data. What does the file contain? Why are you using 'sep=' when reading fixed format. You might be able to attach the '.txt' to your email to help with the problem. Also you did not state what the differences that you are seeing. So help us out here. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what
2002 Aug 01
2
RE: Missing files as seen by Explorer on a client (was Need help on this) **********FIXED******************
I really appreciate all your responses on this. I might not have fixed it by looking at samba logs but i noticed there was directory in user unix directory with wildcard * as folder name once i removed it, samba showed up all the files and directory. am not sure what would * as folder name caused this behaviour may be samba was trying to interpret * as something else not sure...... or it was
2017 Jan 26
3
RFC: tapply(*, ..., init.value = NA)
Last week, we've talked here about "xtabs(), factors and NAs", -> https://stat.ethz.ch/pipermail/r-devel/2017-January/073621.html In the mean time, I've spent several hours on the issue and also committed changes to R-devel "in two iterations". In the case there is a *Left* hand side part to xtabs() formula, see the help page example using 'esoph', it
2010 Jan 18
2
unique: factor to string
Hi community, I want to count the occurrence of values within a dataframe. data$names is a list of many names. With namelist <- unique(data$names) I get all the existing names. But the result is a factor, not a list of strings. I would then like to go trough all the names in a for-loop and count their occurrence. How do I make this? Best regards, Markus
2017 Jan 26
2
RFC: tapply(*, ..., init.value = NA)
On a related note, the storage mode should try to match ans[[1]] (or unlist:ed and) when allocating 'ansmat' to avoid coercion and hence a full copy. Henrik On Jan 26, 2017 07:50, "William Dunlap via R-devel" <r-devel at r-project.org> wrote: It would be cool if the default for tapply's init.value could be FUN(X[0]), so it would be 0 for FUN=sum or FUN=length, TRUE
2008 Nov 24
4
Calculating sum of letter values
Hi all If I have a string, say "ABCDA", and I want to convert this to the sum of the letter values, e.g. A -> 1 B -> 2 etc, so "ABCDA" = 1+2+3+4+1 = 11 Is there an elegant way to do this? Trying something like which(LETTERS %in% unlist(strsplit("ABCDA", ""))) is not quite correct, as it does not count repeated characters. I guess what I need is
2017 Jan 27
1
RFC: tapply(*, ..., init.value = NA)
The "no factor combination" case is distinguishable by 'tapply' with simplify=FALSE. > D2 <- data.frame(n = gl(3,4), L = gl(6,2, labels=LETTERS[1:6]), N=3) > D2 <- D2[-c(1,5), ] > DN <- D2; DN[1,"N"] <- NA > with(DN, tapply(N, list(n,L), FUN=sum, simplify=FALSE)) A B C D E F 1 NA 6 NULL NULL NULL NULL 2 NULL NULL 3 6
1997 Aug 19
2
R-alpha: A few bugs in R-0.50-a3.
A few problems in R-0.50-a3 (which were also in R-0.49): 1) y <- c(10,11,12,13,14,NA,NA) n <- length(y) missed <- (1:n)[is.na(y)] notmissed <- (1:n)[!is.na(y)] blocks <- cut(missed,breaks=c(0,notmissed,n+1)) a <- function(v) { q <- range(v) c(q[1]-1,q[2]+1) } brackets <- tapply(missed,blocks,a) This codes gives the following in S: > brackets $"0+ thru 1":
2011 Aug 02
6
[PATCH v2 0/4] Support drop directories directly from kinit
This patchset applies to klibc mainline. This patchset introduces the ability to kinit to execute scripts or executable files present in in the initramfs before switching over to the root filesystem. It is implemented by first implementing scandir() and alphasort() as present in POSIX.1-2008 in klibc itself, and then using that as the basis for iterating and executing files via a run_scripts()
2011 Feb 16
2
how to create normalized pdf plot?
Hello, I have multiple data files. Each file contains a single column and 1.5 million rows. I want to create normalized pdfs (area under curve is 1) and histograms to compare with one another. Could anybody suggest if there exists an easy way or built in function in R. At present I am using Origin and Excel together to do this. A single file needs 10 minutes and I have a total of 929 files! So