similar to: adding variable into dataframe by indice

Displaying 17 results from an estimated 17 matches similar to: "adding variable into dataframe by indice"

2006 Feb 08
0
insert value according to indice
R-Helpers, I am trying to insert a value into a dataframe. This value is a proportion calculated by counting the number of those individuals with that value and then inserting the proportion at the end of the dataframe to only those individuals with the given value. The problem I am running into is that the proportions are not being attached to only those individuals with the specified value
2004 May 10
3
sqlSave with underscores in table fieldname
Hi group, I try to write a frame to a table (RODBC). I use colnames(temp6) <- c("ind_id","ser_id","period_id","year","calc","mean") sqlSave(channel, temp6, tablename = "series_indices_test",append= TRUE, rownames=FALSE, verbose = FALSE, test = FALSE, nastring = -999999, fast = FALSE) This is giving me an error: Error in
2007 Jul 17
1
distance function (analogue)
Hello R-Users, its again me with a question. I´m using R 2.5.0 on Mac Power Book running Mac OS X 10.4.10 I try to calculate distances betweeen two data tables looking like this V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 V32 V33 V34 V35 V36 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0
2010 May 20
1
sqldf: issues with natural joins
Hello, I'm having trouble discovering what's going wrong with my use of natural joins via sqldf. Following the instructions under 4i at http://code.google.com/p/sqldf/, which discusses creating indices to speed joins, I have been only unreliably able to get natural joins to work. For example, > Tid <- c('AES 01-01-02 10:58:00', 'AES 01-01-02 11:53:00', 'AES
2010 Jul 14
1
question about SVM in e1071
Hi, I have a question about the parameter C (cost) in svm function in e1071. I thought larger C is prone to overfitting than smaller C, and hence leads to more support vectors. However, using the Wisconsin breast cancer example on the link: http://planatscher.net/svmtut/svmtut.html I found that the largest cost have fewest support vectors, which is contrary to what I think. please see the scripts
2010 Feb 15
4
density estimates for fixed points
Problem: Based on a n x 2 data matrix i want a kernel estimate of the bivariate density. However, i also wish to specify wich points the density should be calculated at. I can offcourse just write the full kernel density estimate as a R-code, but surely there must already exist some package for this operation? The package density(), seems to create a new matrix (depending on n), where the
2012 Oct 25
5
trying ti use a function in aggregate
Hi -I am using R v 2.13.0. I am trying to use the aggregate function to calculate the percent at length for each Trip_id and CommonName. Here is a small subset of the data. Trip_id Vessel CommonName Length Count 1 230 Sunlight Shad,American 19 1 2 230 Sunlight Shad,American 20 1 3 230 Sunlight Shad,American 21
2007 May 05
1
(no subject)
Dear Mailing-List, I think this is a newbie question. However, i would like to integrate a loop in the function below. So that the script calculates for each variable within the dataframe df1 the connecting data in df2. Actually it takes only the first row. I hope that's clear. My goal is to apply the function for each data in df1. Many thanks in advance. An example is as follows: df1
2007 Mar 28
2
Standardization Range
? 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/20070328/ee4422a2/attachment.pl
2010 Jan 11
1
Getting a date out of an indice in a time series
I have a weekly data set imported via: tsSource=ts(sh1$I000,start=c(2004,1),freq=52) I am now getting to some 'spit and polish' but I realize something I can't wrap my head around. Given an outlier I find at say tsSource[54] ... how can get translate index 54 into the date\week. I mean I can figure out obviously that entry 52 is last week of 2004 but since the data goes for many
2011 Nov 15
3
how to indice the column in the data.frame
hi R,users Now I read a data from a txt file newdata<-read.table("1.txt") in the 1.txt ,there are several column shown as below 1 3 4 5 2 3 5 6 4 5 6 7 so when I want analysis the second column anadata<-newdata$V2 but my question I can not use some certain variable to indice the column? e.g cmn=2 anadata<-newdata$Vcmn how can I finish this command ?can anyone help me ? thank
2009 Dec 15
3
RFC: lchoose() vs lfactorial() etc
lgamma(x) and lfactorial(x) are defined to return ln|Gamma(x)| {= log(abs(gamma(x)))} or ln|Gamma(x+1)| respectively. Unfortunately, we haven't chosen the analogous definition for lchoose(). So, currently > lchoose(1/2, 1:10) [1] -0.6931472 -2.0794415 NaN -3.2425924 NaN -3.8869494 [7] NaN -4.3357508 NaN -4.6805913 Warning message: In
2016 Sep 06
2
usar un for para cambiar indice
Estimados usuarios-de-R: Tengo un problema. Si por ejemplo tengo una lista conformada por la serie historia del PBI de 10 paìses. >Tiempo <- seq(1:100) >plot(Tiempo, PP$"Serie 1", type="l",col="1") >lines(Tiempo, PPcapita$"Serie 2") >lines(Tiempo, PPcapita$"Serie 3") >lines(Tiempo, PPcapita$"Serie 4")
2004 Jul 08
2
Getting elements of a matrix by a vector of column indice s
See if the following helps: > m <- outer(letters[1:5], 1:4, paste, sep="") > m [,1] [,2] [,3] [,4] [1,] "a1" "a2" "a3" "a4" [2,] "b1" "b2" "b3" "b4" [3,] "c1" "c2" "c3" "c4" [4,] "d1" "d2" "d3" "d4" [5,]
2008 Jun 26
0
geoR : Passing arguments to "optim" when using "likfit"
Hi everyone !   I'm am trying to fit a kriging model to a set of data. When I just run the "likfit" command I can obtain the results. However when I try to pass additional arguements to the optimization function "optim" I get errors. That is I want to obtain the hessian matrix so matrix (hessian=TRUE).   Heres a little example( 1-D). Can anyone shed some light?  Where am I
2008 Jun 26
0
geoR : Passing arguments to "optim" when using "likfit"]
Mzabalazo Ngwenya wrote: > Hi everyone ! > > I'm am trying to fit a kriging model to a set of data. When I just run > the "likfit" command I can obtain the results. However when I try to > pass additional arguements to the optimization function "optim" I get > errors. That is I want to obtain the hessian matrix so matrix > (hessian=TRUE). >
2006 Nov 08
10
axis command and excel time format
Hi to all, I have some problems to get the times-scale to the x-axis the times are coming from an excel sheet f. e [1] "0:01:00" "0:02:00" "0:03:00" "0:04:00" "0:05:00" "0:06:00" "0:07:00" [8] "0:08:00" "0:09:00" "0:10:00" "0:11:00" "0:12:00" "0:13:00"