similar to: Subset: data frames and factor levels

Displaying 20 results from an estimated 500 matches similar to: "Subset: data frames and factor levels"

2008 Mar 18
7
download.file()
Hi, I wanted to download a file and did the following: --------------------------------------------------------- > fileLink <- 'ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE1000/GSE1000_RAW.tar' > download.file(fileLink,'/geoDat') trying URL 'ftp://ftp.ncbi.nih.gov/pub/geo/DATA/supplementary/series/GSE1000/GSE1000_RAW.tar' ftp data connection made,
2008 Mar 18
2
read.dta for files from stata 9.0
Dear R-helpers, if I want to read a .dta-file generated by stata 9.0 with read.dta (foreign), I get the message "not a stata version 5-8 .dta-file". I'm using R-2.6.2 and the latest version of the foreign package. Has someone any hint? With many thanks, Albrecht
2008 Mar 26
1
GNUplot to R conversion?
Hi, I have some scripts creating GNUplot graphs that I would like to convert to R. It would be a great help if there would be a reasonable converter that takes over plot commands and initial settings and put these into R commands (I'm an R beginner and thus this kind of Kickstart would be helpful). Remark: Asking Google for "gnuplot to R conversion" or similar things does not
2008 Apr 02
3
Nonlinear equation
Dear R Users, I'm trying to find function that allow me to solve one nonlinear equation. Functions that I found are good for optimization problems. Any suggestions are welcome, rob
2008 Mar 13
1
smoothest way to upgrade R, say from 2.6.1 to 2.6.2?
Like many software assemblies, R is updated frequently. Also, it creates its own release-numbered directory when it is installed. Packages get dumped into the subdirectory "library". I have a personal habit of storing documents related to R packages in the "doc" subdirectory. Here are my questions. (1) How do people manage an upgrade, from 2.6.1, say, to 2.6.2? 2.6.2 will
2008 Mar 11
2
(no subject)
# PROBLEM WITH ABLINE # I have a question about a seemingly imprecise abline figure which I have come accross now a few times. # After reading variables a and b... a<-c(3729,1796,1956,5177,3201,3138,4265,3042,3745,2060,5713,6811,4184,1221,4700,3171,8913,5565,5500,2428,4841,10428,11197,5946,2783,4842)
2009 Jul 24
3
str(data.frame) after subsetting reflects original structure, not subsetted structure?
I find that after subsetting (you may prefer "conditional selection") a data frame and assigning it to a new object, the str(new object) reflects the original data frame, not the new one: A <- rnorm(20) B <- factor(rep(c("t", "g"), 10)) C <- factor(rep(c("h", "l"), 10)) D <- data.frame(A, B, C) str(D) # reports correctly E <-
2013 Mar 07
13
[Bug 61953] New: arbitrary memory access corrupts kernel memory, eventually crashing the kernel
https://bugs.freedesktop.org/show_bug.cgi?id=61953 Priority: medium Bug ID: 61953 Assignee: nouveau at lists.freedesktop.org Summary: arbitrary memory access corrupts kernel memory, eventually crashing the kernel QA Contact: xorg-team at lists.x.org Severity: major Classification: Unclassified OS:
2007 Dec 09
2
adjusting "levels" after subset a table
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071208/5409f1a7/attachment.pl
2009 Mar 21
0
Solved: [Fwd: Matching failure in merge()]
I've found where the problem was and a way to solve this problem: One dataset was encoded (and read) as UTF-8 and the other one was encoded (en read) as latin3 In this case, even if at the terminal you see the same characters, R states that the two elements are not equal. Don't know if this is the way it has to be, or this is a bug. Anyway, editing the second file (encoded as latin3)
2009 Aug 07
3
bug with subset and plot?
Hi! I have the following problem that I beleive is a bug: I have a dataframe with one categorical and one numerical vector. The categorical vector has three levels (uc, up and vc). A plot of the vectors with the categorical vector on the x-axis gives a boxplot with three boxes - exactly as expected. If I then use the subset function to make a dataset that only includes two of the levels of
2005 Nov 07
1
reduce levels
Hi all: I have an example that shows my problem: > test <- data.frame(c("a", "b", "c")) > colnames(test) <- "mm" > sub <- subset(test, mm=="b") > sub$mm [1] b Levels: a b c > levels(sub$mm) [1] "a" "b" "c" How can I reduce the levels to exclusively those which
2009 May 27
2
Factor level with no cases shows up in a plot
Consider this data structure (df1) ... Group Year PctProf FullYr 1 Never RF 2004 87 88 2 Cohort 1 2004 83 84 3 Cohort 2 2004 84 86 4 Cohort 3 2004 87 87 5 Cohort 4 2004 73 74 6 Never RF 2005 85 86 7 Cohort 1 2005 81 82 8 Cohort 2 2005 81 81 9 Cohort 3 2005 78 79 10 Cohort 4 2005 72 74 11
2009 Nov 10
3
drop unused levels in subset.data.frame
Dear list, subset has a 'drop' argument that I had often mistaken for the one in [.factor which removes unused levels. Clearly it doesn't work that way, as shown below, d <- data.frame(x = factor(letters[1:15]), y = factor(LETTERS[1:3])) s <- subset(d, y=="A", drop=TRUE) str(s) 'data.frame': 5 obs. of 2 variables: $ x: Factor w/ 15 levels
2007 Jul 24
1
Renamig a factor
Which is the proper way to rename a factor? If I do: test$Parc[test$Parc=="Ol?rdola"]<-"Ol?rdola" R complains that Warning message: invalid factor level, NAs generated in: `[<-.factor`(`*tmp*`, test$Parc == "Ol?rdola", value = "Ol?rdola") Thanks Agus -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole
2008 Apr 18
1
space between plots
I've set layout(matrix(c(1,3,2,4),ncol=2)) and par(mar=c(0, 4, 4, 0) + 0.0) and par(mar=c(0, 0, 4, 3) + 0.0) for the upper-left and upper-right plots, but still get an space between both plots, is there any way to completely eliminate that space? Thanks Agus -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole Sabaris s/n 08028 Barcelona Spain
2009 Jul 03
4
Function to eliminate blank space within strings?
Is there an specific function to eliminate blank space within strings? Thanks -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole Sabaris s/n 08028 Barcelona Spain Tel. 34 934095410 Fax. 34 934110012 email: Agustin.Lobo at ija.csic.es http://www.ija.csic.es/gt/obster
2009 Sep 02
1
Problem at subsetting matrix by using dimnames
Given: > mitest <- matrix(1:16,ncol=4) > dimnames(mitest)[[1]] <- c("a","b","c","d") > dimnames(mitest)[[2]] <- c("a","b","c","d") > mitest a b c d a 1 5 9 13 b 2 6 10 14 c 3 7 11 15 d 4 8 12 16 I can do: > mitest[cbind(c(1,2,3),c(2,3,2))] [1] 5 10 7 but using the names does not
2008 Jul 28
1
Converting from char to POSIX:
Given char vector delme2: > str(delme2) chr [1:1065] "30-1-08 8:48:21" "30-1-08 8:55:17" "30-1-08 9:00:22" ... I do: > delme3 <- strptime(delme2,format="%d-%m-%y %H:%M:%S") But then: > str(delme3) POSIXlt[1:9], format: "2008-01-30 08:48:21" "2008-01-30 08:55:17" ... > length(delme3) [1] 9 whie >
2008 Dec 04
0
reading files (readOGR) and non-ascii characters
I'm forwarding to this list as I've got no answer in [R-sig-Geo] and perhaps this issue is not exclusive of readOGR() I'm using ubuntu 8.04 andR version 2.8.0 (2008-10-20) -------- Original Message -------- Subject: readOGR and non-ascii characters Date: Wed, 03 Dec 2008 14:22:34 +0100 From: Agustin Lobo <aloboaleu at gmail.com> Reply-To: Agustin.Lobo at ija.csic.es To: