Re: [R] introducing R to high school students

2012-04-22 Thread Indrajit Sengupta
Bert,   What you are saying - is a problem with people who are using Excel. It is not Excel's problem that people are sending data in an unstructured way. I agree - Excel may not be the right tool when you are doing some complicated data analysis (like for e.g. statistical modeling) - but that

Re: [R] How to remove $ (Dollar sign) from string

2012-04-22 Thread Giuseppe Marinelli
In data martedì 10 aprile 2012 13:34:13, Nevil Amos ha scritto: How do I remove a $ character from a string sub() and gsub() with $ or \$ as pattern do not work. sub($,,ABC$DEF) [1] ABC$DEF sub(\$,,ABC$DEF) Error: '\$' is an unrecognized escape in character string starting \$

Re: [R] unexpected plot behavior

2012-04-22 Thread Martin Renner
Thank you for the replies, Uwe and Marc. These are explanations that make perfect sense. However, shouldn't the behavior of plot.factor include the option of type = n for consistency with the default plot function? Best, Martin On 21 Apr 2012, at 08:18 , Marc Schwartz wrote: On Apr 21,

Re: [R] contour algorithm

2012-04-22 Thread Duncan Murdoch
On 12-04-21 9:21 PM, Stoch astic wrote: First time user, so sorry if I don't understand protocol.. Anyway, I have created a data frame consisting of pearson's R values at various x and y coordinates and then plotted this using filled.contour. My data is similar to fMRI data except that it is a

[R] how to avoid newlines tabs in file opening?

