Saturday 19 August 2017

Port Magic Corrupt Binary Options


Bochs Bochs é um emulador que está melhorando constantemente para a plataforma x86. Ele melhora muito o desenvolvimento do sistema operacional porque a máquina virtual reinicia muito mais rápido que o hardware real, além de oferecer funcionalidade de depuração detalhada que pode ajudar muito durante o desenvolvimento do kernel. É fortemente sugerido para obter duas instalações do Bochs - além da versão out-of-the-box (que pode muito bem ser um dos downloads binários), você também deve compilar uma segunda instância com o depurador interno habilitado - então quando Algo estranho ocorre que suas ferramentas de depuração normais não podem rastrear, você pode verificar com a versão de depuração. Você também pode habilitar (e usar) as portas de E / S de depuração. Conteúdo Mensagens de erro freqüentes Executando em memória falsa Você enviou seu ponteiro de código (EIP) para alguma área de memória não inicializada. Isso significa que você ou seguiu um ponteiro NULL (ou não inicializado), ou você danificou o endereço de retorno do quadro da pilha. Faça o seu código mais limpo, ponteiros de teste antes de segui-los, inicializar todos os ponteiros (especialmente aqueles que estão na pilha) e ativar - Wall no GCC. 3ª exceção, sem resolução A CPU não conseguiu invocar um manipulador de exceções e normalmente triplicaria a falha. Isso provavelmente se deve a um conteúdo de registro IDT incorreto ou a um descritor IDT incorreto. Às vezes (mas menos provável), ele também pode ser devido a um erro grave no código do manipulador de exceção. Verifique se a sua exceção funciona com instruções de ASM ilegais como idiv 0. Ou Em vários casos, existem outras mensagens de erro anteriores a este que pode fornecer mais detalhes no erro. Algumas mensagens comuns que podem ser exibidas: interrupt (): gate descriptor não é válido sys seg Você não carregou um IDT, ou o IDT é corrompido interrupt (): SS selector null Você não tem TSS Você não configurou SS0 / ESP0 no TSS CR0 0xe0000001 CR2 0xe0000001 Suas tabelas de página não são alinhadas em página Suas tabelas de página não apontam para as partes corretas de memória E / S Operando Tamanho O Bochs executa algumas verificações bastante paranóicas no tamanho do operando de E / S. Ler um byte da porta 0x1234 geralmente não é a mesma coisa que ler um valor de 32 bits. Volte para a sua ficha de dados de chips e verifique novamente que seus tamanhos estão corretos. Fetchrawdescriptor: LDTR. valid0 Muitos de vocês disseram mas. Eu não tenho um LDT e eu li que não era obrigatório. Você está certo. E o mesmo acontece com Bochs. Esta mensagem normalmente significa que o programa tentou carregar um seletor com algum valor de lixo, que aconteceu para ter o bit 3 (Indicador de tabela) definido. A CPU tentará procurar o descritor no LDT, mas não há LDT registrado. Na maioria dos casos, o erro vem de alguns mispairing de push e pop na pilha, que levam a um valor não-selector a ser carregado em um segmento Registrar. Se você ainda está preso, baixe o pacote fonte do Bochs e pesquise a mensagem que recebeu. Então, talvez você possa adicionar informações adicionais ao código de impressão de mensagens (como o deslocamento defeituoso de um segfault, o limite de segmento, etc.). Mas evite modificar as operações de Bochs Sempre que suspeitava de um bug no Bochs, eu estava mal interpretando o Manual Intel. Diferenças entre Bochs e hardware real Bochs habilita a linha A20 no BIOS Seu PC não necessariamente o faz. Às vezes há uma opção do BIOS, às vezes não há. Verifique o código que ativa a linha A20 e verifique se ele não tem problemas com hardware mais rápido. Bochs limpa sua memória Em Bochs, a memória é sempre preenchida com zero até que você (ou a BIOS) coloque outra coisa. Em um PC normal, a memória não inicializada tende a conter lixo (na maioria das vezes, all-ones) ou vestígios de execuções anteriores. Verifique seus ponteiros, inicialize-os, imprima seu código no papel, se necessário. Bochs não emula corretamente cache de CPU / TLB Embora Bochs tem essas construções, eles não funcionam o mesmo que um cache de CPU normal ou TLB e não mudam com base em qual CPU está sendo emulada. Se você não estiver tratando o cache ou o TLB for atualizado corretamente, o comportamento pode diferir no Bochs vs. hardware (isto é, pode funcionar no Bochs, mas não no hardware ou vice-versa). Bochs disquete não tem erros Em um PC físico, é comum emitir até 3 comandos de leitura em um setor / faixa antes que ele possa ser lido muito bem. Se você não tem a verificação / recuperação de erro apropriadas em seu bootsector, você é provável funcionar algo que não é seu kernel. Bochs é flexível sobre retornar ao modo real Apesar do que afirma o tutorial do modo protegido Chris Gieses, você não precisa estar no modo protegido de 16 bits para limpar o bit PE do CR0. Se você não entrar no modo protegido de 16 bits em um PC real, ele irá travar, sem dar qualquer indicação de erro - nenhuma falha tripla ou qualquer coisa Timer Bochs não é tempo real (a menos que você configurá-lo mais perto de tempo real). Esperando por 2 segundos em bochs vai deixar qualquer dispositivo virtual que precisa de 2 segundos para estar pronto estar pronto, mas isso poderia ser apenas 0,02 segundos para você. Ou que poderia ser de 200 segundos. Irá causar interrupções em intervalos reais, mas pode sobrecarregar o sistema operacional emulado com interrupções PIT e estouro da pilha (se o seu pré-empty) Usando syncslowdown também irá configurá-lo para velocidades em tempo real, mas com uma quantidade constante de ciclos de relógio virtual entre cada Virtual segundo. Tanto para a desaceleração como para o relógio original, é necessário definir a quantidade de instruções executadas por segundo para o valor desejado. CPU é sempre Intel / AMD Bochs emula uma CPU, então CPUID sempre relatório de volta Intel (se emulando um sistema de 32 bits) ou AMD (se emulando um sistema de 64 bits), independentemente do que está realmente em seu sistema. As versões mais recentes do Bochs permitem que você especifique a seqüência do fornecedor na tag CPU: Arquivos de imagem do Bochs em poucas palavras Para usar o Bochs para inicializar o kernel personalizado, procure as linhas floppya e de inicialização no arquivo de configuração do bochsrc. A seguinte configuração permite que você use e inicialize a partir da unidade de disquete real do seu computador: Para usuários do Windows, isso deve ler: Mas isso é muito lento e coloca muito estresse no disquete quando você está em um patch apertado - Make - boot ciclo. Bochs oferece o uso de arquivos de imagem, incluindo uma ferramenta interativa para criar um arquivo de imagem (bximage. exe). Observe que o Bochs irá emular os internos do floppys mesmo quando a imagem for um dispositivo em vez de um arquivo regular. Instalações de depuração do Bochs O Bochs possui vários recursos que facilitam a depuração. Muitos deles devem ser habilitados através de um switch de configuração: depurador GUI Bochs tem um depurador interno de linha de comando, e uma interface gráfica em cima dela. Você deve compilar Bochs com a opção de configuração e, em seguida, editar o arquivo bochsrc para habilitar o depurador GUI. Eu uso esta linha no meu arquivo bochsrc para habilitar a depuração gráfica em X: Em um ambiente Windows, adicione esta linha ao seu bochsrc. bxrc Parece que no Windows, o sinalizador de opção (o que a linha acima usada para ler) será aceito, Mas a janela GUI não aparecerá. Macros de depurador de I / O Algumas macros úteis quando o Bochs é compilado com as portas de depuração de E / S habilitadas (porte9hack: enabled1 se Bochs 2.4 ou mais recente, configure --port-e9-hack se não): Magic Breakpoint Quando você está usando Bochs com o Depurador interno. Você pode disparar o depurador através de uma facilidade chamada pontos de interrupção mágicos. Para acionar um ponto de interrupção, você pode inserir xchg bx, bx (na sintaxe GAS, xchgw160bx, 160bx) em qualquer parte do código e o Bochs entrará no depurador assim que o executar. No hardware real isto não tem efeito, uma vez que apenas substitui o registro BX consigo mesmo. Você deve colocar a seguinte linha no arquivo de configuração do Bochs para que ele escute pontos de interrupção mágicos: Em versões mais antigas, habilitar o depurador sozinho não compilar no suporte ao ponto de interrupção mágico, você também precisará especificar --enable-magic-breakpoint ao configurar o Construir sobre essas versões. Depurando SMP Ao usar o depurador interno, você pode usar o seguinte comando para alternar CPUs: Eu também achei que isso era necessário ocasionalmente no depurador GUI, mesmo que tenha botões para cada CPU. Comandos do depurador interno Você pode passar um arquivo contendo comandos de depuração para executar automaticamente sempre que você iniciar bochs com o depurador interno. (Bochs - rc ltfilegt) O Bochs coloca um ponto de interrupção automático imediatamente antes da carga do BIOS, o que pode ser ignorado automaticamente colocando continuar como o primeiro comando no referido arquivo. Depuração de Falhas Triplas Ao usar o depurador interno, você pode alterar essa linha no arquivo de configuração do Bochs: Esta linha desabilita a redefinição do emulador em uma Falha Tripla, permitindo que você depure o código após uma Falha Tripla ocorrida. (Muito útil ao implementar a paginação). Compilando bochs de fonte Bochs tem muitas opções de configuração de tempo de compilação, alguns dos quais conflito e, portanto, uma distribuição binária de Bochs pode não ser adequado para seus propósitos. Eu achei que era melhor compilar minha própria cópia de Bochs para ter certeza que eu tinha as características que eu precisava. Além disso, você deve considerar usar a versão de instantâneo do CVS do Bochs se a versão lançada for antiga e não funcionar para você. Achei que isso era necessário até a versão 2.4 foi lançado, por exemplo. No Ubuntu, você pode ter que correr e digitar sua senha. Em outras distribuições linux, tente o equivalente. A matriz de opções de configuração Bochs pode ser confusa, e você não pode assumir que os padrões são sensíveis. Estas são as opções que eu uso, isso pode começar: Se você estiver no Windows, essa última linha deve provavelmente ler --with-win32. No Linux, usando SDL como a biblioteca de exibição sobre X11 é preferível como o desempenho parece aumentar muito em algumas configurações Bochs tem suporte de stub GDB e seu próprio depurador interno. Estes não podem ser compilados no mesmo binário Bochs. O depurador interno é muito útil, seu sinalizador é --enable-debugger O stub do GDB no Bochs não suporta SMP, última vez que eu verifiquei. Se você não habilitar PCI, as tabelas de multiprocessamento Intel não aparecerão na memória. Não consegui carregar com êxito o depurador GUI sem especificar --disable-plugins. Caso contrário, recebo erros de símbolo de carregamento dinâmico. Posterior a 2.4.2, várias das opções específicas da CPU foram dobradas para a especificação de nível de CPU e, portanto, estão obsoletas. Eles foram removidos do exemplo acima. A compilação padrão não suporta x86-64, --enable-x86-64 irá ativá-lo Em muitas distribuições do Linux é possível instalar o Bochs através de um gerenciador de pacotes. Por exemplo, em distribuições que usam apt-get podemos fazer para instalar o Bochs eo plugin X11 (que pode falhar no ubuntu / linux mint: instale o plugin sdl e use sdl em vez de x como a biblioteca de exibição neste caso). Observe que existe uma grande chance de que o depurador gráfico não esteja habilitado nos binários do gerenciador de pacotes. Ver também Artigos Links externos: Port Magic ok, um dia eu liguei o meu computador e, em seguida, no XP destop eu tenho isso: (btw porta mágica veio com minha dell dimention 2400) Port Magic - Corrupt Binary Os arquivos executáveis ​​na porta mágica ar Corrompido por favor reinstalar ok, então eu fui para o site magics porta e baixou o trilho de 14 dias de magia portuária em um exe, correu e ele instalado. Mas, quando eu tento clicar nele eu recebo a mesma mensagem, e na inicialização eu recebo a mesma mensagem. O que estou fazendo errado AOL deixa de me deixar usar o serviço depois de um tempo becuase ele não pode estabelecer uma conexão direta e eu não posso executar jogos on-line por tanto tempo ou itll crash ou log me off. Você já instalou os mais recentes AOL 9 Security Edition CDs grátis em todos os lugares. Além disso, vá para seus programas de inicialização, desativar a magia de porta de iniciar com o Windows. Em seguida, remova todos os vestígios dele do seu PC (incluindo o registro, se houver), em seguida, tente reinstalá-lo a partir do zero. Tente transferi-lo de aqui também. RIO-AU VS BHP-AU 2.25438 01:00 06.10 NZD / USD 0.71612 01:00 06.10 AUD / NZD 1.06289 01:00 06.10 EUR / AUD 1.47177 01:00 06.10 CAD / JPY 78.505 01: 00 06.10 AUD / USD 0.76114 01:00 06.10 AUD / JPY 78.752 01:00 06.10 KOSPI 2061.14 01:00 06.10 BHP-AU 23.135 01:00 06.10 RIO-AU 52.155 01:00 06.10 BANCO ANZ 28.200 01:00 06.10 ASX F - DEC16 5453.500 01:00 06.10 ASX 5471.800 01:00 06.10 EUR / JPY 115.906 01:00 06.10 USD / JPY 103.466 01:00 06.10 EUR / USD 1.12026 01:00 06.10 AUD / CHF 0.74178 01:00 06.10 NZD / USD 0.71663 00: 30 06,10 NZD / USD 0,71706 00:00 06,10 AUD / NZD 1,06266 00:00 06,10 EUR / AUD 1,47053 00:00 06,10 CAD / JPY 78,504 00:00 06,10 NZD / JPY 74,179 00:00 06,10 AUD / USD 0,76201 00:00 06,10 AUD / JPY 78.831 00:00 06.10 EUR / JPY 115.926 00:00 06.10 USD / JPY 103.452 00:00 06.10 EUR / USD 1.12060 00:00 06.10 EUR / AUD 1.47111 23:30 05.10 NZD / JPY 74.178 23:30 05.10 TRADE FOREX . STOCKS. ÍNDICES E MERCADORIAS COMÉRCIO FOREX, STOCKS, INDICES MERCADORIAS Até 88 RETORNO POR ÚNICO COMÉRCIO Premiado Binary Broker Real-Time Mobile Desktop Trading Robusto Análise Técnica Ferramentas INICIAR COMERCIALIZAÇÃO AGORA COM AS MENOS DE 100 APOIO E FERRAMENTAS PARA SEU SUCESSO JUNTE-SE AGORA PROFISSIONAIS Para 88 Retorno Por Comércio Único. Academia e Centro de Aprendizagem-FREE Welcome Re Depósito BonusesUSB Entradas do Registro do Dispositivo Este tópico descreve as entradas de registro específicas do dispositivo. Localizar informações sobre o dispositivo depois de enumerar no Windows Exibir a interface do dispositivo GUID, Id de hardware e informações de classe de dispositivo sobre o dispositivo Encontre esta chave de registro e observe o valor DeviceInstance: Localize a chave de registro de instância do dispositivo e obtenha a interface do dispositivo GUID: HKEYLOCALMACHINESYSTEMCurrentControlSetEnumUSBlthardware idgtltinstance idgtDevice Parâmetros Sob a chave de instância do dispositivo, observe os códigos de classe, subclasse e protocolo do dispositivo: Configurações do registro para configurar o comportamento da pilha do driver USB As entradas de registro descritas neste tópico encontram-se nessa chave: vvvv é um número hexadecimal de 4 dígitos que identifica o Fornecedor pppp é um número hexadecimal de 4 dígitos que identifica o produto rrrr é um número hexadecimal de 4 dígitos que contém o número de revisão do dispositivo. Os valores de ID de fornecedor, ID de produto e número de revisão são obtidos a partir do descritor de dispositivo USB. A tabela a seguir descreve as possíveis entradas de registro para a chave vvvpppprrrrr. A pilha de driver USB considera essas entradas como somente leitura values. R para Windows FAQ Esta FAQ é para a porta do Windows de R: descreve recursos específicos para essa versão. O principal R FAQ pode ser encontrado em As informações aqui se aplica apenas às versões recentes do R para Windows, (lsquo 3.1.0 rsquo ou posterior). Ele é tendencioso para os usuários do Windows de 64 bits. 2 Instalação e Uso 2.1 Onde posso encontrar a versão mais recente Vá para qualquer site CRAN (veja cran. r-project. org/mirrors para uma lista), navegue até o diretório bin / windows / base e colete o (s) arquivo (s) que você necessidade. A versão atual é distribuída como um instalador lsquo R-3.3.1-win. exe rsquo de cerca de 65MB. Há também links nessa página para o rsquo lsquo r-patched e lsquo r-devel rsquo snapshots. Esses são versões atualizadas com freqüência de versões de desenvolvimento do R. O rsquo lsquo r-patched rsquo inclui correções de bugs para a versão atual, e lsquo r-devel rsquo contém estes, bem como as mudanças que estão planejadas para eventualmente torná-lo na lsquo xy seguinte 0 rsquo liberação. 2.2 Como instalar o R ​​para Windows As versões binárias atuais do R são executadas no Windows XP ou posterior, inclusive em versões de 64 bits: Consulte Posso usar R no Windows de 64 bits. A última versão conhecida para ser executada no Windows 2000 foi 2.12.2. Somente testamos em versões do Windows atualmente suportadas pela Microsoft, principalmente o Windows 7 e Server 2008 de 64 bits. Seu sistema de arquivos deve permitir nomes de arquivos longos que honrem os casos (como é provável, exceto talvez alguns sistemas montados em rede). Uma instalação leva até 150MB de espaço em disco. Se você quiser ser capaz de criar pacotes de fontes, recomendamos que você escolha um caminho de instalação que não contenha espaços. Usuários do Vista / Windows 7/8 / Server 2008/2012 instalando para um único usuário usando uma conta com direitos de administrador 1 deve considerar a instalação em um ambiente não - Área do sistema (tal como C: R). A instalação em um compartilhamento de rede (um caminho de arquivo que começa com a máquina.) Não é suportada: esses caminhos precisarão ser mapeados para uma unidade de rede. Para instalar use lsquo R-3.3.1-win. exe rsquo. Basta clicar duas vezes no ícone e seguir as instruções. Se você tem uma conta com privilégios de Administrador, poderá instalar R na área Arquivos de Programas e definir todas as entradas de registro opcionais, caso contrário você só poderá instalar R em sua própria área de arquivos. Talvez seja necessário confirmar que você deseja continuar com a instalação de um programa de um editor lsquounknownrsquo ou lsquounidentifiedrsquo. Após a instalação você deve escolher um diretório de trabalho para R. Você terá um atalho para Rgui. exe no seu desktop e / ou em algum lugar na árvore de arquivos do menu Iniciar e talvez também na parte de Inicialização Rápida da barra de tarefas (Vista e anteriores) . Clique com o botão direito do mouse em cada atalho e selecione Propriedades. E altere o campo inrsquo lsquoStart para o diretório de trabalho. (Se sua conta não foi a usada para a instalação, talvez seja necessário copiar o atalho antes de editá-lo.) Em alguns sistemas, você terá dois atalhos, um para 32 bits com um rótulo iniciando R i386 e outro para 64 bits A partir de R x64 (consulte Deveria executar 32 bits ou 64 bits R) Você também pode querer adicionar argumentos de linha de comando no final do campo Alvo (após qualquer citação dupla final e separados por um espaço), por exemplo --sdi --max-mem-size1G. Você também pode definir variáveis ​​de ambiente no final do campo Destino, por exemplo RLIBSp: / myRlib. E se você quiser garantir que os menus e as mensagens estejam no (americano) inglês, LANGUAGEen. Também é possível instalar a partir de um arquivo MSI, que será de interesse apenas para administradores de sistema. Para saber como construir o arquivo MSI, consulte o Manual de Instalação e Administração lsquoR. 2.3 Como verificar se uma instalação não está corrompida Relaciona-se com instaladores anteriores, removidos em R 2.11.0. 2.4 Posso personalizar a instalação A maneira normal de personalizar a instalação é selecionando componentes dos assistentes mostrados pelo instalador. No entanto, sysadmins pode gostar de instalar R a partir de scripts e os seguintes sinalizadores de linha de comando estão disponíveis para uso com o instalador. Lsquo / SILENT rsquo mostram apenas a janela de progresso da instalação e mensagens de erro. Lsquo / VERYSILENT rsquo mostram apenas mensagens de erro. Lsquo / DIRquotx: dirnamequot rsquo defina o diretório de instalação padrão lsquo / GROUPquotfolder namequot rsquo defina o nome de grupo padrão do menu Iniciar lsquo / COMPONENTSquotcomma lista separada de nomes de componentesquot rsquo definir a lista inicial de componentes: Os componentes são chamados lsquo main rsquo, lsquo i386 rsquo , Lsquo x64 rsquo e lsquo traduções rsquo. Também é possível salvar as configurações usadas para um arquivo e mais tarde recarregar essas configurações usando lsquo / SAVEINFquotfilenamequot rsquo salvar as configurações para o arquivo especificado. Não se esqueça de usar as aspas se o nome do arquivo contiver espaços. Lsquo / LOADINFquotfilenamequot rsquo instrui o instalador a carregar as configurações do arquivo especificado depois de verificar a linha de comando. Uma instalação bem-sucedida tem o código de saída 0: os mal-sucedidos podem fornecer 1, 2, 3, 4 ou 5. Consulte a ajuda para o Inno Setup (jrsoftware. org/) para obter detalhes. Temos algumas facilidades para construir um instalador personalizado, em particular para adicionar pacotes ao instalador. Consulte o manual de Instalação e Administração do lsquoR na subseção lsquoConstruindo os instaladores. 2.5 Como faço para executá-lo Basta clicar duas vezes no atalho que você preparou na instalação. Se você quiser configurar outro projeto, faça um novo atalho ou use o existente e altere o campo lsquoStart inrsquo das Propriedades. Você pode, se preferir executar R a partir da linha de comando de qualquer shell que você usa, por exemplo um lsquoCommand Promptrsquo ou uma porta de um shell Unix como tcsh ou bash. (A linha de comando pode ser qualquer coisa que você colocaria no campo Destino de um atalho e o diretório inicial será o diretório de trabalho atual do shell.) Note que os executáveis ​​R não são adicionados por padrão ao PATH. Um terminal geralmente preferem executar Rterm. exe e não Rgui. exe. 2.6 Posso executar R a partir de um CD ou unidade USB Sim, com cuidado. Uma instalação R básica é relocável, para que você possa gravar uma imagem da instalação R no disco rígido ou instalar diretamente em um dispositivo de armazenamento removível, como uma unidade USB de memória flash. Executando R precisa acessar um diretório temporário gravável e um diretório home e, em última instância, eles são considerados como o diretório atual. Isso não deve ser problema em uma versão corretamente configurada do Windows, mas caso contrário significa que pode não ser possível executar R sem criar um atalho iniciando em uma pasta gravável. 2.7 Como desinstalar R Normalmente, você pode fazer isso a partir do grupo lsquo Programas e Recursos rsquo no Painel de Controle. Se ele não aparecer lá, execute unins000.exe no diretório de instalação de nível superior. Nas versões recentes do Windows, você pode ser solicitado a confirmar que deseja executar um programa de um editor lsquounknownrsquo ou lsquounidentifiedrsquo. Desinstalando R somente remove arquivos da instalação inicial, não (por exemplo) pacotes que você instalou ou atualizou. Se tudo mais falhar, você pode simplesmente excluir todo o diretório em que R foi instalado. 2.8 Whatrsquos a melhor maneira de atualizar Thatrsquos uma questão de gosto. Para a maioria das pessoas a melhor coisa a fazer é desinstalar R (ver o Q anterior), instalar a nova versão, copiar quaisquer pacotes instalados para a pasta da biblioteca na nova instalação, executar update. packages (checkBuiltTRUE, askFALSE) no novo R E, em seguida, elimine qualquer coisa deixada da instalação antiga. Diferentes versões de R são bastante deliberadamente instalado em pastas paralelas para que você possa manter velhas versões ao redor se você desejar. Para aqueles com uma biblioteca pessoal (pasta Rwin-library xy do seu diretório home, Rwin64-library xy em compilações de 64 bits), você precisará atualizar isso também quando a versão menor de R for alterada (por exemplo, de 3.0.2 para 3.1 .0). Uma maneira simples de fazer isso é copiar (digamos) Rwin-library3.0 para Rwin-library3.1 antes de executar update. packages (checkBuiltTRUE, askFALSE). 2.9 Parece haver um limite na memória que ele usa. Na verdade, existe. Ele é definido pelo sinalizador de linha de comando --max-mem-size (consulte Como instalar o R ​​para Windows) ou pela variável de ambiente RMAXMEMSIZE. Para uma compilação de 64 bits de R, o padrão é a quantidade de RAM. Para uma compilação de 32 bits de R, o padrão é o menor da quantidade de RAM física na máquina e 0,5 GB a menos do que o limite na memória virtual do usuário para um processo (na maioria das vezes 2 GB ao usar uma edição de 32 bits do Windows) . Use Memory e memory. size para obter informações sobre o uso da memória. O limite pode ser aumentado (se possível) chamando memory. limit dentro de uma sessão R em execução. Os executáveis ​​de 32 bits suportam até 3 GB de espaço de endereço de usuário por processo em versões apropriadamente habilitadas do Windows de 32 bits (consulte www. microsoft/whdc/system/platform/server/PAE/PAEmem. mspx. Msdn. microsoft/en - Us / library / bb61347328VS.8529.aspx isso não está ativado por padrão). Em tais sistemas, o padrão para --max-mem-size é o menor da quantidade de RAM e 2.5GB. Em todas as versões anteriores de 64 bits do Windows, o espaço de endereço do usuário para um processo de 32 bits é de 4 GB e o padrão para - max-mem-size é o menor da quantidade de RAM e 3,5 GB. 2.10 Como posso manter áreas de trabalho para diferentes projetos em diferentes diretórios Crie um atalho separado para cada projeto: consulte Q2.5. Todos os caminhos para arquivos usados ​​por R são relativos ao diretório inicial, portanto, definir o campo inrsquo lsquoStart automaticamente ajuda a separar projetos. Como alternativa, inicie R clicando duas vezes em um arquivo. RData salvo no diretório do projeto que você deseja usar ou arraste e solte um arquivo com extensão. RData em um atalho R. Em ambos os casos, o diretório de trabalho será definido para aquele que contém o arquivo. 2.11 Como faço para imprimir a partir de R Depende do que você quer imprimir. Você pode imprimir a janela de gráficos do seu menu ou usando dev. print com argumentos adequados (veja sua página de ajuda: provavelmente dev. print (win. graph) funcionará). Você pode imprimir a partir do console R ou pager por lsquo File Print rsquo. (Isso irá imprimir a seleção se houver uma, caso contrário, todo o conteúdo console ou pager.) Você pode imprimir arquivos de ajuda do pager ou navegador HTML. Se você tiver o LaTeX instalado e um sistema de impressão PDF você pode imprimir arquivos de ajuda por ajuda (fnname, helptypequotPDFquot). 2.12 Posso usar R CMD BATCH Sim: use R CMD BATCH --help ou BATCH para maiores detalhes. Você também pode configurar um arquivo em lotes usando Rterm. exe. Um arquivo de lote de exemplo pode conter (como uma linha) O objetivo de 2gtamp1 é redirecionar avisos e erros para o mesmo arquivo como saída normal. 2.13 Posso usar R-3.3.1 com ESS e Emacs Sim. ESS tem há muito tempo suportado R sob o Windows: ele faz isso executando Rterm. exe sem um console visível. Para obter ajuda com ESS, envie um email para ESS-helpstat. ethz. ch. Não as listas de discussão R. 2.14 O que são HOME e diretórios de trabalho Vários lugares na documentação usam esses termos. O diretório de trabalho é o diretório a partir do qual Rgui ou Rterm foi iniciado, a menos que um atalho foi usado quando é dado pelo campo inrsquo lsquoStart das propriedades shortcutrsquos. Você pode encontrar isto a partir do código R pela chamada getwd (). O directório base é definido da seguinte forma: Se a variável de ambiente RUSER estiver definida, o respectivo valor é utilizado. Caso contrário, se a variável de ambiente HOME estiver definida, o seu valor será utilizado. Após essas duas configurações controláveis ​​pelo usuário, R tenta encontrar diretórios base definidos pelo sistema. Ele primeiro tenta usar o diretório quotpersonalquot do Windows (normalmente C: UsersusernameDocuments). Se isso falhar, se as variáveis ​​de ambiente HOMEDRIVE e HOMEPATH estiverem definidas (e normalmente são), o valor é. Se todos esses falharem, o diretório de trabalho atual será usado. Você pode encontrar isto a partir do código R por Sys. getenv (quotRUSERquot) ou normalizePath (quot rsquo sendo notação Unix para o diretório home 2.15 Como definir variáveis ​​de ambiente Variáveis ​​de ambiente podem ser definidas para Rgui. exe e Rterm. exe em três diferentes Por exemplo, no atalho para Rgui você poderia ter Em um arquivo de ambiente. Renviron no diretório de trabalho ou em seu diretório pessoal, por exemplo, contendo a linha Se você tem permissão para fazê-lo, você pode Também criar um arquivo de ambiente etcRenviron. site e definir variáveis ​​ambientais nesse arquivo da mesma maneira. Esto é útil para as variáveis ​​que devem ser definidas para todos os usuários e todos os usos desta instalação R (seus valores podem ser substituídos em um. Renviron Arquivo ou na linha de comando.) Consulte Startup para obter mais detalhes de arquivos de ambiente. Para todas as aplicações via Windows. Como você definir uma variável de ambiente é específico do sistema: em versões recentes do Windows, vá para lsquoUser Accountsrsquo no Painel de controle e Selecione sua conta e, em seguida, lsquoChange my ambiente variablesrsquo. A ordem de precedência para variáveis ​​ambientais é a ordem em que essas opções estão listadas, que é a linha de comando então. Renviron, em seguida, o ambiente herdado. 2.16 R canrsquot encontrar o meu arquivo, mas eu sei que ele está lá Como você especificá-lo Backslashes tem que ser dobrado em R caracteres de caracteres, por isso, por exemplo, é necessário lsquo quotd: R-3.3.1libraryxgobiscriptsxgobi. batquot rsquo. Você pode tornar a vida mais fácil para si mesmo, usando barras para a frente como separadores de caminho: eles funcionam em Windows. Você deve incluir a extensão de arquivo (por exemplo, lsquo quotxgobi. batquot rsquo em vez de apenas lsquo quotxgobiquot rsquo) às vezes isso não é mostrado no Windows Explorer, mas é necessário em R. Uma maneira simples de evitar esses problemas é usar a função file. choose () Para invocar a caixa de diálogo padrão de seleção de arquivos do Windows. Se você selecionar um arquivo, o nome será passado para R no formato correto. Outra possível fonte de luto são os espaços em nomes de pastas. Tentamos fazer R trabalhar em caminhos com espaços, mas muitas pessoas escrevendo pacotes para Unix não se incomodam. Portanto, vale a pena tentar o nome curto alternativo (algo como lsquo PROGRA 1 rsquo você pode obtê-lo como o lsquoMS-DOS namersquo das propriedades do arquivo em algumas versões do Windows e de dir / X em uma lsquo prompt de comando rsquo janela ), E usando a função shortPathName do código R. 2.17 R usa o Registro Não quando o próprio R está em execução. Quando você executa o instalador R, há opções (em lsquo Selecionar Tarefas Adicionais rsquo) para lsquo Salvar o número da versão no rsquo do registro e (para instalações do Administrador) lsquo Associate R com. Rdata files rsquo. Se você marcar a primeira opção, as seguintes entradas de seqüência de caracteres são adicionadas ao registro do Windows: HKEYLOCALMACHINESoftwareR-coreRCurrent Version contém o número da versão, atualmente 3.3.1. HKEYLOCALMACHINESoftwareR-coreRversionInstallPath (onde versão está atualmente 3.3.1) contém o caminho para o diretório ra home. Se você não tiver privilégios administrativos na máquina durante a execução do instalador, as entradas serão criadas em HKEYCURRENTUSER. As mesmas entradas também são criadas em SoftwareR-coreR32 ou SoftwareR-coreR64. Para 32 e 64 bits, respectivamente. Se você marcar a segunda opção (mostrada apenas com privilégios administrativos) (lsquo Associate R com arquivos. RData rsquo), as entradas serão criadas em HKEYCLASSESROOT. RData e HKEYCLASSESROOTRWorkspace. Após a instalação, você pode adicionar as entradas do Registro executando RSetReg. exe em uma subpasta da pasta bin e removê-las executando-as com argumento / U. Observe que isso requer privilégios administrativos, a menos que seja executado com o argumento / Pessoal e nem configure nem remova as associações de arquivos. 2.18 R suporta automação (OLE, COM) Diretamente, não. Veja pacotes como o RDCOMClient do Omegahat (pacotes fonte e binários disponíveis em www. stats. ox. ac. uk/pub/RWin/) eo projeto não-Free em www. statconn /. 2.19 As funções de download da Internet falham. Por exemplo, update. packages () e os itens de menu no menu Pacotes. Nós tivemos vários relatórios sobre isso, embora eles funcionem para nós em todas as nossas máquinas. Existem duas causas possíveis conhecidas. (A) Um proxy precisa ser configurado: consulte download. file. (B) As configurações de firewall estão bloqueando os executáveis ​​R de entrar em contato com a Internet (mas isso deve resultar em mensagens de erro informativas do programa de firewall). 2.20 Inserir certos caracteres trava Rgui. Isso não foi relatado por alguns anos, mas costumava acontecer regularmente. Todas as ocorrências que resolvemos foram rastreadas para versões com falhas do lsquo msvcrt. dll rsquo: instalamos uma solução alternativa que parece evitar isso. Algumas outras pessoas descobriram que isso foi causado por programas de macro de teclado e switcher de desktop, por exemplo lsquoMacro Magicrsquo e lsquoJS Pagerrsquo. 2.21 O que rsquoDLL tentou mudar a palavra de controle FPU wordrsquo mean Este é um aviso que indica que R tomou ação para corrigir a ação de alguma DLL (não-R) que acabou de ser carregada e mudou a palavra de controle de ponto flutuante Código de inicialização) para uma configuração incompatível com o necessário para R. Isso não é uma boa prática por parte da DLL e muitas vezes indica que ele precisa ser atualizado. Infelizmente, como as DLLs podem carregar outras DLLs, não é possível para R rastrear qual DLL causou o problema. Veja também dyn. load. 2.22 Outras estranhas colisões. Alguns usuários descobriram que Rgui. exe falha ao iniciar, saindo com um ldquoFloating-point invalid operationrdquo ou outro erro de baixo nível. This error may also happen in the middle of a session. In some cases where we have tracked this down, it was due to bugs in the video driver on the system in question: it makes changes to the floating point control word which are incompatible with R. (Good practice would restore the control word to the state it was in when the driver code was called, and R tries hard to correct this before running its own code.) For example, one user reported that the virtual screen manager JSP2 caused this crash. These errors are essentially impossible for us to fix or work around beyond the measures already taken. The only solution we know of is for the user to replace the buggy system component that is causing the error. 2.23 Why does R never use more than 50 of my CPU This is a misreading of Windowsrsquo confusing Task Manager. Rrsquos computation is single-threaded, and so it cannot use more than one CPU. What the task manager shows is not the usage in CPUs but the usage as a percentage of the apparent total number of CPUs. We say lsquoapparentrsquo as it treats so-called lsquohyper-threadedrsquo CPUs such as two CPUs per core, and most modern CPUs have at least two cores. You can see how many lsquoCPUrsquos are assumed by looking at the number of graphs of lsquoCPU Usage Historyrsquo on the lsquoPerformancersquo tab of the Windows Task manager. 2.24 Does R run under Windows Vista/7/8/Server 2008 It does. A few issues have been reported that are related to the way accounts and file permissions work. (These are not specifically R issues, but changes in user experiences.) Earlier versions of Windows had user and Administrator accounts, and user accounts could be give administrative privileges (by being added to the local Administrators group) and so write permission over system areas such as c:Program Files. R would be installed either by a user in his own file space or by an account with administrator privileges into a system area. Sysadmins could set policies for user accounts, and you might for example have needed to be a lsquoPower Userrsquo to install software at all. Vista and later normally disable the Administrator account and expect software installation to be done by an account which is in the local Administrator group with lsquoadmin approval modersquo turned on. (The Administrator account by default has it turned off.) Unlike (say) Windows XP, such accounts do not run programs with full administrator privileges, and this is where the issues arise. These OSes have the concept of lsquoover-the-shoulderrsquo credentials: if you are running without full administrator privileges and do something which needs them you may be prompted with one or more security-check dialog boxes, and may be required to provide administrator credentials or confirm that you really want to take that action. Vista and later will report that the R installer has an lsquounidentified publisherrsquo or lsquounknown publisherrsquo and ask if it should be run. System administrators can disable installing applications from non-trusted sources, in which case you will have to persuade them that R is trustworthy, or digitally sign the R installer yourself, or (unless this is also disabled) run the installer from a standard account and install into your own file area. (The same issues apply to the. msi version of the installer.) If you install R as a standard user into your own file space and use it under the same account, there are no known permission issues. If you use the default Administrator account (without lsquoadmin approval modersquo being turned on) and install/update packages (in the system area or elsewhere), no issues are known. If you use an account in the local Administrators group in lsquoadmin approval modersquo (which is the intended norm under these OSes), installation will make use of lsquoover-the-shoulderrsquo credentials. You will run into problems if you try installing (including updating) packages in the main R library. (It would be nice if at that point R could use over-the-shoulder credentials, but they apply to processes as a whole. Vista and later disallow creating. dll files in the system area without credentials.) There are several ways around this. Run R with Administrator privileges in sessions where you want to install packages. (Do so by right-clicking on the R shortcut and selecting rsquoRun as Administratorrsquo.) Transfer ownership of the R installation to the user which installed R. To do so, use the security tab on the lsquo Properties rsquo of the top-level R folder and give lsquoFull Controlrsquo over this directory to the user (not just the Administrator group). Install packages into a different library tree owned by the account used to install R. For an installation to be used by a single user, the simplest way is to make use of a lsquopersonal libraryrsquo: See I dont have permission to write to the R-3.3.1library directory. For a site installation, you can create a site-wide library directory anywhere convenient, and add it to the default package search path for all users via RLIBSSITE in etcRenviron. site. See What are HOME and working directories. There is a standard location for a site library, the site-library directory in the top-level R folder (which you would need to create with full control for the R installation account). This will be used for installation in preference to the main library folder if it exists. This approach will not allow you to update the recommended packages unless you lsquoRun as administratorrsquo: we suggest you use an R session running under Administrator privileges when updating those. Another issue with Vista was that the standard POSIX ways that R uses (e. g. in file. info and file. access ) to look at file permissions no longer work reliably. file. access was re-written to work with Windows NT-based security and the new version seems much more reliable with these OSes (but still not 100 correct). On suitably recent hardware Vista and later can prevent the execution of code from data areas via lsquoData Execution Preventionrsquo (from a tab in System Properties - gt Advanced - gt Performance), and sysadmins can turn this on for all programs. R runs correctly with DEP enabled. 2.25 Quotes donrsquot come out right on the console/terminal/pager. R may make use of directional quotes that are not always rendered correctly by Windows: these are used by default only by Rgui in suitable locales (not Chinese/Japanese/Korean). Whether these are used in R output (from functions sQuote and dQuote ) is controlled by getOption(quotuseFancyQuotesquot) whose default is FALSE except for the Rgui console. There are two potential problems with rendering directional quotes. The first is with running Rterm. in European locales the lsquoWindows Command Promptrsquo is by default set up to use MS-DOS and not Windows default encodings: this can be changed via chcp. with chcp 1252 being appropriate for Western European (including English) locales. The other is that the default raster fonts only include directional single quotes and not directional double quotes (which will probably be rendered as a filled rectangle). Directional quotes will also be used in text help which is normally displayed in Rrsquos internal pager: these may not be rendered correctly in an external pager. They are also used in HTML help, where most browsers use fonts which render them correctly. The font used can affect whether quotes are rendered correctly. The default font in the Rgui console and internal pager is Courier New. which has directional quotes on all the systems we tried. Lucida Console which has elegant glyphs for directional quotes (but seems rather light unless ClearType is in use): Consolas is another font which we often select when ClearType is in use. Non-TrueType fonts such as Courier and FixedSys lack directional double quotes on the systems we tried. There is a related problem with using Sweave output in Rgui. for LaTeX needs to be told about the encoding of directional quotes by including in the LaTeX preamble e. g. (for a Western European locale) or their use suppressed by options(useFancyQuotesFALSE). 2.26 There is no tilde on my keyboard Where tilde does not appear on the main keyboard, it can normally be accessed by pressing AltGr (the right Alt key) plus some other key. This is in Canadian (multilingual), German and Scandinavian layouts, 1 in Eastern Europe, in Portuguese, 4 or 5 in Spanish, / in Francophone Belgian, and so on. You can explore those for your keyboard via the lsquoOn-Screen Keyboardrsquo (under Ease of access on Windows 7). On all Windows versions you should be able to get tilde by holding the down the left Alt key and typing 0126 on the numeric keypad (if you have one), then releasing the Alt key. 2.27 Can I use R on 64-bit Windows The 32-bit build of R for Windows will run on both 32-bit and 64-bit 2 versions of Windows. 64-bit versions of Windows run 32-bit executables under the WOW (Windows on Windows) subsystem: they run in almost exactly the same way as on a 32-bit version of Windows, except that the address limit for the R process is 4GB (rather than 2GB or perhaps 3GB). When R is installed on 64-bit Windows there is the option of installing 32- and/or 64-bit builds: the default is to install both. If you are using the 32-bit build, replace lsquo x64 rsquo by lsquo i386 rsquo in the examples in this FAQ. 2.28 Should I run 32-bit or 64-bit R Obviously, only relevant if you are using 64-bit Windows. For most users we would recommend using the lsquonativersquo build, that is the 32-bit version on 32-bit Windows and the 64-bit version of 64-bit Windows. The advantage of a native 64-bit application is that it gets a 64-bit address space and hence can address far more than 4GB (how much depends on the version of Windows, but in principle 8TB). This allows a single process to take advantage of more than 4GB of RAM (if available) and for Rrsquos memory manager to more easily handle large objects (in particular those of 1GB or more). The disadvantages are that all the pointers are 8 rather than 4 bytes and so small objects are larger and more data has to be moved around, and that less external software is available for 64-bit versions of the OS. The 64-bit compilers are able to take advantage of extra features of all x86-64 chips (more registers, SSE2/3 instructions, hellip) and so the code may run faster despite using larger pointers. The 64-bit build is nowadays usually slightly faster than the 32-bit build on a recent CPU (Intel Core 2 or later or AMD equivalent). For advanced users the choice may be dictated by whether the contributed packages needed are available in 64-bit builds (although CRAN only offers 32/64-bit builds). The considerations can be more complex: for example 32/64-bit RODBC need 32/64-bit ODBC drivers respectively, and where both exist they may not be able to be installed together. An extreme example is the Microsoft Access/Excel ODBC drivers: if you have installed 64-bit Microsoft Office you can only install the 64-bit drivers and so need to use 64-bit RODBC and hence R. (And similarly for 32-bit Microsoft Office.) 2.29 Can both 32- and 64-bit R be installed on the same machine Obviously, only relevant if the machine is running a 64-bit version of Windows ndash simply select both when using the installer. You can also go back and add 64-bit components to a 32-bit install, or vice versa . For many Registry items, 32- and 64-bit programs have different views of the Registry, but clashes can occur. The most obvious problem is the file association for. RData files, which will use the last installation for which this option is selected, and if that was for an installation of both, will use 64-bit R. To change the association the safest way is to edit the Registry entry lsquo HKEYCLASSESROOTRWorkspaceshellopencommand rsquo and replace lsquo x64 rsquo by lsquo i386 rsquo or vice versa . 2.30 Rcmd is not found in my PATH This has often been reported after an upgrade. The R installer does not put Rcmd. exe (nor any other R executable) on your PATH. What seems to have happened is that people did this for themselves in the past, upgraded R (which by default will install to a different location) and un-installed the old version of R. If you do that (or install R for the first time), you need to edit the PATH. The element you want to add to the path is something like for 64-bit Rcmd. exe. replacing x64 by i386 for 32-bit. How you set the path depends on your OS version. Under recent versions, go to lsquoUser Accountsrsquo in the Control Panel, and select your account and then lsquoChange my environment variablesrsquo. (System policies can prevent end users making changes.) An alternative is to set the PATH in the shell you are running ( Rcmd. exe is a command-line program). For those using the standard Windows lsquoCommand Promptrsquo Duncan Murdoch suggested: The simple way to do it just for the command prompt is to write a little batch file setpath. bat containing and then run cmd with 3 Languages and Internationalization 3.1 The installer does not offer my language. Only a limited range of languages is supported, currently Catalan, both Simplified and Traditional Chinese, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese (Brazil), Portuguese (Portugal), Russian, Slovenian, Spanish (Spain) and Ukranian. 3.2 I want R in English (and not in French/Chinese/. ) The default behaviour of R is to try to run in the language you run Windows in. Apparently some users want 3 Windows in their native language, but not R. To do so, set LANGUAGEen as discussed in Q2.2 and Q2.15, or in the Rconsole file. 3.3 I want to run R in Chinese/Japanese/Korean. Suitable versions of Windows support what it calls lsquoEast Asianrsquo languages, but e. g. Western installations of Windows often do not have such support. So we need to assume that your copy of Windows does. Both Rterm. exe and Rgui. exe support single - and double-width characters. It will be necessary to select suitable fonts in files Rconsole and Rdevga (see Rconsole or the comments in the files: the system versions are in the etc folder) in the latter you can replace Arial by Arial Unicode MS. and we tried FixedSys and MS Mincho in Rconsole. (Note that Rdevga only applies to Windows graphics devices and not, say, to pdf .) Note that it is important that the console font uses double-width characters for all CJK characters (as that is what the width table used assumes): this is true for the fonts intended for CJK locales but not for example for Lucida Console or Consolas. You do need to ensure that R is running in a suitable locale: use Sys. getlocale() to find out. (CJK users may be used to their language characters always being available, which is the case for so-called lsquoUnicodersquo Windows applications. However, R is primarily written for Unix-alikes and is not therefore lsquoUnicodersquo in the Windows sense.) You can find suitable locale names from msdn. microsoft/en-us/library/39cwe7zf28vvs.8029.aspx and msdn. microsoft/en-us/library/cdax410z28vvs.8029.aspx beware that quotChinesequot is Traditional Chinese (code page 950, Big5) and quotchsquot is needed for Simplified Chinese (code page 936, GB2312). When using Rterm the window in which it is run has to be set up to use a suitable font (e. g. Lucida Console or Consolas. not the OEM raster fonts) and a suitable codepage (which for the Windows Cmd shell can be done using chcp ). 3.4 I selected English for installation but R runs in Chinese. Precisely, you selected English for installation . The language of the installer has nothing to do with the language used to run R: this is completely standard Windows practice (and necessary as different users of the computer may use different languages). The language R uses for menus and messages is determined by the locale . please read the appropriate manual (lsquoR Installation and Administrationrsquo) for the details. You can ensure that R uses English messages by appending LANGUAGEen to the shortcut you use to start R, or setting it in the Rconsole file. 3.5 I would like to be able to use Japanese fonts. for example, in the console and to annotate graphs. Similar comments apply to any non-Western-European language. With suitable fonts, this should just work. You will need to set MS Mincho or MS Gothic as the console font to ensure that single - and double-width characters are handled correctly. The default graphics fonts for the windows() graphics device can handle most common Japanese characters, but more specialized fonts may need to be set. (See Q5.2 for how to set fonts: the console font can also be set from the lsquoGUI preferencesrsquo menu item.) The help for windowsFonts has examples of selecting Japanese fonts for the windows() family of devices. In addition, the Hershey vector fonts (see Hershey. Japanese and demo(Japanese) ) can be used on any graphics device to display Japanese characters. To use non-Latin-1 characters in the postscript graphics device, see its help page (which also applies to pdf ). 3.6 I donrsquot see characters with accents at the R console, for example in text. You need to specify a font in Rconsole (see Q5.2) that supports the encoding in use. This used to be a problem in earlier versions of Windows, but now it is hard to find a font which does not. Support for these characters within Rterm depends on the environment (the terminal window and shell, including locale and codepage settings) within which it is run as well as the font used by the terminal window. Those are usually on legacy DOS settings and need to altered. 3.7 The dialog buttons are not translated. In most cases they actually are, but by Windows. Setting the locale or the LANGUAGE environment variable does not change the Windows setting of its lsquoUI languagersquo. Vista and later talk about the rsquoUI languagersquo and the rsquosystem localersquo for setting the language used for lsquonon-Unicodersquo programs (on the rsquoAdministrativersquo tab in Windows 7). If you have Windows running completely in say French or Chinese these settings are likely to be consistent. However, if you try to run Windows in one language and R in another, you may find the way Windows handles internationalization slightly odd. 4 Packages 4.1 Can I install packages into libraries in this version Yes, but you will need a lot of tools to do so, unless the author or the maintainers of the bin/windows/contrib section on CRAN have been kind enough to provide a binary version for Windows as a. zip file, or the package is a simple one involving no compiled code (and binary versions are usually available for simple packages). You can install binary packages either from a repository such as CRAN or from a local. zip file by using install. packages. see its help page. There are menu items on the Packages menu to provide a point-and-click interface to package installation. The packages for each minor (3.x.) version will be stored in a separate area, so for R 3.1. the files are in bin/windows/contrib/3.1. Note that the binary versions on CRAN are unsupported: see cran. r-project. org/bin/windows/contrib/3.1/ReadMe. which also gives the locations of a few other binary packages. If there is no binary package or that is not up-to-date or you prefer compiling from source, read the lsquoR Installation and Administrationrsquo manual section on lsquoAdd-on Packagesrsquo. Source packages which contain no C/C/Fortran code which needs compilation can simply be installed by install. packages(type quotsourcequot) or R CMD INSTALL pkgname at a Windows command prompt. For packages with code that needs compilation you will need to collect and install several tools: you can download them via the portal at www. murdoch-sutherland/Rtools/. Once you have done so, just run R CMD INSTALL pkgname at a Windows command prompt. To check the package (including running all the examples on its help pages and in its test suite, if any) use R CMD check pkgname. see the lsquoWriting R Extensionsrsquo manual. Note that setting up Windows to install a source package that needs compilation is rather tricky please do ensure that you have followed the instructions exactly . At least 90 of the questions asked are because people have not done so. If you have a source package that is known to work on a Unix-alike system, you can try the automated Windows binary package builder documented at win-builder. r-project. org. 4.2 I donrsquot have permission to write to the R-3.3.1library directory. You can install packages anywhere and use the environment variable RLIBS (see How do I set environment variables ) to point to the library location(s). Suppose your packages are installed in p:myRlib. Then you can EITHER OR use a package by, e. g. You can also have a personal library, which defaults to the directory Rwin-library x. y of your home directory for versions x. y.z of R. This location can be changed by setting the environment variable RLIBSUSER. and can be found from inside R by running Sys. getenv(quotRLIBSUSERquot). This will only be used if it exists so you may need to create it: you can use to do so. If you use install. packages and do not have permission to write to the main or site library, it should offer to create a personal library for you and install the packages there. This will also happen if update. packages offers to update packages for you in a library where you do not have write permission. There can be additional security issues under Windows Vista and later: See Does R run under Windows Vista. In particular, the detection that a standard user has suitable permissions appears to be unreliable under Vista, so we recommend that you do create a personal directory yourself. 4.3 The packages I installed do not appear in the HTML help system. This question applied to the pre-2.10.0 HTML help system, which has been replaced. 4.4 My functions are not found by the HTML help search system. This question applied to the pre-2.10.0 search system, which has been replaced. 4.5 Loading a package fails. Is the package installed for this version of R Packages need to have prepared for R 2.10.0 or later, and packages containing compiled code for R 2.12.0 or later. You can tell the version the package was compiled for by looking at the lsquo Built: rsquo line in its DESCRIPTION file. For a small number of binary packages you need to install additional software and have its DLLs in your PATH. Windows will normally give an informative message about a certain DLL not being found. See cran. r-project. org/bin/windows/contrib/3.1/ReadMe for a listing of some of these packages (notably RGtk2. cairoDevice. rggobi. rJava. rjags and some of the packages connecting to databases). 4.6 Package TclTk does not work. For package tcltk to work (try demo(tkdensity) or demo(tkttest) after library(tcltk) ) you need to have Tcl/Tk installed. This is part of the R installation, so it should be there. However, if you have the environment variable MYTCLTK set to a non-empty value, it is assumed that you want to use a different Tcl/Tk 8.5.x installation with the path to its bin directory given by value of MYTCLTK. and that this is set up correctly (with TCLLIBRARY set if needed). Note that you do need 8.5.x and not 8.4.x nor 8.6.0, and you do need the architecture to match, that is a 32-bit or 64-bit build of Tcl/Tk to match the R build in use. (There is no guarantee that a 64-bit build will work: it depends on the layout it uses.) In the past several package authors have suggested using ActiveTcl (www. activestate/Products/activetcl/ ) as a way to get Tcl/Tk extensions (but the support files do contain the most commonly used TkTable and BWidget extensions). This could be used by setting (for a default install) but current versions do not by default contain any extra extensions (although they may be downloaded via the Teacup facility) and this only works for 32-bit R. 4.7 Hyperlinks in HTML sometimes do not work. This question was much more relevant prior to version 2.10.0. They may still not work between packages installed in different libraries if the HTTP server has been disabled: the remedy is not to do that 4.8 update. packages() fails. You may not be able to update a package which is in use: Windows lsquolocksrsquo the packagersquos DLL when it is loaded. So use update. packages() (or the menu equivalent) in a new session. If you put library(foo) in your. Rprofile you will need to start R with --vanilla to be able to update package foo. If you set RDEFAULTPACKAGES to include foo. you will need to unset it temporarily. It has been reported that some other software has interfered with the installation process by preventing the renaming of temporary files, Google Desktop being a known example. 4.9 How do I add to the list of repositories as shown in the Select repositories. item on the Packages menu This reads from the tab-delimited file RHOMEetcrepositories. which you can edit, or put a modified copy at. Rrepositories in your HOME directory (see What are HOME and working directories ). 4.10 Help is not shown for some of the packages This was about Compiled HTML help, which has not been supported since R 2.10.0. 4.11 How do I get static HTML pages We presume you want to do this for some special purpose: Rrsquos help system will not make use of them, links across library directories will not work (unlike R lt 2.10.0), ambiguous links will be resolved at install time and missing links will be broken (previous versions used JavaScript to look for them at run time). But if you still want them, here is how to do it. Static HTML pages are not part of the binary distribution, so you will need to install R and/or packages from their sources. To install just a few packages with static HTML pages use To install R itself with static HTML pages you need to build it from the sources for yourself. Change the following line in file MkRules. local (after copying MkRules. dist to MkRules. local if that has not already been done). and them all packages installed by that build of R will (by default) be installed with static HTML pages. 4.12 How can I get a binary version of a package Presumably one not available on CRAN, BioC or a similar repository. If you have a source package that is known to work on a Unix-alike system, you can try the automated Windows binary package builder documented at win-builder. r-project. org. If the package is not yours, please remember to change the maintainer address so the results go to you and not the author(s) However, if a CRAN package is not available in binary form, this usually means that there is a problem with some dependent package or external software (often mentioned in the ReadMe file in the binary repository directory). You can email R-windowsr-project. org expressing a wish for such a package to be portedmdashthe maintainers will take such wishes into account when prioritizing work on binary packages. In many cases installing packages from the sources is not at all difficult (it is simple if the package contains no compiled code), so please attempt that for yourself before requesting help from the busy volunteers. 4.13 Package xxx is out of date for Windows Here are three possible reasons: You are simply impatient, and need to wait until the binary package has been built and propagated to the CRAN mirror you are using. This normally (but not always) happens within 24 hours. Sometimes mirrors do get behind (especially unofficial ones), so you could try another mirror. (Mirror statistics are linked near the top of the CRAN mirror page at cran. r-project. org/mirrors .) The latest version of the package might require a later version of R than the one you are using. You can check on the packagersquos HTML page on CRAN, and update your R if needed. Your R might be too old. Binary packages for the 3.x series are built (if possible) whilst 3.(x1) is current, but building stops once 3.(x2) reaches alpha (pre-release, about a month before release). You can always try installing from the sources. 4.14 No binary packages appear to be available for my version of R How old is it The CRAN policy is to archive binary packages two years after the 2.x series is closed. Other repositories may do so sooner. If you are using an R version that old we advise you to update your R, but you do also have the option of installing packages from their source. 4.15 How do I build my package for both 32- and 64-bit R Packages without compiled code nor a configure. win script will run on both 32- and 64-bit R. Packages with compiled code but no configure. win nor src/Makefile. win file will be built for both when running on a 64-bit version of Windows if both versions of R are installed. An empty configure. win is treated in the same way as if none existed. Also, there is a list of packages known to have an architecture-independent configure. win hardcoded into R CMD INSTALL. and for these packages, both architectures will be built under the above conditions. Other packages can be installed with configure. win run for just the first architecture by using option --force-biarch. Any package can be installed for first one architecture and then the other with option --merge-multiarch. but the package source must be a tarball (and as before, running on a 64-bit version of Windows with both versions of R installed). Finally, a package without a src/Makefile. win file and no or empty or architecture-independent configure. win file can be installed for both architectures from 32-bit Windows if the 64-bit components were selected when R was installed and option --compile-both is given. Obviously, only the 32-bit installation can be tested. 5 Windows Features 5.1 What should I expect to behave differently from the Unix version of R R commands can be interrupted by Esc in Rgui. exe and Ctrl-break or Ctrl-C in Rterm. exe. Ctrl-C is used for copying in Rgui. exe. Command-line editing is always available, but is somewhat simpler than the readline-based editing on Unix. For Rgui. exe. the menu item lsquoHelp Consolersquo will give details. For Rterm. exe see file README. rterm. Paths to files (e. g. in source() ) can be specified with either quot/quot or quotquot. system() is slightly different: see its help page and that of shell(). 5.2 I hear about some nifty features: please tell me about them You have read the file README. R-3.3.1. There are file menus on the R console, pager and graphics windows. You can source and save from those menus, and copy the graphics to png. jpeg. bmp. postscript. PDF or metafile. There are right-click menus giving shortcuts to menu items, and optionally toolbars with buttons giving shortcuts to frequent operations. If you resize the R console the options(width) is automatically set to the console width (unless disabled in the configuration file). The graphics has a history mechanism. As README. R-3.3.1 says: lsquoThe History menu allows the recording of plots. When plots have been recorded they can be reviewed by PgUp and PgDn . saved and replaced. Recording can be turned on automatically (the Recording item on the list) or individual plots can be added (Add or the INS key). The whole plot history can be saved to or retrieved from an R variable in the global environment. The format of recorded plots may change between R versions. Recorded plots should not be used as a permanent storage format for R plots. There is only one graphics history shared by all the windows devices. rsquo The R console and graphics windows have configuration files stored in the RHOMEetc directory called Rconsole and Rdevga you can keep personal copies in your HOME directory. They contain comments which should suffice for you to edit them to your preferences. For more details see Rconsole. There is a GUI preferences editor invoked from the Edit menu which can be used to edit the file Rconsole. 5.3 Circles appear as ovals on screen. The graphics system asks Windows for the number of pixels per inch in the X and Y directions, and uses that to size graphics (which in R are in units of inches). Sometimes the answer is a complete invention, and in any case Windows will not know exactly how the horizontal and vertical size have been set on a monitor which allows them to be adjusted. You can specify correct values either in the call to windows or as options: see windows. (Typically these are of the order of 100.) On one of our systems, the screen height was reported as 240mm, and the width as 300mm in 1280 x 1024 mode and 320mm in 1280 x 960 and 1600 x 1200 modes. In fact it was a 21quot monitor and 400mm x 300mm This is less common with LCD screens but not unknown, particularly if they are not running at their native resolution. 5.4 How do I move focus to a graphics window or the console You may want to do this from within a function, for example when calling lsquo identify rsquo or lsquo readline rsquo. Use the function lsquo bringToTop() rsquo. With its default argument it brings the active graphics window to the top and gives it focus. With argument lsquo -1 rsquo it brings the console to the top and gives it focus. This works for Rgui. exe in MDI and SDI modes, and can be used for graphics windows from Rterm. exe (although Windows may not always act on it). 5.5 What does TAB completion do Both Rgui and Rterm support TAB completion. Hitting TAB whilst entering a command line completes the current lsquowordrsquo as far as is unambiguously possible. Hitting TAB a second time then shows a list of possible completions (or the first few if there are many): the user can then enter one or more characters and hit TAB again. What is it lsquocompletingrsquo There are two modes: within an unterminated (single - or double-) quoted expression it completes file paths. 4 Otherwise, it is completing R expressions: most obviously it will match visible R object names and keywords, so apr followed by TAB will (in a vanilla session) complete to apropos. After a function name and parenthesis (e. g. apropos( ) it will complete argument names (and ), and after or it will complete list components or slot names respectively. This feature can be turned off: Rgui has two menu items to do so, and setting the environment variable RCOMPLETION to FALSE turns it off completely for both Rgui and Rterm. Further, the behaviour can be fine-tuned: to see the settings available use which also explains how the various types of completion work. This feature is very similar to the completion available in the readline - based command line interface on Unix-alikes: the OS X GUI R. app has a different completion scheme. 6 Workspaces 6.1 My workspace gets saved in a strange place: how do I stop this Have you changed the working directory. see Q6.2. 6.2 How do I store my workspace in a different place Use the lsquoFile Change Dir. rsquo menu item to select a new working directory: this defaults to the last directory you loaded a file from. The workspace is saved in the working directory. You can also save a snapshot of the workspace from the lsquoSave Workspace. rsquo menu item. From the command line you can change the working directory by the function setwd. see its help page. 6.3 Can I load workspaces saved under Unix/GNU-Linux or Mac OS X Yes. All ports of R use the same format for saved workspaces, so they are interchangeable (for the same 3.x. version of R, at least). Note though that character data in a workspace will be in a particular encoding that is not recorded in the workspace, so workspaces containing non-ASCII character data may not be interchangeable even on the same OS. Since R marks character data when it knows it to be in UTF-8 or Latin-1 (including its Windows superset, CP1252), strings in those encodings are likely to be transferred correctly: fortunately this covers most of the common cases (OS X normally uses UTF-8, and Linux users are likely to use UTF-8 or perhaps Latin-1). It is possible to save references to package namespaces when saving the workspace: if that happens the package will need to be installed on the machine loading the workspace. 7 The R Console 7.1 When using Rgui the output to the console seems to be delayed. This is deliberate: the console output is buffered and re-written in chunks to be faster and less distracting. You can turn buffering off or on from the lsquoMiscrsquo menu or the right-click menu: Ctrl-W toggles the setting. If you are sourcing R code or writing from a function, there is another option. A call to the R function flush. console() will write out the buffer and so update the console. 7.2 Long lines in the console or pager are truncated. They only seem to be truncated: that at the end indicates you can scroll the window to see the rest of the line. Use the horizontal scrollbar or the CTRL left/right arrow keys to scroll horizontally. (The left/right arrow keys work in the pager too.) 8 Building from Source 8.1 How can I compile R from source See the lsquoR Installation and Administrationrsquo manual (for the version of R you want to install). 8.2 Can I use a fast BLAS Fast BLAS (Basic Linear Algebra Subprograms, wwwlib. org/blas/faq ) routines are used to speed up numerical linear algebra. There is support in the R sources for the lsquotunedrsquo BLAS called ATLAS (math-atlas. sourceforge ). The savings can be appreciable but because ATLAS is tuned to a particular chip we canrsquot use it generally. However, linear algebra on large matrices is not often an important part of R computations, and more typical calculations on small matrices may run slower. BLAS support is supplied by the single DLL RHOMEbinx64Rblas. dll. and you can add a fast BLAS just by replacing that. Replacements for 32-bit R and some of the older common chips are available on CRAN in directory bin/windows/contrib/ATLAS. See the R Installation and Administrationrsquo manual for how to build an ATLAS Rblas. dll tuned to your system using the R sources. Unfortunately the process has been less successful when tried for the common current chips such as Intelrsquos Core 2. Versions of Dr Kazushige Gotorsquos BLAS (see en. wikipedia. org/wiki/KazushigeGoto ) for 64-bit Windows by Ei-Ji Nakama can be found at prs. ism. ac. jp/ nakama/SurviveGotoBLAS2/binary/windows/x64/. Just download the file Rblas. dll appropriate to your CPU and replace RHOME /bin/x64/Rblas. dll. (There is also a generic version called lsquo DYNAMICARCH rsquo that tries to adapt itself to the CPU found ndash however if you know the exact CPU used it is better to download the CPU-specific version. Note that development of that BLAS was frozen in 2010 so you will not find versions for recent CPUs.) Note that fast BLAS implementations may give different (and often slightly less accurate) results than the reference BLAS included in R. 8.3 How do I include compiled C code We strongly encourage you to do this via building an R package: see the lsquoWriting R Extensionsrsquo manual. In any event you should get and install the tools and toolchain mentioned in the lsquoR Installation and Administrationrsquo manual. Then you can use to make foo. dll. Use. binx64R CMD SHLIB --help for further options, or see SHLIB. (Replace x64 by i386 for 64-bit R.) If you want to use Visual C, Borland C or other compilers, see the appropriate section in README. packages. 8.4 How do I debug code that I have compiled and dyn. load-ed Debugging under Windows is often a fraught process, and sometimes does not work at all. If all you need is a just-in-time debugger to catch crashes, consider (32-bit) Dr. Mingw from the mingw-utils bundle on www. mingw. org. That will be able to pinpoint the error, most effectively if you build a version of R with debugging information as described below. First, build a version of the R system with debugging information by and make a debug version of your package by You will need a suitable version of gdb which matches your compiler. Then you can debug by (or use Rterm. exe .) However, note gdb may only be able to find the source code if we run in the location where the source was compiled ( R-3.3.1/src/gnuwin32 for the main system, R-3.3.1/src/library/mypkg/src for a package), unless told otherwise by the directory command. It is most convenient to set a list of code locations via directory commands in the file. gdbinit in the directory from which gdb is run. It is only possible to set breakpoints in a DLL after the DLL has been loaded. So a way to examine the function tukeyline in package stats might be Alternatively, in Rgui you can use the lsquoMiscBreak to debuggerrsquo menu item after your DLL is loaded. The C function call breaktodebugger() will do the same thing. Fortran symbols need an underline appended. Windows has little support for signals, so the Unix idea of running a program under a debugger and sending it a signal to interrupt it and drop control back to the debugger does not work with a MinGW version of gdb. It does often work with the cygwin version. 8.5 How do I include C code You need to do two things: (a) Write a wrapper to export the symbols you want to call from R as extern quotCquot. (b) Include the C libraries in the link to make the DLL. Suppose X. cc contains your C code, and Xmain. cc is the wrapper, as in the example in lsquoWriting R Extensionsrsquo . Then build the DLL by ( gcc ) or (VC, which requires extension. cpp ) and call the entry point(s) in XR. such as Xmain. Construction of static variables will occur when the DLL is loaded, and destruction when the DLL is unloaded, usually when R terminates. Note that you will not see the messages from this example in the GUI console: see the next section. 8.6 The output from my C code disappears. Why The Rgui. exe console is a Windows application: writing to stdout or stderr will not produce output in the console. (This will work with Rterm. exe .) Use Rprintf or REprintf instead. These are declared in header file Rext/PrtUtil. h. Note that output from the console is delayed (see The output to the console seems to be delayed ), so that you will not normally see any output before returning to the R prompt. 8.7 The output from my Fortran code disappears. Why Writing to Fortran output writes to a file, not the Rgui console. Use one of the subroutines dblepr. intpr or realpr documented in the lsquoWriting R Extensionsrsquo manual. Note that output from the console is delayed (see The output to the console seems to be delayed ), so that you will not normally see any output before returning to the R prompt even when using the xxxpr subroutines. 8.8 The console freezes when my compiled code is running. The console, pagers and graphics window all run in the same thread as the R engine. To allow the console etc to respond to Windows events, call RProcessEvents() periodically from your compiled code. If you want output to be updated on the console, call RFlushConsole() and then RProcessEvents(). Footnotes Non-administrator accounts will automatically be offered a default installation directory in the user area. what Windows calls x64 for x86-64 CPUs, not the very rare ia64 Windows for Itanium CPUs. or they may have no choice: apparently some Windows editions are tied to a specific language. It does not have a complete understanding of Windows file paths, but can complete most relative or absolute file paths, including drives and spaces. Relative paths on drives are not handled, for example.

No comments:

Post a Comment