similar to: :How to insert a column in a data frame

Displaying 20 results from an estimated 10000 matches similar to: ":How to insert a column in a data frame"

2009 Feb 25
2
: record which entry in one file doesn't appear in a different file
Hi dear list, If anybody could help me, it would be great! I have two files: File 1 is a list (one column and around 100000 rows) File 2 is a list with all the names from file one and a few more (one column and more than 100000 rows) What I want is to add a column in file 2 that says which name appeared in file 1 and which doesn't (yes and no would work as a code) It's very important to
2009 Feb 06
3
how to delete specific rows in a data frame where the first column matches any string from a list
Hi, I'm new in the mailing list but I would appreciate if you could help me with this: I have a big matrix from where I need to delete specific rows. The second entry on these rows to delete should match any string within a list (other file with just one column). Thank you so much! Laura
2010 Feb 23
3
how to rearrange a dataframe
Hi all, I'd appreciate if anyone can help me with this... I have a data frame that looks like this: 1 + name1 1 2 3 2 + name2 5 9 10 2 - name3 56 74 93 1 - name4 65 75 98 I need to rearrange this in a way so that the rows with "1" in the first column, and "-" in the second column; then columns 4 and 6 should switch places. That is, column 6 would be now column 4 and
2006 Sep 18
8
acos(0.5) == pi/3 FALSE
Hello, I don't know if the result of acos(0.5) == pi/3 is a bug or not. It looks strange to me. Inaki Murillo
2011 Dec 20
2
any DCCA function in R?
Dear members, I am performing multivariate analysis on marine benthic populations using R. At first glance I found ca and VEGANO packages to be the suitable for the task, but neither has incorporated Detrended Canonical Correspondence Analysis (DCCA), which is just the method I want to apply on my data. I've looked for alternative packages containing the method, but my suspicion is that
2011 Jul 28
3
Looping through data sets to change column from character to numeric
Greetings to all -- I am having a silly problem that I just can't solve. Someone has given me an .RData file will hundreds of data frames. Each data frame has a column named ResultValue, currently character when it should be numeric. I want to loop through all of the data frames to change the variable to numeric, but I cannot figure out how to do it. My best guess was along the lines of:
2012 Mar 20
1
scientific notation in a data frame
Dear list, I have a data frame where one of the columns are p values with scientific notation mixed with regular numbers with decimals. >a=data frame >a P OR N 0.50 0.7500 237 0.047 1.1030 237 0.124 0.7742 237 0.124 0.7742 237 0.0080 1.1590 237 0.50 0.7500 237 4.5e-07 1.2 237 5.6e-04 0.9 237 when I try to do >pval=a$P/2 R gives me an error saying "In Ops.factor(pval, 2)
2002 Apr 11
2
Obtaining names of ``...'' arguments.
This may be an FAQ, but a (perfunctory) search failed to turn it up. Suppose I have a function foo(...){<something>} and I want to obtain, inside foo, the names of items comprising the ``...''. E.g. if I call foo(melvin,clyde,irving) I want to be able to loop through the ``...'' and successively obtain the text strings "melvin", "clyde", and
2004 Jun 24
2
string overflow in safe_strcpy
I recently upgraded both of my samba servers (mirrors of each other) to 3.0.4, my log files now fill with the following messages (hundred lines per day): Jun 24 13:55:33 Clyde smbd[8597]: [2004/06/24 13:55:33, 0] lib/util_str.c:safe_strcpy_fn(602) Jun 24 13:55:33 Clyde smbd[8597]: ERROR: string overflow by 1 (9 - 8) in safe_strcpy [LIBRA~V$.DOC] Jun 24 14:20:34 Clyde smbd[8597]: [2004/06/24
2009 Sep 27
2
Determining name of calling function.
I have vague recollections of seeing this question discussed on r-help previously, but I can't find the relevant postings. I want to determine (from within a given function) the name of the function calling that given function. E.g. if I have a function foo() which calls a function bar(), and also a function clyde() which calls bar(), I want to have, in the code of bar(), an instruction
2019 Nov 04
3
Puzzled about a new method for "[".
On 5/11/19 3:41 AM, Hadley Wickham wrote: > For what it's worth, I don't think this strategy can work in general, > because a class might have attributes that depend on its data/contents > (e.g. https://vctrs.r-lib.org/articles/s3-vector.html#cached-sum). I > don't think these are particularly common in practice, but it's > dangerous to assume that you can restore a
2019 Nov 04
3
Puzzled about a new method for "[".
On 04/11/2019 4:40 p.m., Pages, Herve wrote: > Hi Rolf, > > On 11/4/19 12:28, Rolf Turner wrote: >> >> On 5/11/19 3:41 AM, Hadley Wickham wrote: >> >>> For what it's worth, I don't think this strategy can work in general, >>> because a class might have attributes that depend on its data/contents >>> (e.g. >>>
2008 Aug 07
3
how to save an R object selectively?
Hi, How to save an R object for example a matrix or vector and not all objects created in a session (which is usually performed by save.image or q("yes"))? Best, Carol [[alternative HTML version deleted]]
2011 Jan 18
2
ggplot2, geom_hline and facet_grid
Hi I have a long data set on which I want to do Bland-Altman style plots for each rhythm type Using ggplot2, when I use geom_hline with facet_grid I get an extra set of empty panels. I can't get it to do it with the "Diamonds" data supplied with the package so here is a (much abbreviated) example: > lvexs cvd_basestudy ecd_rhythm fixed_time variable_time 1 CBP05J02
2024 Jan 14
1
Fwd: Strange results : bootrstrp CIs
On Sat, 13 Jan 2024 17:59:16 -0500 Duncan Murdoch <murdoch.duncan at gmail.com> wrote: <SNIP> > My guess is that one of the bootstrap samples had a different > selection of countries, so factor(Country) had different levels, and > that would really mess things up. > > You'll need to decide how to handle that: If you are trying to > estimate the coefficient for
2010 Jun 02
1
lattice, xyplot, using "panel.segments" by just addressing one panel
Hi R experts, I'm using the xyplot function in lattice to draw a multipanel plot consiting of 5x6 scatterplots. Now I need to link single points in each of those scatterplots (=panel),but the points, that need linking are different for each panel. I tried to use the panel.segments function for that, but I can't address each panel separately. Links right for panel 1, show up in all other
2010 Nov 30
2
ggplot2 histograms
Hi With ggplot2 I can very easily create beautiful histograms but I would like to put two histograms on the same plot. The histograms may be over-lapping. When they are overlapping the bars are shown on top of each other (so that the overall height is the sum of the two). Is there any way to get them to display overlapping (with smaller value in front, larger value behind) so that the overall
2010 Oct 26
2
Forcing results from lm into datframe
Hi I need some help getting results from multiple linear models into a dataframe. Let me explain the problem. I have a dataframe with ejection fraction results measured over a number of quartiles and grouped by base_study. My dataframe (800 different base_studies) looks like > afvtprelvefs basestudy quartile ef ef_std entropy CBP0908020 1 21.6 0.53 3.27
2011 Jul 19
1
"may be used in an incorrect context"
R CMD check tells me * checking R code for possible problems ... NOTE agexact.fit.rds: ... may be used in an incorrect context: ?optim(init, agfitfn, ...)? Warning: <anonymous>: ... may be used in an incorrect context: ?optim(init, agfitfn, ...)? Can anyone tell me what this message means? My searches haven't turned up anything useful. This is with R 2.7 and 2.9. The message
2024 Jan 14
1
Fwd: Strange results : bootrstrp CIs
On 13/01/2024 8:58 p.m., Rolf Turner wrote: > On Sat, 13 Jan 2024 17:59:16 -0500 > Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > <SNIP> > >> My guess is that one of the bootstrap samples had a different >> selection of countries, so factor(Country) had different levels, and >> that would really mess things up. >> >> You'll