[R] Add blank rows to a dataframe

2013-06-08 Thread Bert Jacobs
Hi, I have a vector that looks like this: RowSel <-c(0,1,0,1,2,3,0,5,5) Now I want to select rows from a specific dataframe DF based on that vector like this: SubDF <- DF[RowSel,] So this works fine, but I was wondering how I could add blank rows add the locations in the vector where there is a

[R] Unique Values per Column

2012-07-20 Thread Bert Jacobs
Hi, I was wondering what the best way is to create a new dataframe based on an existing dataframe with only the unique available levels for each column (22 columns in total) in it. If some columns have less unique values than others, then those columns can be filled with blanks for the remaining

Re: [R] RScript.exe and map directory issue

2012-05-31 Thread Bert Jacobs
- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: 31 May 2012 23:51 To: Bert Jacobs Cc: r-help@r-project.org Subject: Re: [R] RScript.exe and map directory issue Not on Windows so I can't test, but I imagine you need to escape the space: try this: Call Shell(rPath &a

[R] RScript.exe and map directory issue

2012-05-31 Thread Bert Jacobs
Hi, I'm trying to run on Windows 7 a scriptfile with Rscript.exe from within Excel 2010 with the following code: Call Shell(rPath & "\Rscript.exe C:\Work\Latest\_Test.R", vbHide) The good news is: the above code works perfectly, but ... If I add white spaces to my map directory, like: Call Shell(

Re: [R] replace last 3 characters of string

2011-04-03 Thread Bert Jacobs
Thx I could imagine it was so simple.:) Bert -Original Message- From: Dirk Eddelbuettel [mailto:e...@master.debian.org] On Behalf Of Dirk Eddelbuettel Sent: 04 April 2011 01:39 To: Bert Jacobs Cc: r-help@r-project.org Subject: Re: [R] replace last 3 characters of string On Mon, Apr 04

[R] replace last 3 characters of string

2011-04-03 Thread Bert Jacobs
Hi, I would like to replace the last tree characters of the values of a certain column in a dataframe. This replacement should only take place if the last three characters correspond to the value "/:/" and they should be replaced with ""(blank) I cannot perform a simple gsub because the chara

[R] Split rows depending on time frame

2010-10-11 Thread Bert Jacobs
Hi, I have the following data frame, where col2 is a startdate and col3 an enddate COL1 COL2 COL3 A 4046240482 B 4046240478 The above timeframe of 3 weeks I would like to splits it in weeks like this COL1 COL2 COL3 COL4 A

[R] Multiply Two Dataframes

2010-06-07 Thread Bert Jacobs
Hi, I have the following two dataframes (Df1 and Df2): Df1 has a layout like ID Location Var1 Var2 Var3 . Var20 A Loc2 1 11. 1 A Loc1 0 10. 1 B Loc1 0 00. 0 A Loc3

Re: [R] Is the aggregate function the best way to do this?

2010-02-17 Thread Bert Jacobs
Hi Mohamed, Thx for the answer. And what should I do if my fun function is not 'sum' but 'max'? Bert -Original Message- From: Mohamed Lajnef [mailto:mohamed.laj...@inserm.fr] Sent: 17 February 2010 10:02 To: Bert Jacobs Cc: r-help@r-project.org Subject: Re: [R] Is th

[R] Is the aggregate function the best way to do this?

2010-02-17 Thread Bert Jacobs
Hi, I'm having a dataframe 'Subset1' with a number of factor variables and 160 numerical variables Now I want to make sums for all rows that have the same values for the different factor variables, except for the factor variables: VAR1,VAR2,VAR3 who may have the same values. With the formula

Re: [R] t.test

2010-02-05 Thread Jacobs
I would use aov( ) mod<-aov(Score~Group, data=x) summary(mod) JJ -- View this message in context: http://n4.nabble.com/t-test-tp1470539p1470558.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

Re: [R] how to solve a problem in R this problem?can someone help me

2009-11-30 Thread susan jacobs
Rolf Turner wrote: > > > > You should do your own homework. > > cheers, > > Rolf Turner > > On 1/12/2009, at 10:37 AM, susan jacobs wrote: > >> Census from 1990 california in USA. It’s a data frame with data >> from 20640

[R] how to solve a problem in R this problem?can someone help me

2009-11-30 Thread susan jacobs
Census from 1990 california in USA. It’s a data frame with data from 20640 zones from Califórnia. Zones are chosen as being geograficly near, wich one with 1500 persons (mean). For each zone are provided several informations in the colums from data frame: - longitude e latitude from the geograf

