Displaying 20 results from an estimated 60000 matches similar to: "replacement in a dataframe"
2007 Sep 17
1
Importing a dataset
? stato filtrato un testo allegato il cui set di caratteri non era
indicato...
Nome: non disponibile
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070917/f6d8d606/attachment.pl
2005 Oct 21
2
read data from pdf file
Hi, I'm trying to read data from a PDF file.Is it possible to do it with R? Thanks, Marco
[[alternative HTML version deleted]]
2010 Oct 26
4
divide column in a dataframe based on a character
Hello,
If I have a dataframe:
example(data.frame)
zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll")
ddd <- cbind(dd, group = zz)
and I want to divide the column named group by the "_", how would I do this?
so instead of the first row being
x
2005 Apr 02
2
Amount of memory under different OS
Hi,
I have a problem: I need to perform a very tough analysis, so I would like
to buy a new computer with about 16 GB of RAM. Is it possible to use all
this memory under Windows or have I to install other OS?
Thanks,
Marco
2012 Jul 30
3
replace values in vector from a replacement table
Dear all
I've got stuck when trying to replace values in a vector by selecting
replacements from a replacement table. I'm trying to use only base
functions. Here's a dummy example:
> (x <- rep(letters,2))
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l"
2005 Oct 28
1
errors handling
Hi, I have an index "i" that varies from 1 to n. For each value of this index I open a connection, e.g.
conness<-url(...)
conness<-readLines(conness)
For certain values of "i" it occurs an error (Warning message: cannot open: HTTP status was `0 (null)' ) and the program flow ends. How can I ignore these errors, allowing the program to go on?
Thanks,
2012 Jun 03
2
merging single column from different dataframe
Hi all,
probably really simple to solve, but having no background in programming I
haven't been able to figure this out: I have two dataframes like
df1 <- data.frame(names1=c('aa','ab', 'ac', 'ad'), var1=c(1,5,7,12))
df2 <- data.frame(names2=c('aa', 'ab', 'ac', 'ad', 'ae'),
var2=c(3,6,9,12,15))
Now I want merge
2010 Mar 16
1
aplicar función de cuantilas a un dataframe
Hola R-adictos,
me gustaría que alguien me ayudara a aplicar la función "quantile" (varios percentiles) a un marco de datos estratificado por algunas variables categóricas (ver fichero adjunto como ejemplo). La idea es obtener varios percentiles de varias variables (primeras columnas del fichero de datos), pero dividiendo el marco de datos en función de los valores de las variables
2008 Feb 14
4
plot each column of a matrix or dataframe versus x in a single plot
How do a plot several columns of a matrix at once in a single plot
versus a single x-variable?
The default plot.matrix or plot.dataframe commands plot each column
versus each other column in several sub-plots. I want to plot each
column versus a single other vector (x) as several lines or points in
one plot.
I can do it by hand: get the range of all variables (i.e. columns of
the matrix or
2008 Feb 04
2
make dataframe from table
Dear R-experts,
I have got a dataframe:
data
ID disease
V1 V2
1 p1 1
2 p1 3
3 p3 3
4 p3 5
5 p5 1
From which I extract a usefull table: affect
affect
1 3 5
p1 1 1 0
p3 0 1 1
p5 1 0 0
I want to merge this with anotherdataframe:
age
p1 23
p2 24
p3 23
p4 11
p5 45
If have tried as.data.frame(affect) and other solutions to get the
following comment going:
2012 Apr 03
1
Compare by row and insert previous row value (Or non Time Series Lag)
I have the following sample dataset (CSV input here:http://goo.gl/YR8LP.
CSV output here: http://goo.gl/EFCC8) which I want to transform as follows.
For each person in a household I want to create two new variables OrigTAZ
and DestTAZ. It should take the value in TripendTAZ and put that in
DestTAZ. For OrigTAZ it should put value of TripendTAZ from the previous
row. For the first trip of every
2012 Mar 21
2
Type II and III sum of squares (R and SPSS)
To whom it may concern
I made some analysis with R using the command Anova. However, I found
some problmes with the output obtained by selecting type II o type III
sum of squares.
Briefly, I have to do a 2x3 mixed model anova, wherein the first factor
is a between factor and the second factor is a within factor. I use the
command Anova in the list below, because I want to obtain also the sum
2010 Mar 05
1
hier.part
Hi everyone,
A beguinner question.
- How shall i import 9 different ascii (created from a gis layer (arcmap
grid)) into R to create a single dataframe for using in hier.part?
Should i use read.table, then turn each created object into a single vector
using unlist and finally use data.frame to joint all the vectors into a
unique data frame (xcan in the usage of hier.part) ?
I´ve been trying to
2010 May 22
3
How sample without replacement on more than one variables?
Hello All,
sample() only sample on one variable x. But I'm interested in sampling
more than one variable without replacement.
Suppose I have 3 vectors x, y, z. I want to draw samples from all
three vectors such that the combination of the three elements in each
draw is not the same as any previous draws. I could use expand.grid to
generate a vector out of the three vectors. But when the
2012 Aug 18
5
Quiz: How to get a "named column" from a data frame
Today, I was looking for an elegant (and efficient) way
to get a named (atomic) vector by selecting one column of a data frame.
Of course, the vector names must be the rownames of the data frame.
Ok, here is the quiz, I know one quite "cute"/"slick" answer, but was
wondering if there are obvious better ones, and
also if this should not become more idiomatic (hence
2002 Oct 17
4
Posix Problem, difftime
I am having a series of problems using date time data that has been converted into a POSIXt and POSIXlt classes. I have hourly time series data from 1900 that has been converted from text data.
I assume most of my problems come from a mis-underdanding of the POSIX class. My matrix named (aa) for this year is approx 8700 by 4. When I try to calculate the length of posit column ( which is the
2006 Jun 13
4
undesirable rounding off due to 'read.table' (PR#8974)
Full_Name: Aart Overeem
Version: 2.2.0
OS: Linux
Submission from: (NULL) (145.23.254.155)
Construct a dataframe consisting of several variables by using 'data.frame' and
'cbind' and write it to a file with 'write.table'. The file consists of headers
and values, such as 12.4283675334551 (so 13 numbers behind the decimal point).
If this dataframe is read with
2007 May 13
2
Some questions on repeated measures (M)ANOVA & mixed models with lme4
Dear R Masters,
I'm an anesthesiology resident trying to make his way through basic
statistics. Recently I have been confronted with longitudinal data in
a treatment vs. control analysis. My dataframe is in the form of:
subj | group | baseline | time | outcome (long)
or
subj | group | baseline | time1 |...| time6 | (wide)
The measured variable is a continuous one. The null hypothesis in
2011 Nov 16
1
Replacing values in matrix/dataframe according to changing criteria
Hi there,
I am doing some network analysis working with k-cliques and over time I
want to see what nodes are members of what cliques and how big these
cliques are. I have managed to produce a matrix which shows which k-cliques
each node is part of over the 100 time periods (slow though) but I cannot
seem to calculate the size of each k-clique which is actually just a count.
Basically I have a
2012 Feb 11
3
Counting occurences of variables in a dataframe
Hi everybody,
I have a large dataframe similar to this one:
knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af')
kdate <- as.Date( c('20111001', '20111102', '20101001', '20100315',
'20101201', '20110105', '20101001', '20110504',