Displaying 20 results from an estimated 500 matches similar to: "Fill down a new column in data frame with a number"
2013 Jan 08
1
incrementation within ifelse
Dear R-helper,
I am working on a very large data frame and I am trying to add a new column
and write in it with certain conditions. I have try to use this code with
the data frame p :
ID = 0
p[,"newColumn"]<-
ifelse (p$flagFoehn3_durr == 1,
ifelse(p$Guetsch == 0,
ID <<- ID ++
,
ID
)
,
0
)
What I am trying to do
2012 Jul 24
5
First value in a row
Hi.
This is likely a trivial problem but have not found a solution.
Imagine the following dataframe:
Lat Lon x1 x2 x3
01 10 NA NA .1
01 11 NA .2 .3
01 12 .4 .5 .6
I want to generate another column that consist of the first value in
each row from columns x1 to x3. That is
NewColumn
.1
.2
.4
Any input greatly appreciated,
Thanks,
Camilo
Camilo Mora, Ph.D.
2011 Aug 01
1
Inserting column in between -- "better" way?
Folks:
I consider my reply below rather clumsy: One has to keep track of
index numbers other than that which is inserted and must separately
change column names. Is there as "essentially better" way to do this,
either via base R or via an R package. I leave it to you to define
"essentially better."
Thanks.
Cheers,
Bert
On Mon, Aug 1, 2011 at 10:17 AM, Bert Gunter
2012 Jun 10
3
Data.frames can not hold objects...What can be done in the following scenario?
R-Help community,
I understand that data.frames can hold elements of type double, string
etc but NOT objects (such as a matrix etc). This is not convenient for
me in the following situation. I have a function that takes 2 inputs
and returns a vector:
testfun <- function (x,y) seq(x,y,1)
I have a data.frame defined as follows:
testframe<-data.frame(xvalues=c(2,3),yvalues=c(4,5))
I would
2018 May 10
2
using for loop with data frames.
Hi,
Is it possible use a loop to process many data frames in the same way?
For example, if I have three data frames, all with same variables
df_bs_id1 <- read.csv("test1.csv",header =TRUE)
df_bs_id2 <- read.csv("test2.csv",header =TRUE)
df_bs_id3 <- read.csv("test3.csv",header =TRUE)
How could I would implement a code loop that , for instance, would
2010 Apr 24
1
Adding new column variable to a existing spreadsheet
Hi,
I've got a csv format of file. There are seven columns of variables all
together, and I've used the diff() function to take the differences between
the variables in one column. Now I want to add the differences as the 8th
column variable to the csv file. Is there any way that I can do this?
Thanks in advance.
Carol Gao
[[alternative HTML version deleted]]
2007 Dec 06
0
alternatives to latex() or xtable()
An alternative solution that allows you to break it down by categories is in
the functions below. Comments/suggestions welcome and encouraged.
Note that much thanks is due to those who responded to an earlier post of
mine on a similar topic.
To use (assuming you have a data.frame falled pathDist with columns
distances (your numeric data of interest), Capacity, Surface, and SITE
(vectors of
2003 May 31
5
parse on left hand side of R assignment
I keep finding myself in a situation where I want to calculate a
variable name and then use it on the left hand side of an assignment.
For example
iteration <- 1
varName <- paste("run",iteration,sep="")
myList$parse(text=varName) <- aColumn
I want to take some existing variable "aColumn" and use the name
"varName" name for it and put it into a
2015 Dec 21
2
Deutsche Telekom: calls dropped after 15 minutes
Hi list!
My Problem: all calls to international numbers will be dropped after exactly
15 minutes...
I have a VoIP-account by Deutsche Telekom.
This is what I see when I call someone (my parents) and the connection will
be dropped:
== Using SIP RTP CoS mark 5
-- Executing [+39015222222 at default:1] Set("SIP/00493511111111-00000125", "newNumber=0039015222222") in new
2018 Jan 15
1
About levene.test
Hi,
What package(s) must I install so that I can apply the Levene' test in my
data?
I tried 'lawstat' but dependency ?VGAM? is not available for this package.
I am using Rstudio Version 1.1.383
Tks
[[alternative HTML version deleted]]
2011 Jun 29
2
Very first contact with docs may confuse
Hi,
This is my very first time using CentOS and I find documentation a little bit confusing.
For example, I don't know which iso image suits my needs, isn't adding big, shining red link "READ THIS IF YOU DON'T KNOW WHICH ISO SHOULD YOU CHOOSE" a good idea? 'README' file on mirrors with instructions would also be nice. If there already is one, I wasn't able to
2012 May 25
4
Hash Table - Select and Change Data iniside Matrix
Hi,
Here i have been a matrix like this,
*NAME AGE PALCE TRUE/FALSE*
ABC 20 INDIA
XYZ 30 FRANCE
PQR 40 USA
MNO 30 KENIYA
DEF 25 AUSTRALIA
Here,* TRUE/FALSE* Column containing empty values.
So my requirement what is , need to change all the *TRUE/FALSE *column value
into "*TRUE*" where *AGE =
2008 Feb 14
5
Levene's test for homogeneity of variances (befor using ANOVA)
En innebygd og tegnsett-uspesifisert tekst ble skilt ut...
Navn: ikke tilgjengelig
Nettadresse: https://stat.ethz.ch/pipermail/r-help/attachments/20080214/5a98c799/attachment.pl
2009 Jul 09
4
is possible to sen sms with asterisk in Spain?
Hi all,
I?m a beginner with asterisk and I want to know if with asterisk I can send
sms to a mobile, I?m on Spain, and I don?t know this can be a problem (with
the operators...)
I have Elastix 1.3.2 and I have seen this url:
http://mirror.su.lt/voip-info/wiki/view/Asterisk+cmd+Sms.html
I have tried the smsq command but I can get it work, (as I say I?m a
begginer and I don?t understand several
2012 Sep 28
4
Merging multiple columns into one column
Good Evening-
I have a dataframe that has 10 columns that has a header and 7306 rows in
each column, I want to combine these columns into one. I utilized the stack
function but it only returned 3/4 of the data...my code is:
where nfcuy_bw is the dataframe with 7305 obs. and 10 variables
Once I apply this code I only receive a data frame with 58440 obs. of 2
variables, of which there should be
2009 May 28
1
how to compile
<BEGINNER i am begginer>
i try to use winegcc all link, include, lib paths are ok
but i got linker error
Main-z6Kx8u.o : (.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
and i don't know to which library it belong
2007 Jun 05
1
logit model interpretation
Hello everyone
I appologize for my lack of experience in statistical methods. I am an R
user begginer and I am running a logit model using "zelig" and "pcse"
packages. I will go to the point and is that Im having problems with
interpreting the results of my models.. It is really simple (I guess for the
most advanced scholars) however I really dont understand how to interpret
2010 Jan 30
1
pca in R
Hi,
I am learning how to do principal component analysis in R. However, since I
am family with only a few built-in functions like prcomp, sd, cor, I started
manually with examples in text books while trying to use the few functions I
know to manipulate what they have in the text. From the example in the text
I obtained a data set. Using cor and cov, I calculated the correlation and
covariance of
2010 Mar 26
1
Problems if optimization
What's up fellows...
I am a begginer in R and i am trying to find the parameters of one
likelihood function, but when i otimize it, always appers a error or
advertisement and the solve does not occur.
The problem seems like that:
"lMix<-function(pars,y){
beta1<-pars[1]
beta2<-pars[2]
beta3<-pars[3]
beta4<-pars[4]
beta5<-pars[5]
alfa1<-pars[6]
2008 Apr 11
1
Speex
<speex-dev at xiph.org>
Hi all,
I'm a begginer with DSP and i need your help and suggestions.
I'm trying to use the Speex and a DSP DM642 to implement a solution with
voice! I'm using the 1.2 beta 3 distribution and the TI's Code Composer
Studio v3.1 simulator. I coosed speex_C64_test.pjt and modified the
speex_C64_test.cmd to only use the DM642 external RAM memory.
I'm