Re: [R] Learning R

2009-11-30 Thread susan jacobs
Hi, im working in R but honestly i don t know how to apply the formulas in my problem, can someone give some help? I already learn how we use the formulas but im not understanding the main issue in my problem. Johannes Huesing wrote: > > Esmail [Mon, Nov 30, 2009 at 01:07:15PM CET]: > >>

[R] slow aggregate function

2008-11-05 Thread Bert Jacobs
Hi, I've written the following line of code to make a summary of some data: Final.Data.Short <- as.data.frame(aggregate(Merge.FinalSubset[,8:167], list(Location = Merge.FinalSubset $Location,Measure = Merge.FinalSubset $Measure,Site = Merge.FinalSubset $Site, Label= Merge.FinalSubset $

[R] GAM and poly.transform Issue

2008-06-10 Thread Bert Jacobs
Hi, I have the following problem while running a "gam" regression: test.gam = gam(fmla,data=Final.Df) where fmla is a regression formula that looks like: "Var1 ~ poly(c(1:160), degree = 5) + VarC1 + VarC2 + . VarC12 Within SPlus I used the following phrase to find the coefficients

Re: [R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
NOT OK: Error in 1:ncol(mat) : NA/NaN argument fix(x)This works, but I can't use it in a function Any idea what could cause this issue? _ From: jim holtman [mailto:[EMAIL PROTECTED] Sent: 15 May 2008 18:12 To: Bert Ja

Re: [R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
lto:[EMAIL PROTECTED] Sent: 15 May 2008 18:12 To: Bert Jacobs Subject: Re: [R] Adding columns to dataframe Will somethink like this work to just add dummy columns: > x <- data.frame(a=1:10, b=1:10) > y <- data.frame(a=1, c=1, d=1, e=1, f=1) > # get unique names in y > uniq

[R] Adding columns to dataframe

2008-05-15 Thread Bert Jacobs
Hi, I have a dataframe SDF1 that looks like this: Char1 Char2 Char 3 W.2007.02 W.2007.09 W.2007.16 W.2008.13 AC1F1 F2 F3 AC2 F4 BC3 F5 F6 I have another dataframe S

Re: [R] Dividing Two Dataframes

2008-05-14 Thread Bert Jacobs
rows) Is it easy to adapt your formula to get this result? Thx, Bert _ From: Henrique Dallazuanna [mailto:[EMAIL PROTECTED] Sent: 14 May 2008 13:34 To: Bert Jacobs Cc: r-help@r-project.org Subject: Re: [R] Dividing Two Dataframes Try this: DFS <- lapply(split(seq(1,

[R] Dividing Two Dataframes

2008-05-14 Thread Bert Jacobs
Hi, I have two dataframes one with 144 rows and 160 columns (SDF1) and one with 12 rows and 160 columns (SDF2). Now I'm trying to divide rows 1:12 with SDF2, rows 13:24 with SDF2, rows 25:36 with SDF 2, . In S-Plus the following code works fine: DFS = SDF1[1:144,1:60] / as.vector(SDF2[1:1

Re: [R] Reshape Dataframe

2007-12-20 Thread Bert Jacobs
F1 A Si W1 F2 A Fa W2 F3 A Si W3 F4 B Si W1 F5 C La W2 F6 C Do W4 F7 C Do W4 F8 -Original Message- From: John Kane [mailto:[EMAIL PROTECTED] Sent: 19 December 2007 17:57 To: B

Re: [R] Reshape Dataframe

2007-12-20 Thread Bert Jacobs
In which package do I find the "cast" function. At the moment it's not recognized. Thx, Bert -Original Message- From: John Kane [mailto:[EMAIL PROTECTED] Sent: 19 December 2007 17:57 To: Bert Jacobs; 'hadley wickham' Cc: [EMAIL PROTECTED] Subject: Re: [R] Resh

Re: [R] Reshape Dataframe

2007-12-18 Thread Bert Jacobs
wickham [mailto:[EMAIL PROTECTED] Sent: 18 December 2007 15:16 To: Bert Jacobs Cc: [EMAIL PROTECTED] Subject: Re: [R] Reshape Dataframe On 12/18/07, Bert Jacobs <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm having a bit of problems in creating a new dataframe. > Below you'

[R] Reshape Dataframe

2007-12-18 Thread Bert Jacobs
Hi, I'm having a bit of problems in creating a new dataframe. Below you'll find a description of the current dataframe and of the dataframe that needs to be created. Can someone help me out on this one? Thx in advance. Bert Current Dataframe Var1Var2Var3Var4 A Fa W1