Displaying 20 results from an estimated 9000 matches similar to: "How to delete rows"
2005 Oct 27
1
data.frame-question]
First a general comment on posting style, could you please be more specific
about where the error occurs as without this it is very difficult to
identify what the problem is.
Now concerning your problem. When I tried the code I posted yesterday I
thought it worked fine. I've tried it again now and found that the
data.frame TAB3 actually only has one column and the names "A",
2005 Oct 25
2
data.frame-question
Dear R-List,
I am very new to R and programming itself, so my question may be easy to
answer for you.
I tried a lot and read through the manuals, but I still have the
following problem:
I have 2 data-frames:
Number<-as.numeric (Number)
Name<-as.character (Name)
TAB1<-data.frame (Name,Number)
- it looks like this:-
Name Number
A 2
A 3
A 6
B 8
B 12
B 7
C 8
D 90
E 12
E 45
佲仸
2006 Nov 14
3
Creating a table
Dear R List,
I am a new to R, so my question may be easy to answer for you:
I have a dataframe, for example:
df<-data.frame(loc=c("A","B","A","A","A"),
year=as.numeric(c("1970","1970","1970","1976","1980")))
and I want to create the following table without using loops:
1970-74 ;
2005 May 10
5
converting an ASCII file to a matrix
Dear R-WinEdit users,
I got a simple question, but somehow I cannot find the answer, although
I have
tried a lot!
I got an ASCII-file and I want to import it into R, so that every
character is defined by [i;j].
The rows are not of the same length.
the file looks like the following shortened abstract example:
name: xxxxx xxxx
age: 9.9.99
record number: 999
title: xxxxx xxxx xxx
keywords: xxx xx
2005 Nov 15
2
y-axis in histograms
Dear R- list,
I have some data to present with histograms. Therefore I used hist(...).
I have few values with almost 80% of
the frequencies (totaly 800) and some other values with low frequencies
( totaly 5 -10 )
that I want to emphasize. Therefore I want to "cut" the y-axis on 100,
but I
don't know how to deal with this.
Thanks in advance,
Michael Graber
2006 Apr 24
2
boxplots instead of a scatterplot
Dear R list,
I am a newbie to R and programming itself, so my question may be easy to
answer for you.
I wanted to create a scatterplot and i used the following code:
par(mar=c(10, 4.1,4.1,2.1))
plot(q$location,q$points, , las=2, cex.axis=0.5,xlab="", ylab="" )
#location are character strings, there are about 70 locations
#points are numeric, there are more than 4 points for
2011 Aug 16
2
Assignment working differently inside ifelse()
Hello all, I need to extract rows and columns from a data frame and put
them in a matrix. In some cases, there are no rows in the data frame
meeting the selection criteria. For those rows I want to put a row of
0's in the matrix. Here's my clumsy code:
tab1.m1 <- matrix(0, nrow=2, ncol=4)
tab1.m1[1,] <- ifelse(length(as.matrix(tab1[tab1$comp==the.comp & tab1$schlid==the.schl
2009 Jul 09
2
correct way to subset a vector
Hi,
#make example data
dat <- data.frame(matrix(rnorm(15),ncol=5))
colnames(dat) <- c("ab","cd","ef","gh","ij")
If I want to get a subset of the data for the middle 3 columns, and I
know the names of the start column and the end column, I can do this:
mysub <- subset(dat,select=c(cd:gh))
If I wanted to do this just on the column names,
2010 Jul 25
1
Left Outer Join 2 DF's on Multiple Conditions
Hi,
I am trying to execute the following SQL statement using two data frames:
tab1, tab2 : Two Tables
Select tab1.*, tab2.*, tab1.tobiiTime - tab2.ruiTime as timeDiff,
IFNULL(n-m, -9999999) as alwaysIncrement
FROM tab1
LEFT OUTER JOIN tab2 On tab1.data1 - tab2.mouseX = 0 And tab1.data2 -
tab2.mouseY = 0
I am trying to do the following in R:-
*#Getting error here:*
data
2013 Feb 11
2
How to plot doubles series with different location using plotCI
Dear list
members,
I would
like to create two series of plotted mean values and error bars, yet with
different locations along the x-axis.
Plotting of
first series using plotCI with the standard arguments goes without any problem.
However I do not succeed to add the second series in the same plot, which
should be horizontally shifted from the first series along the x-axis. The “add=TRUE”
2011 Oct 29
1
Refresh tab content on click in JQuery UI Tabs
HI Guy''s
TAB1 and TAB2 have some radio button, checkbox and dropdown menu. When
TAB1 is selected, I have to switch to TAB2 and then back to TAB1 to refresh
the loaded content.
How to make TAB1 refresh loaded content when click on its tab?
*code is something like that*
<ul class="tabs">
<li><a *href="#tab1"*>Gallery</a></li>
2005 Oct 27
2
F tests for random effect models
Dear R-users,
My question is how to get right F tests for random effects in random effect models (I hope this
question has not been answered too many times yet - I didn't find an answer in rhelp archives).
My data are in mca2 (enc.) :
names(mca2)
[1] "Lignee" "Pollinisateur" "Rendement"
dim(mca2)
[1] 100 3
replications(Rendement ~ Lignee *
2005 Oct 28
2
Random effect models
Dear R-users,
Sorry for reposting. I put it in another way :
I want to test random effects in this random effect model :
Rendement ~ Pollinisateur (random) + Lignee (random) + Pollinisateur:Lignee (random)
Of course :
summary(aov(Rendement ~ Pollinisateur * Lignee, data = mca2))
gives wrong tests for random effects.
But :
summary(aov1 <- aov(Rendement ~ Error(Pollinisateur * Lignee), data =
2010 Apr 24
2
table command
Hi,
Let s be a dataframe.
> s
A B C
0 0 1
1 0 1
1 0 1
0 0 1
1 0 1
0 1 1
0 1 1
0 1 1
0 0 1
> tab1=table(s[,c(1,2)])
> tab1
B
A 0 1
0 3 3
1 3 0
> tab2=table(s[,c(1,3)])
> tab2
C
A 1
0 6
1 3
The problem is I need to access frequency corresponding to (0,0).
tab1[1] will give me the correct value
2010 Jul 14
2
count - help
Hi,
I have a data frame with several factors and I want to count the occurrences
of an event resulting from an interaction of some factors.
I tried to do several tables (and then converting to d.f and then merge them
by one factor and the freq
Tab1 <- merge (BPorAmost,BPorSector,by=c('Sample','Freq'))
Tab1 <- merge (Tab1,BPorDist,by=c('Sample','Freq'))
Tab1
2009 Dec 22
2
Nested For loops
Dear R experts,
Might be very simple question to ask but would be insightful. As the same story of nested "for loops". following is the code that I am using to get the autocorrelation function of the sample data. I have tried to get rid of for loops but since I am touching R after such a long time that I need to practice more but I need help to revive my skills. I know that apply() or
2006 Oct 27
3
How to best divide table by table
Hi all,
how can I divide two tables of the same dimension so that all names are
preserved, ie do not become NA? I have "tab1" and "tab2", each having
names in the first column. I want "tab3" with the same names and values
"tab1/tab2".
Thanks,
Serguei
2008 Sep 12
2
Fw: Complex sampling survey _ Use of survey package
--------------------------------------------------
From: "Ahoussou Sylvie" <sylvie.ahoussou at antilles.inra.fr>
Sent: Friday, September 12, 2008 9:48 AM
To: "Thomas Lumley" <tlumley at u.washington.edu>
Subject: Re: [R] Complex sampling survey _ Use of survey package
> Thanks for your answer
>
> I think I made a mistake when I recopied the 5 first rows of
2009 Aug 20
2
How to extract row values?
Dear All!
I'm trying to extract one specific row from a data frame without columnnames being included. I only want a 1-dimensional vector that consists of the specific data on this row. Here's an example:
existing data:
column names: v1v2v3
Row 1 ab cd ef
Row 2 gh ij kl
Row 3 mn op qr
This is what I want to extract:
ab cd ef
I do not want: v1v2v3
2010 May 26
3
shapiro.test
Hi,
I am not so sure about an error note I got when using shapiro.test.
I imported some data into R by wrinting it into a .txt file via
> tab1<-read.table("etc....txt",header=T)
> attach(tab1)
The following object(s) are masked _by_ .GlobalEnv :
ozon
> ozon$V1 [1] 2.5 3.0 5.6 4.7 6.5 6.7 1.7 5.3 4.6 7.4 5.4 4.1 5.1 5.6 5.4 6.1 7.6[18] 6.2 6.0 5.5 5.8 8.2 3.1 5.8 2.6
Now