[R] read.xport
I am trying to import data from a SAS XPORT file that contains 24 SAS files. When I use the read.xport procedure only about 16 data frames (components) are created. Any suggestions? * Gary A. Nelson, Ph.D Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.xport
I have the latest version of foreign, but it still doesn't work. I quickly tried the Hmisc package, but the same issue arose. I will delve into the Hmisc package further. Thanks. -Original Message- From: Frank E Harrell Jr [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 11:46 AM To: bogdan romocea Cc: Nelson, Gary (FWE); R-help@stat.math.ethz.ch Subject: Re: [R] read.xport bogdan romocea wrote: How about avoiding SAS XPORT altogether and exporting everything in the simple, clean, non-proprietary, extremely reliable, platform-independent ... etc text format (CSV, tab delimited etc)? I hope the problem is fixed in the latest version of foreign (no version info was given). In case it's not, you may want to look at the sasxport.get function in the Hmisc package. Frank -Original Message- From: Nelson, Gary (FWE) [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 10:31 AM To: r-help@stat.math.ethz.ch Subject: [R] read.xport I am trying to import data from a SAS XPORT file that contains 24 SAS files. When I use the read.xport procedure only about 16 data frames (components) are created. Any suggestions? ** *** Gary A. Nelson, Ph.D Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] read.xport
Sorry about the version. I have version 0.8-8 of foreign. I downloaded (and installed) it this afternoon. The XPORT files were created in SAS using PROC COPY. I used the code: temp-read.xport(c:/temp/int82ag.xpt). I still get only 16 file of the 24 SAS placed into the XPORT file. The XPORT files come from ftp://cusk.nmfs.noaa.gov/mrfss/intercept/ag/ if anyone wants to try it. I used the .xpt in int82ag.zip and it appears they were created using SASV5XPT. -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Thursday, July 14, 2005 2:01 PM To: Nelson, Gary (FWE) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] read.xport On Thu, 14 Jul 2005, Nelson, Gary (FWE) wrote: I have the latest version of foreign, but it still doesn't work. I Are you sure: a new version was released a few hours ago? It may not answer your question, but please do give actual version numbers (as the posting guide asks). -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
* Gary A. Nelson, Ph.D Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Help with the ts function
I have a time series of temperature data recorded every 2 hours and I would like to generate a spectrogram using the spectrum function that examines cycles per day. My statement for coding the series using the ts function is bevtemp-ts(bevtemp,deltat=0.084) where 0.084 is 2 hours/24 hours. I am wondering if this is the correct way to code the data? Thanks for your help. Gary Nelson. * Gary A. Nelson Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Automatic rounding of values after factors , converted to numeric, are multipled by a real number
I am wondering if someone would have any suggestion about my issue? I have the following code: wgts-aggregate(subset(lendata,select=c(Length)),list(lendata$Cruise,len data$Station,lendata$Region,lendata$Total),mean) wgts-wgts[order(wgts$Group.3,wgts$Group.1,wgts$Group.1),] names(wgts)-c(Cruise,Station,Region,Total,MLen) wgts$Total-as.numeric(levels(wgts$Total))[wgts$Total] wgts$swmean-with(wgts,wgts$Total*wgts$MLen) When I run it, I get: Cruise Station Region Total MLen swmean 32350 256 1 2 70.5141 52350 254 1 3 73.3220 62350 287 1 3 65.7197 92350 232 1 4 75.25000301 10 2350 294 1 4 56.0224 12 2350 301 1 5 70.2351 14 2350 316 1 6 67.3404 15 2350 255 1 7 55.0385 17 2350 285 1 8 73.5588 19 2350 212 110 57.5575 20 2350 250 110 61.5615 27 2350 221 124 95.29167 2287 33 2350 229 135 55.62857 1947 37 2350 293 147 53.82979 2530 38 2350 203 150 55.54000 2777 39 2350 248 155 63.30909 3482 41 2350 246 163 95.82540 6037 42 2350 265 168 55.54412 3777 43 2350 251 182 62.60976 5134 44 2350 234 185 57.21176 4863 Every value is correct except that the swmeans are rounded and I can't get values with the decimals fractions. I have tried as.double and have change the options(digits=7), but nothing seems to work. I have spent several hours combing manuals and archives. Any suggestions would be appreciated. * Gary A. Nelson Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Automatic rounding of values after factors , converted to numeric, are multipled by a real number
Peter, Thank you for your response. I knew how close the values are to integers, but I still don't understand why I don't have control over how the numbers are displayed (rounded or not)? Thanks again, Gary Nelson. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Dalgaard Sent: Wednesday, October 19, 2005 3:45 PM To: Nelson, Gary (FWE) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Automatic rounding of values after factors , converted to numeric, are multipled by a real number Nelson, Gary (FWE) [EMAIL PROTECTED] writes: I am wondering if someone would have any suggestion about my issue? I have the following code: wgts-aggregate(subset(lendata,select=c(Length)),list(lendata$Cruise,l en data$Station,lendata$Region,lendata$Total),mean) wgts-wgts[order(wgts$Group.3,wgts$Group.1,wgts$Group.1),] names(wgts)-c(Cruise,Station,Region,Total,MLen) wgts$Total-as.numeric(levels(wgts$Total))[wgts$Total] wgts$swmean-with(wgts,wgts$Total*wgts$MLen) When I run it, I get: Cruise Station Region Total MLen swmean 32350 256 1 2 70.5141 52350 254 1 3 73.3220 62350 287 1 3 65.7197 92350 232 1 4 75.25000301 10 2350 294 1 4 56.0224 12 2350 301 1 5 70.2351 14 2350 316 1 6 67.3404 15 2350 255 1 7 55.0385 17 2350 285 1 8 73.5588 19 2350 212 110 57.5575 20 2350 250 110 61.5615 27 2350 221 124 95.29167 2287 33 2350 229 135 55.62857 1947 37 2350 293 147 53.82979 2530 38 2350 203 150 55.54000 2777 39 2350 248 155 63.30909 3482 41 2350 246 163 95.82540 6037 42 2350 265 168 55.54412 3777 43 2350 251 182 62.60976 5134 44 2350 234 185 57.21176 4863 Every value is correct except that the swmeans are rounded and I can't get values with the decimals fractions. I have tried as.double and have change the options(digits=7), but nothing seems to work. I have spent several hours combing manuals and archives. as far as I can see, the issue is that Total*MLen just *are* pretty close to being integers, e.g. 4863/85 [1] 57.21176 z - x$Total*x$MLen z - round(z) [1] 0.0 -0.1 0.1 0.0 0.0 0.0 -0.2 0.0 [9] 0.0 0.0 0.0 0.8 -0.5 0.00013 0.0 -0.5 [17] 0.00020 0.00016 0.00032 -0.00040 -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Help with downloading clim.pact
I am wondering if anyone might know why the package clim.pact won't install properly. I have tried many URL sites and the same thing happens. I get the error message below. I also tried downloading the ZIP from the CRAN site and extracting the file myself, but an error message (something like, not an archive file) appears. I operate through Windows. Thanks. Gary Nelson. ** trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.2/clim.pact_2.2-0.zi p' Content type 'application/zip' length 5857349 bytes opened URL downloaded 2525Kb Error in gzfile(file, r) : unable to open connection In addition: Warning messages: 1: downloaded length 2586064 != reported length 5857349 2: error 1 in extracting from zip file 3: cannot open compressed file 'clim.pact/DESCRIPTION' version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major2 minor2.0 year 2005 month10 day 06 svn rev 35749 language R * Gary A. Nelson, Ph.D Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R programming question
Dear All., I've created R-code for which a user will be asked to choose between 2 analyses. I've written one function for each type of analysis. Within each function, the users is prompted to enter information. An example is: cat(Enter value for lower Linf :\n) L1-scan(n=1) cat(Enter value for upper Linf :\n) L2-scan(n=1) cat(Enter Linf interval :\n) int_L-scan(n=1) cat(Enter value for lower K :\n) K1-scan(n=1) cat(Enter value for upper K :\n) K2-scan(n=1) cat(Enter K interval :\n) int_K-scan(n=1) I thought I could evaluate and run the appropriate function at the end of the program by: if(event==1) explore() else evaluate() If I run the whole program and either explore() or evaluate() is run, the first four prompted entries are skipped over. The console output for event==1 is TRUE looks like: if(event==1) explore() else evaluate() Enter value for lower Linf : 1: Read 0 items Enter value for upper Linf : 1: Read 0 items Enter Linf interval : 1: Read 0 items Enter value for lower K : 1: Read 0 items Enter value for upper K : 1: I then tried another way. I created runcase-ifelse(event==1,explore,evaluate) At the bottom of the program I used: eval(call(x=runcase)) But I still get the same problem. Any suggestions? Thanks for your help Gary A. Nelson, Ph.D Massachusetts Division of Marine Fisheries 30 Emerson Avenue Gloucester, MA 01930 Phone: (978) 282-0308 x114 Fax: (617) 727-3337 Email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.