2012-04-22 Thread sagarnikam123
i have uploaded file,but when i am opening it in R,using u-file(file.choose(),r) k-readLines(u) k k[1:120] is has all /t (tabs) newlines, how to avoid it, can i take first 3 columns only in table form (lines starts with # not important for me) uploaded file:-

[R] how to cut files from any folder to another folder?

2012-04-22 Thread sagarnikam123
i want to cut file from e.g. abc folder put it into another location with folder name e.g. xyz how should i proceed? -- View this message in context: http://r.789695.n4.nabble.com/how-to-cut-files-from-any-folder-to-another-folder-tp4577818p4577818.html Sent from the R help mailing list

[R] Standard error

2012-04-22 Thread Christopher Kelvin
Hello, I have tried obtaining the value of standard error from the code below but i get different values when i compare it with the  standard error obtained from the hessian matrix. Can somebody help me out? Thank you n=100;rr=1000 p1=1.2;b=1.5 sq11=sq21=0 for (i in 1:rr){

Re: [R] How to remove $ (Dollar sign) from string

2012-04-22 Thread Patrick Burns
Why you need a double backslash is alluded to in Circle 8.1.23 of 'The R Inferno'. http://www.burns-stat.com/pages/Tutor/R_inferno.pdf Pat On 22/04/2012 10:18, Giuseppe Marinelli wrote: In data martedì 10 aprile 2012 13:34:13, Nevil Amos ha scritto: How do I remove a $ character from a

[R] How to take ID of number 7.

2012-04-22 Thread Yellow
I figured out something new that I would like to see if I can do this more easy with R then Excel. I have these huge files with data. For example: DataFile.csv ID Name log2 1 Fantasy 5.651 2 New 7.60518 3 Finding 8.9532 4 Looeka -0.248652 5 Vani 0.3548 With like header1: ID, header 2:

Re: [R] How to take ID of number 7.

2012-04-22 Thread Berend Hasselman
On 22-04-2012, at 13:03, Yellow wrote: I figured out something new that I would like to see if I can do this more easy with R then Excel. I have these huge files with data. For example: DataFile.csv ID Name log2 1 Fantasy 5.651 2 New 7.60518 3 Finding 8.9532 4 Looeka

Re: [R] compare mean

2012-04-22 Thread Yellow
I am also compairing 2 things with each other. x = c(1, 5, 7, 9) y = c(2, 7, 9, 10, 11) intersect(x, y) Output will be: 7, 9. Hope it helped. :) -- View this message in context: http://r.789695.n4.nabble.com/compare-mean-tp4576372p4578007.html Sent from the R help mailing list archive

[R] RE how to cut files from any folder to another folder?

2012-04-22 Thread Carl Witthoft
?file.copy Or ?system From: sagarnikam123 sagarnikam123_at_gmail.com Date: Sun, 22 Apr 2012 01:25:21 -0700 (PDT) i want to cut file from e.g. abc folder put it into another location with folder name e.g. xyz how should i proceed? -- Sent from my Cray XK6 Quidvis recte factum, quamvis

Re: [R] How to take ID of number 7.

2012-04-22 Thread Rui Barradas
Hello, Berend Hasselman wrote On 22-04-2012, at 13:03, Yellow wrote: I figured out something new that I would like to see if I can do this more easy with R then Excel. I have these huge files with data. For example: DataFile.csv ID Name log2 1 Fantasy 5.651 2 New 7.60518

Re: [R] introducing R to high school students

2012-04-22 Thread Christopher W. Ryan
I have to agree that Excel is a poor tool for serious scientific and engineering data analysis (love the phrase.) I too have spent way too much time beating Excel files into submission, with workarounds and manipulations, just to be able to do anything useful with them. I'm told that one can

Re: [R] unexpected plot behavior

2012-04-22 Thread Marc Schwartz
On Apr 22, 2012, at 1:25 AM, Martin Renner wrote: Thank you for the replies, Uwe and Marc. These are explanations that make perfect sense. However, shouldn't the behavior of plot.factor include the option of type = n for consistency with the default plot function? Best, Martin I

Re: [R] how to avoid newlines tabs in file opening?

2012-04-22 Thread Jeff Newmiller
How about, don't avoid them, use them? dta - read.table( http://r.789695.n4.nabble.com/file/n4577757/rabata.txt rabata.txt, as.is=TRUE, skip=4, sep=\t ) --- Jeff NewmillerThe . .

[R] Transform dataframe

2012-04-22 Thread David Studer
Hi everyone! I have to following question: I have three items that had to be ordered (e.g. three persons were rating var1 on the first rank): var1 var2 var3 123 213 132 123 Now I'd like to have the data.frame the other way round, so that the ranks are in the

Re: [R] how to avoid newlines tabs in file opening?

2012-04-22 Thread Rui Barradas
Hello, sagarnikam123 wrote i have uploaded file,but when i am opening it in R,using u-file(file.choose(),r) k-readLines(u) k k[1:120] is has all /t (tabs) newlines, how to avoid it, can i take first 3 columns only in table form (lines starts with # not important for me) uploaded

Re: [R] how to cut files from any folder to another folder?

2012-04-22 Thread Jeff Newmiller
The cut/copy/paste paradigm is not common in programmed file manipulation under various operating systems... due to cross-platform compatibility, be prepared to work on files with a copy(=duplicate)/remove approach. ?files

[R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
Dear R-Gurus I have a data frame (from CSV file) which has its first column called Date. The Date is in the format mm/dd/. I was trying to get the weekday for these dates and I tried using wday() and day.of.week() functions and both of them gave me precisely the wrong answers. I think the

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread R. Michael Weylandt
Yes dput() for a reproducible example with some minimal reproducible code (and the packages day.of.week and wday() come from...) x - xts(10, Sys.Date()) wday(x) seems fine for me. precisely the wrong answers -- interesting turn of phrase. Michael On Sun, Apr 22, 2012 at 12:53 PM,

Re: [R] Transform dataframe

2012-04-22 Thread Jeff Newmiller
On Sun, 22 Apr 2012, David Studer wrote: Hi everyone! I have to following question: I have three items that had to be ordered (e.g. three persons were rating var1 on the first rank): var1 var2 var3 123 213 132 123 Now I'd like to have the data.frame the other

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Hasan Diwan
Raghu, On 22 April 2012 09:53, Raghuraman Ramachandran optionsra...@gmail.comwrote: I have a data frame (from CSV file) which has its first column called Date. The Date is in the format mm/dd/. I was trying to get the weekday for these dates and I tried using wday() and day.of.week()

Re: [R] How to take ID of number 7.

2012-04-22 Thread Yellow
O_o This is kinda interesting I have 267 log2 values = 7. And 295 ID numbers. I don't see any problems in my code also: ID_Log2_Above_7 = DataFile[DataFile$log2 = 7, c(ID, Log2] # Take ID out. ID_Above_7 = ID_Log2_Above_7$ID # Only numbers, no na or inf. ID_Above_7_NO_NA =

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Jeff Newmiller
On Sun, 22 Apr 2012, Hasan Diwan wrote: Raghu, On 22 April 2012 09:53, Raghuraman Ramachandran optionsra...@gmail.comwrote: I have a data frame (from CSV file) which has its first column called Date. The Date is in the format mm/dd/. I was trying to get the weekday for these dates and I

Re: [R] How to take ID of number 7.

2012-04-22 Thread Jeff Newmiller
Please provide self-contained, reproducible examples. On Sun, 22 Apr 2012, Yellow wrote: O_o This is kinda interesting I have 267 log2 values = 7. And 295 ID numbers. I don't see any problems in my code also: ID_Log2_Above_7 = DataFile[DataFile$log2 = 7, c(ID, Log2] Missing a

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
I tried downloading using as.is and have also provided the dput below. The date for example is 20/4/2012 and wday gives 2 instead of 6? Thanks for all your help. str(test1) 'data.frame': 1825 obs. of 7 variables: $ Date : chr 20/04/2012 19/04/2012 18/04/2012 17/04/2012 ... $ Open :

Re: [R] how to cut files from any folder to another folder?

2012-04-22 Thread cberry
sagarnikam123 sagarnikam...@gmail.com writes: i want to cut file from e.g. abc folder put it into another location with folder name e.g. xyz how should i proceed? See ?files -- View this message in context:

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Raghuraman Ramachandran
I also tried: test$Date=as.POSIXct(test$Date,format=%m%d%y) test=cbind(test,day.of.week=format(test$Date,format=%A)) head(test) Date Open High Low Close Volume Adj.Close day.of.week 1 NA 2.33 2.34 2.31 2.31 5366000 2.31NA 2 NA 2.35 2.36 2.33 2.35 5382000 2.35

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Berend Hasselman
On 22-04-2012, at 20:12, Raghuraman Ramachandran wrote: I tried downloading using as.is and have also provided the dput below. The date for example is 20/4/2012 and wday gives 2 instead of 6? Thanks for all your help. dt - 20/04/2012 as.Date(dt) [1] 0020-04-20 as.Date(dt,format=%d/%m/%Y)

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread David Winsemius
On Apr 22, 2012, at 2:12 PM, Raghuraman Ramachandran wrote: I tried downloading using as.is and have also provided the dput below. The date for example is 20/4/2012 and wday gives 2 instead of 6? Thanks for all your help. str(test1) 'data.frame': 1825 obs. of 7 variables: $ Date

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread David Winsemius
On Apr 22, 2012, at 2:18 PM, Raghuraman Ramachandran wrote: I also tried: test$Date=as.POSIXct(test$Date,format=%m%d%y) Well, as became apparent when you eventually offered an example, you have dates in dd/mm/ format, so it's hardly surprising that it didn't work with a format

[R] need advice on using excel to check data for import into R

2012-04-22 Thread Markus Weisner
I have created an S4 object type for conducting fire department data analysis. The object includes validity check that ensures certain fields are present and that duplicate records don't exist for certain combinations of columns (e.g. no duplicate incident number / incident data / unit ID ensures

Re: [R] difficulty in Formatting time series data

2012-04-22 Thread Rui Barradas
Hello, SMALL, reproducible examples... Anyway, it's not that difficult. Try this d.of.w - as.integer(format(as.Date(test1$Date, format=%d/%m/%Y), %w)) str(d.of.w) head(d.of.w) Note that the format '%w' gives days in 0-6, where Sunday == 0. See ?strftime. Your Friday is therefore 5. (Or use

[R] Assignment problems

2012-04-22 Thread phillip03
The text below is a part of, some work I have to do, which is due in 2 days and I am strung up with a lot of other stuff, so I was hoping someone would take 5 mins and help me ?? Here is a part of my data.frame: year country1 country2 contig comlangpop1gdp1 pop2

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-22 Thread Jonathan Greenberg
Thanks all (particularly to you, Berend) -- I'll push forward with these solutions and integrate them into my code. I did come across geigen while rooting around in the CCA code but its not formally documented (it just says for internal use or something along those lines) and as you found out

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-22 Thread Berend Hasselman
On 22-04-2012, at 21:08, Jonathan Greenberg wrote: Thanks all (particularly to you, Berend) -- I'll push forward with these solutions and integrate them into my code. I did come across geigen while rooting around in the CCA code but its not formally documented (it just says for internal

Re: [R] Assignment problems

2012-04-22 Thread R. Michael Weylandt michael.weyla...@gmail.com
Look at ?ifelse, a combination of logical subscripting and mean(), or even better ?ave -- I can't say too much more; there's a no homework policy on this list and I recognize that first solution as mine already... (I should have noted that the first time) Michael On Apr 22, 2012, at 2:54 PM,

Re: [R] Assignment problems

2012-04-22 Thread Rui Barradas
Hello, phillip03 wrote The text below is a part of, some work I have to do, which is due in 2 days and I am strung up with a lot of other stuff, so I was hoping someone would take 5 mins and help me ?? Here is a part of my data.frame: year country1 country2 contig comlang

Re: [R] need advice on using excel to check data for import into R

2012-04-22 Thread Richard M. Heiberger
This looks like a perfect case for an RExcel solution. RExcel is an addin that allows you, among other things, to place an arbitrary R function inside the Excel automatic recalculation mode. For details see rcom.univie.ac.at There are many references item listed on the wiki page in the left

Re: [R] How to take ID of number 7.

2012-04-22 Thread Steve Lianoglou
On Sun, Apr 22, 2012 at 7:03 AM, Yellow s1010...@student.hsleiden.nl wrote: I figured out something new that I would like to see if I can do this more easy with R then Excel. I have these huge files with data. For example: DataFile.csv ID Name log2 1 Fantasy 5.651 2 New 7.60518 3

[R] using a loop with an integration

2012-04-22 Thread piltdownpunk
Hi, all. I've written a function that returns the survival function for a Gompertz mortality model. I've specified the two model parameters. Using a simple integration, I can calculate the life expectancy at any age. Is there a way I can use a loop with the integration that will quickly

Re: [R] Assignment problems

2012-04-22 Thread phillip03
I have tried ifelse: trade-data.frame(avgflow,EMU,stringsAsFactors=FALSE) avgflowEURO-rep(0,nrow(trade)) trade1-(for (i in 1:nrow(trade)){ifelse(EMU[i]==1,avgflowEURO[i]-avgflow[i],NA)}) -- View this message in context:

Re: [R] Assignment problems

2012-04-22 Thread phillip03
Does mean(avgflow[EMU]) sum the avgflows for all countrypairs where EMU[i]==TRUE and take the mean ? Practical question: is mean(avgflow[EMU]) = mean(avgflow[EMU==TRUE]) ??? -- View this message in context: http://r.789695.n4.nabble.com/Assignment-problems-tp4578672p4578761.html Sent from the R

Re: [R] Assignment problems

2012-04-22 Thread Rui Barradas
phillip03 wrote Does mean(avgflow[EMU]) sum the avgflows for all countrypairs where EMU[i]==TRUE and take the mean ? Practical question: is mean(avgflow[EMU]) = mean(avgflow[EMU==TRUE]) ??? Answer: yes. Rui Barradas -- View this message in context:

Re: [R] need advice on using excel to check data for import into R

2012-04-22 Thread Markus Weisner
If I go to wiki - how to install it looks like a rather complicated installation that involves installing R followed by several command line prompts. It looks like it might be too much of an installation process to make sense for a client to conduct a one-time data check. Looks like a great tool

Re: [R] using a loop with an integration

2012-04-22 Thread David Winsemius
On Apr 22, 2012, at 3:41 PM, piltdownpunk wrote: Hi, all. I've written a function that returns the survival function for a Gompertz mortality model. I've specified the two model parameters. Using a simple integration, I can calculate the life expectancy at any age. Is there a way I

[R] Issue with message()

2012-04-22 Thread Axel Urbiz
Dear List, I built a package under both Mac and Win 7 (both on R 2.12.0) . One of the functions in the package is set up to print a status message using the code below: if (verbose) if ((i %% 10) == 0 i ntree) message( , i, out of, ntree, trees so far...) This works perfectly on the

Re: [R] Issue with message()

2012-04-22 Thread Rolf Turner
On 23/04/12 09:36, Axel Urbiz wrote: Dear List, I built a package under both Mac and Win 7 (both on R 2.12.0) . One of the functions in the package is set up to print a status message using the code below: if (verbose) if ((i %% 10) == 0 i ntree) message( , i, out of, ntree, trees

Re: [R] Assignment problems

2012-04-22 Thread phillip03
Thank you Rui Can you help me with my ifelse problem - I would like to add a list to my data.frame where avgflow in those rows where ONLY my country pair both are in euro -- View this message in context: http://r.789695.n4.nabble.com/Assignment-problems-tp4578672p4578806.html Sent from the R

[R] CRAN (and crantastic) updates this week

2012-04-22 Thread Crantastic
CRAN (and crantastic) updates this week New packages * appell (0.0-3) Maintainer: Daniel Sabanes Bove Author(s): Daniel Sabanes Bove daniel.sabanesb...@ifspm.uzh.ch with contributions by F. D. Colavecchia, R. C. Forrey, G. Gasaneo, N. L. J. Michel, L.

Re: [R] Issue with message()

2012-04-22 Thread Duncan Murdoch
On 12-04-22 5:36 PM, Axel Urbiz wrote: Dear List, I built a package under both Mac and Win 7 (both on R 2.12.0) . One of the functions in the package is set up to print a status message using the code below: if (verbose) if ((i %% 10) == 0 i ntree) message( , i, out of, ntree, trees

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
I actually tried robustPca in pcaMethods on bioconductor. It keeps giving me the warning Input data is not complete... Reading into the function: When there is no NAs, it will give this warning... It seems that there is a bug in this code... Is it reliable at all? -

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
Any thoughts on this error in robustSVD? Thanks a lot! Error in if (!all(tmp)) { : missing value where TRUE/FALSE needed Enter a frame number, or 0 to exit 1: #73: pca(dTmp, method = robustPca, nPcs = nNumFactors, center = FALSE) 2: robustPca(prepres$data, nPcs = nPcs, ...) 3:

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Joshua Wiley
On Sun, Apr 22, 2012 at 4:43 PM, Michael comtech@gmail.com wrote: I actually tried robustPca in pcaMethods on bioconductor. It keeps giving me the warning Input data is not complete... Reading into the function: When there is no NAs, it will give this warning... It seems that there is

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
Even in R, there are so many of robust PCA... any survey or review of all these different methods? On Sun, Apr 22, 2012 at 6:58 PM, Joshua Wiley jwiley.ps...@gmail.comwrote: On Sun, Apr 22, 2012 at 4:43 PM, Michael comtech@gmail.com wrote: I actually tried robustPca in pcaMethods on

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Bert Gunter
As I believe I already told you, look at the CRAN Robust task view. -- Bert On Sun, Apr 22, 2012 at 6:29 PM, Michael comtech@gmail.com wrote: Even in R, there are so many of robust PCA... any survey or review of all these different methods? On Sun, Apr 22, 2012 at 6:58 PM, Joshua Wiley

[R] linear model benchmarking

2012-04-22 Thread ivo welch
I cleaned up my old benchmarking code and added checks for missing data to compare various ways of finding OLS regression coefficients. I thought I would share this for others. the long and short of it is that I would recommend ols.crossprod = function (y, x) { x -

[R] Scrape data from Scopus: login through R?

2012-04-22 Thread mdvaan
Hello, The Scopus bibliographic database allows one to manually download batches of 2000 publications. The data is rich but does not provide one with a field containing the author id. However, author id's can be retrieved through the hyperlinks on the Scopus website. I have two questions: 1. My

Re: [R] ROCR for combination of markers

2012-04-22 Thread suo
Hi Eik or other who might help: I got this error: Error in roc.formula(form = y1 ~ x + z, plot = ROC) : Invalid formula: exactly 1 predictor is required in a formula of type response~predictor. when I ran out=ROC( form = y1 ~ x + z, plot=ROC) from your code. How to fix it? Thanks. -- View

Re: [R] more boa plots questions

2012-04-22 Thread Chihuahuin
boa.plot('trace') -- View this message in context: http://r.789695.n4.nabble.com/more-boa-plots-questions-tp3330312p4579163.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Michael
yes, but that is not a good Review or Survey... thx On Sun, Apr 22, 2012 at 9:47 PM, Bert Gunter gunter.ber...@gene.com wrote: As I believe I already told you, look at the CRAN Robust task view. -- Bert On Sun, Apr 22, 2012 at 6:29 PM, Michael comtech@gmail.com wrote: Even in R, there

Re: [R] PCA sensitive to outliers?

2012-04-22 Thread Steve Lianoglou
On Mon, Apr 23, 2012 at 12:01 AM, Michael comtech@gmail.com wrote: yes, but that is not a good Review or Survey... thx But the packages listed there do have their own documentation and vignettes. For instance the rrcov package seems to have a nice vignette about its design as well as methods

Re: [R] slanted stacked bar graphs?

2012-04-22 Thread Susanna Makela
Hi Barry, Thanks so much for the Junk Charts link. Maybe it'll help me make my case for why we shouldn't present our data like this. Susanna On Mon, Apr 9, 2012 at 1:07 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Mon, Apr 9, 2012 at 7:29 AM, Susanna Makela